1
Graphics / Board for PacMan
« on: December 25, 2011, 12:23:51 am »
The easiest way would be to have two arrays ( rows and columns ) and fill them with 1's and 0's which will define the maze.
Then you just draw the maze. Every square there is a 1, you have a wall. Every square that is a 0, you have a walkable path.
A small example:
1111111111111
1000000000001
1111110111111
1000000000001
1111111111111
You can walk about in either stretch where there is 0's, and you can pass from one side to the other using the middle path with the 0.
Then you just draw the maze. Every square there is a 1, you have a wall. Every square that is a 0, you have a walkable path.
A small example:
1111111111111
1000000000001
1111110111111
1000000000001
1111111111111
You can walk about in either stretch where there is 0's, and you can pass from one side to the other using the middle path with the 0.