How to make a game level in C++

Started by
3 comments, last by Krohm 12 years ago
I have an idea for the game I am making. It is game somewhat like Angry Birds. It uses a cannon and you have different cannonballs for different levels. The object of the game is to knock down the increasingly harder structures. Now the DragonFireSDK has support for Box2D. The question I am trying to ask is how am I suppose to make different levels.

For example:

There are 7 worlds, each world has 20 different levels inside of it. I want to know how to make different levels. Also,I got an email from the support team of DragonFireSDK, and they said that:

"Well, You probably want to save your level data in a file or even data structures in your program. When a level is requested, you would load that particular set of data and render your level accordingly."

I don't know how to do the above things they sent to me.

It would really help if you could show me how to do this.

Thanks!

(I'm new to C++, so can you "dumb" it down so it would be understand. Sorry for the inconvinence.)
Advertisement
Do you know how to load and display the contents of, say, a text file?
No sorry, it would help if you could explain it.

Thanks.

[font=arial,helvetica,sans-serif]Generally that's the sort of thing a search engine can help you with.
For example, here's a good explanation I found in a few seconds: http://www.cplusplus...tutorial/files/

Next let's look at what the support team told you.[/font]

[font=arial,helvetica,sans-serif]"Well, You probably want to save your level data in a file or even data structures in your program. When a level is requested, you would load that particular set of data and render your level accordingly."[/font]





[font=arial,helvetica,sans-serif][color=#282828]First, you need to understand what level data is. Level data is kind of like a recipe. It tells you what's inside your level, and where it goes.[/font]


[font=arial,helvetica,sans-serif][color=#282828]If you put it in an external file, you can load it whenever you need it! Translate your "recipe" into a level by reading the file, choosing objects to place or enemies to spawn, and creating them in the game world.[/font]

First you need to find a way to "draw" your levels. Don't even think about coding them by hand. You'll go crazy faster than you might imagine.
GLEE2D might work. Or perhaps not. I am often happy with Blender.
Now, this program will output some data you'll have to read and translate to a language your system understands so it can explain it to Box2D in a language it understands.

You might want to look at this old thread, including visual clues about the process.

Then, the thing will get awry. Very awry.

Previously "Krohm"

This topic is closed to new replies.

Advertisement