I am trying to make a pacman game in c#. I have done some basic work and have previously replicated games like copter-it and minesweeper. I am confused about how to implement the map in pacman. Which datastructure to use, so it can be used for moving AI controlled objects and check collisions with walls? I thought of a 2d array of ints but that didn't make sense to me.
closed as off topic by ChrisF♦ Mar 5 at 22:35
Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.
I used to write pacman style games on the Spectrum as a kid. A 2d array is perfectly adequate, all you need is a value for wall, a value for road and a value for road with dot on. Your position is x,y, you can decide whether you can move, or eat a dot by interrogating the cells around.
A common tip is to create a fake wall around the map so you don't have to check that you're not running off the edge of the array. It means all the checks are "is cell of type" rather than "is x >=0 and x < dimension length AND is cell of type"