Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Independent axes for sprite-sprite collisions #149

Open
robbrit opened this issue May 2, 2023 · 0 comments
Open

Independent axes for sprite-sprite collisions #149

robbrit opened this issue May 2, 2023 · 0 comments

Comments

@robbrit
Copy link
Owner

robbrit commented May 2, 2023

Right now when sprites collide at all, it halts the movement. This isn't ideal, it'd be better to be able to "slide" - if you are moving diagonally and hit another sprite, you should slide along the sprite in the direction that the sprite isn't in.

For example if you're moving down and right and you bump into a sprite on your right, you should continue sliding down.

This might be a bit tricky because sprites can also move. We'll probably want to apply the X and Y moves separately:

for each sprite:
  move it in the X direction
  check for collisions with walls
  check for collisions with other sprites

revert X for any that hit things
repeat for Y
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant