Good evening!
Here's the hacked-together mess of a game so far:
The player moves the blue square around a block maze. Graphics are amazing. Player can't handle the level of realism.
Here is my attempt at the enemies' basic AI, characterized by the red squares, because for some reason red equals bad:
It is atrocious and complicated and only sort of works, in that the enemies will crawl, cell by cell (16 x 16px) toward whatever the player's X and Y coordinates are. But it has some issues which is why I'm posting here, as well as lighting black voodoo candles to wish for programming skills.
Here's what I want it do:
- Enemies go toward the player by one square every second or so, up down or diagonally.
- It's okay if the blocks easily thwart the enemies. Luring them behind a block to stop them is part of the strategy.
- They use the "grid" background squares' "Covered" instance variable to check if it's open.
- Enemies treat each other as obstacles and do not overlap.
Here's what it actually does:
- The enemies, when going diagonally, they can spit in the face of physics and overlap blocks. The "grid" object's instance variable is being ignored and moving to the space anyway.
- The enemies seem to love each other. Once they overlap they stick together and act as one.
I hope somebody out there can think of an event type that I am ignorant to. I also hope my goals aren't too lofty as I just want these enemies to be brain-dead monsters that run into walls. MAYBE implement something that, if they're stuck, try a random movement along the other axis to try and break free.
Finally, here's the capx:
https://drive.google.com/open?id=1ZQFji-wKQ05A4L-0aluGT8IFli_lUwiW
Thank u all my sweet babies