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!

P#139554 2024-01-02 22:30

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!

P#139557 2024-01-02 23:17 ( Edited 2024-01-03 01:11)

I'll give it a try thank you.

Edit: It worked thanks.

P#139559 2024-01-02 23:47 ( Edited 2024-01-03 01:10)

[Please log in to post a comment]