Collision #1






From Behind to Front
Today I worked on creating and setting collisions between the game world (World), the player (Player) and the enemy (Enemy)
Without physical collisions there are no blocks preventing you from passing a “wall”, resulting in the player being able to pass through physical elements of the scenario. This needs to be handled well…
The first thing I did was create the appropriate CollisionShape for Player and Enemy, to cover the entire sprite.
Once I tried it I realized that something was wrong.. the player seemed to pass behind the enemy’s feet in a completely unnatural way.. aarghhhh!!
By appropriately setting the collision layers and the y-sort property of the parent node (World) I managed to obtain the effect I wanted: the player naturally passed behind or in front of the enemy, however now there was another problem to solve!
By leaving the shapes in full body there was no margin between the sprites: the player could only pass when the entire sprite was completely in front of the enemy and vice versa from behind… it was horrible!
The solution was to reduce the shape of the player by excluding the head (the part that would therefore NOT collide anymore), and in the case of the enemy, reduce it only to half the body
So finally the effect of passing in front of and behind the enemy seems realistic! YEAAHHH
The next step is to make this damned enemy move!
Eternal Light
My journey into pixel art & indie RPG gamedev – one step at a time.
Status | In development |
Category | Other |
Author | DeusDev |
Genre | Role Playing |
Tags | devlog, Godot, Indie, Pixel Art, work-in-progress |
Languages | English |
Accessibility | Subtitles |
More posts
- Animation Manager #21 day ago
- Animation Manager #12 days ago
- EnemyManager #211 days ago
- EnemyManager #113 days ago
- Input System #114 days ago
- Character #116 days ago
- Main Lore #116 days ago
- Welcome Aboard!22 days ago
Leave a comment
Log in with itch.io to leave a comment.