EnemyManager #2

Steps to perfection
Today I focused on establishing a small idle walk pattern for the enemy.
To respect the set architecture, the pure management of the movement has been entrusted to the EnemyManager which takes the necessary data from the Enemy (e.g. speed and direction).
After having set everything up correctly, I asked myself: what path should the enemy take? Forward and backward, clockwise, etc. The more I thought about it, the less I liked the idea of a fixed route, so I opted for a random route, where at each step a direction is chosen.
I work hard, write the code for randomization but I run into an annoying problem… sometimes the enemy gets stuck in one direction and continues to stay there! This is because the algorithm chooses randomly and could return out the same previous direction… not good at all.
So I perfected this pattern by making sure that if the enemy found an obstacle he would not repeat the same direction.
To keep things streamlined I simply memorized the last direction chosen by the EnemyManager and discarded it from the possible subsequent ones.
In the screen you can see part of the movement algorithm, it works well though it’s not perfect.
Now.. what to do next? Do I focus on refining the code architecture more or implement a new manager?
Stay tuned!
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
- Character #294 days ago
- Characters #195 days ago
- WorldItem #1Oct 13, 2025
- Animation Manager #2Oct 03, 2025
- Animation Manager #1Oct 02, 2025
- Collision #1Sep 22, 2025
- EnemyManager #1Sep 21, 2025
- Input System #1Sep 20, 2025
- Character #1Sep 18, 2025
Leave a comment
Log in with itch.io to leave a comment.