Log In  


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.

Cart #koz_colldemo-0 | 2024-01-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


(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!


I'll give it a try thank you.

Edit: It worked thanks.



[Please log in to post a comment]