You are browsing as a guest. Sign up (or log in) to start making projects!

9h 42m 24s logged

Enemy AI done + Tons more!

Other things done this time around:

  • Fix: WASM build fixes
  • Feature: Added the back button in Avatar Menu (finally)
  • Fix: The character scale and position in Main/Avatar Menu acted funny in extreme dimentions (when too small)
  • Fix: Physics renderer didn’t render polygons with 4 vertices
  • Feature: Added physics colliders for all enemies!
  • Feature: Y-Sorting enabled
  • Performance: Pushed Data Oriented Design for max performance
  • Architecture: Moved the files around, where they make more sense
  • Feature: Implemented Attacking
  • Feature: Player & Enemy State machine
  • Feature: Enemy AI (super basic tbh)

Performance

All of these changes were made keeping performance in mind. As of right now the state machines need work to make them even faster!

Obstacles

State machine logic is very mind numbing, I won’t want to do that…. a lot of edge case problems. A lot of problems I never thought existed.

Y-Sorting was also in the harder side because I wanted a fast sort while also not needing to change the whole array of entities. I finally decided to use another array render_list of type []int this essentially sorts the id (or index in this case) of the entities by entity.pos.y. When rendering use the ids to render. This proved to be a more efficient way to do it, than sorting the entire array of entities.

Future Todos

  • Implement Enemy attacking
  • Implement health system (with regenability?)
  • Draw the health bar
  • Implement death

After these things are done. We I will think of further things like game win/game end amongst many others like game pause.

0
6

Comments 0

No comments yet. Be the first!