Help in doing levels

Started by
2 comments, last by Micha 24 years, 6 months ago
Hello all, i want to program a game like breakout, with a lot of levels. But i''ve no idea on how to do the levels. Can anyone help me, please? Thank you
Advertisement
Hi!

Well how about to make a level editor =)
OR you can do as i did when i was making a breakout game som years ago, use a paint program and let every pixel be a brick in the game. With other words paint your levels.
You''d want to store all of the information for your levels in some sort of files, or bundle the whole lot up into one file. Then you''d need to create some sort of level editor to create the files easily.

- Daniel
http://sw.mtx.net/daniel/
- DanielMy homepage
You can make the level editor easily with textmode. Store the bricks in an array like:
unsigned char bricktype[ysize][xsize];
Fill at ysize the maximum rows of bricks you want to have.
Fill at xsize the maximum of columns of bricks you want to have.
write it to a file with this code:
fstream brickfile;brickfile.open("levels.dat",0x92);brickfile.write(bricktype,ysize*xsize);brickfile.close(); 

The code 0x92 makes a new file. If the file exists change the code to 0x83 (brickfile.open("levels.dat",0x83));.
I'll leave the editing in your hands.
Hope that helps.

Edited by - bosjoh on 2/18/00 1:24:41 PM

This topic is closed to new replies.

Advertisement