- Mon 8 Oct 2018, 21:52
#68393
I have a platformer that is coming along nicely. But, I have a block that can be hit from the bottom by jumping like in super mario brothers. When this block is hit, it displays a little message a hint of some kind. The problem is I want to have one or two in each level and the sign read different for each block the player collides with. No matter which block, of the block type I hit, it pops up the same message. If I have to, I can duplicate the object many times, and give each object a different name, like whiteExclamationBlock1...2 etc. The only other way I know, would be to check the players coordinates and say "player is in collision with WhiteExclamationBlock" player.X() = value player.y()=value then based on the players position as to which sign is shown. I could use text objects for the hints instead of sprites if I chose to.
Is there a way to specify which instance of an object I am working with like "WhiteExclamationBlock instnace 1" or something in the events? .