Latest improvements in My Video Game Project
Hi! As the project went along, a lot of serious bugs. appeared That is why I focused on fixing them in this new 0.5 update. On top of that, I also worked on improving the code structure using a simplified version of “State Machine”.
Let's dive in!
· Reworked moving and attacking
??? A bit about state machines
??? How I made it work
??? More Movement Component Changes
· Visual Improvements
??? Support Lines
??? Improved Unit Information Bar
??? Improved Buy Bar
??? Show And Hide Button
· Small Changes:
· Bug Fixes:
· Conclusion
· Demo

Reworked moving and attacking
A bit about state machines
When you code a video game object you usually face a situation, where your object can have multiple types of states, that all alter its main behavior. In the example of the units in my game, they can be either, idle, moving, attacking, or supporting (in the case of support class units). To avoid an if statement hell when deciding, what code to run, it is often useful to use this code pattern.