I am making an asteroid destroyer game, and when trying to add health to the asteroids in the form of a dictionary, every time I try to get that value correctly it just returns "not found" all the time. Can anyone help?
Tested it out, and it works OK for me. Check that all the variables that you use are set. Use Do It in companion to debug (you may need to set things to labels or variables to test)
I cannot see any reason why it doesn't work. You may have to carefully debug / disassemble to find the cause. Note: you have a red cross where you call the notifier (item).
You always get "not found". In the procedure "getAsteroidMeta" a component is required. If it matches "getValue" of dictionary then "result" is updated (gets a value/an ASTEROID component). But this procedure is called by "When ANY ImageSprite.CollidedWith". So, "other" being a component else than an "asteroid" - my be a fire/laser - doesn't change "result" from its initial "not found". And there are indeed many sprites whose colliding events could call the "When ANY ...." with the consequence of not changing "result" from "not found". As a solution you should find a filter for asteroids. Other sprites shouldn't lead to calling the "getValue". Perhaps:(I didn't try it; you know your app better than I do).: