In my game I have an array, 10x10x1 (x,y array). This array can have 3 values :
0) player
1) wall
2) enemy
---
And now I'm stuck. How can I move the player, and move every single '1' basing upon the direction of the player?
I want the player to move on the array when I press the arrow keys.
I want the wall to block enemy and player movements.
I want the enemies to move every turn towards the player (even diagonally).
How can I find a value in the array (0) and move it?
How can I find each value in the array (2) and move them independently?
If someone provides me an example I'll be very happy.
---
Also, how can I render my array with sprites? Rendering the player is easy, but what about walls and stuff? Won't there be a delay rendering every cell?