Hi,
I am having trouble programming sprites and collisions.
I am looking for a simple way of accomplishing it; I have tried tutorials on YouTube but there is no success.
Any help would be appreciated.
Thanks!
2
Here's a cart containing just collision code. The gist is, before moving, to check the fget(mget(x/8, y/8), 0)
of a pixel or pixels that shouldn't be allowed to move into a wall (replace 0 with your "wall" flag) and only allow the move if the flag isn't present at those points.
(cc0, code is free to use)
It'll have to be a bit different if your movement style is different.
Let me know if you have any questions!
[Please log in to post a comment]