   pacman levels in opengl
  hey...I've just started to build a pacman game in opengl (c++), and was wondering if anyone had any tips as to how to approach the levels?http://gfx.download-by.net/screen/112/112193-pac-man-extreme.jpgi'm hoping to achieve something as close as i can to the original look (as above).if anyone has made a pacman style game using opengl, how did you approach the levels?I'd be grateful of any responsethanks   
  Hi,Maybe this could work:- Make an image for the background (the blue lines on your screenshot) and use it as texture  for a quad filling the screen- define some paths where the actors can "walk" along (the white dots on the screenshot)This should not be so hard but maybe is not the best way....but it is enough for a simple game like this   ;  Making the level graphics tile based should work. For that screenshot, you'd have a horizontal straight tile, a vertical straight one, one for each corner type, etc. So instead of rendering one big texture for the level background, you're rendering a grid of tiles. I've done this with a 2D racing game and it worked great.   ;Quote:Original post by ddxMaking the level graphics tile based should work. For that screenshot, you'd have a horizontal straight tile, a vertical straight one, one for each corner type, etc. So instead of rendering one big texture for the level background, you're rendering a grid of tiles. I've done this with a 2D racing game and it worked great.I'll second this. Go tile based. But I'd like to recommend a different method of doing so, which I think would be more simple for getting the original look, and its how the original pacman worked, I believe.When I look at that image I'm seeing a 28 column grid. Tiles are either passable, impassable, passible with a small pill, or passble with a big pill. I'm also seeing 4 fundamental kinds of tile, unlike a racing game which has loads:0 = impassable, 1 = passable with a little pill.2 = passable with big pill3 = passable with no pill.When you go over a #1 or #2 gridsquare, it turns into a #3 gridsquare.Your tiles for each level would be stored in a text file. The tiles themselves are used for movement and collision detection. You then create a background image to match the tileset. The top row is all impassable tiles. because its not passable at all. pacman cannot turn onto one of those squares and neither can a ghost.the second row is like this:0111111111111001111111111110notice the wall in the middle, which is two gridsquares wide.the third row is like this:0200001000001001000001000020The first gridsquare is a 0 (impassable) the second is a 2(big pill), then comes a big block of impassable squares, etc.Thats how I see it anyway.[edit]sorry, forgot to mention movement. Pacman is an object with two direction properties. A direction is either north, south, east or west.The first is the direction Pacman is currently moving in. On each frame, he moves in that direction unless he is going to contact an impassible square.The second is the direction the user wants to move pacman in. On each frame, if pacman can move in that direction, the first direction changes to this one.As far as collision goes, pacman and the ghosts are considered entirely inside the grid square that his center of gravity is inside, and this is calculated through integer division. The position of the image is interpolated for smoothness of animation. AI is easy. Each ghost has a third direction as well as pacman's two, which is the direction to go to get closer to pacman. the ghost then either sets its secondary direction to this or, if not possible, it chooses to go the direction 90 degrees out from this third direction or, as a last resort, go in the opposite direction. Depending on difficulty level, the ghosts might accidentally choose the wrong direction. (n.b. you could improve this somewhat by using a* instead but old skool pacman didn't have that).Good luck![Edited by - shotgunnutter on September 14, 2007 8:15:32 PM]