No Vindication Blog


11/19/2014 [Smooth Collisions, Object Sliding and Depth]


Depth is pretty much standard - we have static and dynamic objects, only in the sense of mobility. Static objects, like boxes, walls, etc are set to whatever the negative value of their Y coord is on the level grid. Dynamic objects, like the player, have their depth set to the negative value of their Y coord (minus) half the height of the sprite. So far this is sufficient.

Smooth Collisions / Object Sliding

I have also been working on finishing my implementation for smooth collisions / object sliding. The player should be pushed off of objects (by a few pixels) depending at what direction they encounter it. See below:


There are only 5 possible directions to hit a collision line when the player is walking forward (backward walking will not use sliding, at least not as of yet - the player's movement instead will simply be halted)

Whats Next?

I want to create some object proximity awareness code to create collision "bridges" between intersecting walls/corners of objects. This will prevent some ugly conflicts and pass-through glitching. I have some ideas on how to accomplish this but they must be tested!