Search code examples
c++mappingpacman

How to Map a Pacman Maze Using 2D Array


I have created a map (experimental) which has a '#' value if there is a Boundry Wall in the maze. Laying the Map Graphically I use a checking condition that if the value of the 2D array is a # then put an image in that cell. But the Problem is That How will i know Know where to put the image on the screen (The Pixel Position of the Screen).


Solution

  • Simply multiply the x position by the width of your graphics tile and the y position by its height...?