Hey, I'm making a small game.
I need to get the flag value of a sprite I'm drawing and moving in the _draw function.
I need to know when the player hits the sprite. But I can't use mget() to get sprite number of it, because the sprite is not part of the map..
Any ideas how to go about it?
Right now I'm just using pget() to register it by color, but that solution is not super stable with so few colors ;)
Hope someone can help.
Jelpi has pretty clear collision code. Just ctrl-f "collide" and ctrl-g some to find all the relevant parts. It takes the difference in position, and compares that to the size of the two things colliding. (if they're closer together than they are tall/wide, then they have to be overlapping)
It actually runs through every active actor and checks if the player ran into it each frame. (works fine, since there's only a handful on screen at once) Inside collide_event() it uses the sprite number ("frame") to determine what to do in each case.
[Please log in to post a comment]