Postby PixelPest » Tue Jul 12, 2016 7:06 am
I think the best way to do this would be to use Graphics.drawImageToSceneWP() to draw the actual sprites of the Dragon Coins at their desired points in the level. You can also use a counter to display when to change the frames and then add a custom hitbox via colliders. When the player collides with the new box, via testing for colliders.collide(), you can play any sounds and draw any effects (including the score effect) you need to and then increase the Dragon Coin count (it's a global mem value) by one as well as the Score count (also a global mem value) by however much the score was. You may also need a counter in function onNPCKill() to determine how many Dragon Coins have been collected, such that you can spawn the correct score effect and add the correct score to the memory (since the score of Dragon Coins starts at 1000 and doubles each time, until it reaches 8000, when the next one is a 1-up). I really don't think there is any way you can cancel the effects of the P-switch for just a certain NPC, so I'd suggest using this way since it is pretty fail-safe. If you need to, you can also add it to a moving layer by checking for events, via function onEvent, and then changing the x and y-values as needed based on the returned event