GuillemBarroso / CLing

2D survival game using command line
MIT License
3 stars 1 forks source link

Improve player movement #12

Closed GuillemBarroso closed 1 year ago

GuillemBarroso commented 1 year ago

Now, if an illegal movement is detected, the entire movement is reset to the old position.

Instead, when checking for collisions with limiting blocks, prevent only the illegal direction.

That is, if a vertical block is found, prevent only velocities in the horizontal direction across the block. Similar to a wall condition in fluids where only one velocity is set to zero.