Sign in to follow this  

How to make a game level in C++

This topic is 2075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.)

Share this post


Link to post
Share on other sites
[size=3][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: [url="http://www.cplusplus.com/doc/tutorial/files/"]http://www.cplusplus...tutorial/files/[/url]

Next let's look at what the support team told you.[/font][/size]
[left][size=3][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][/size][/left]



[left][size=3][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.[/color][/font][/size][/left]
[left][size=3][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.[/color][/font][/size][/left]

Share this post


Link to post
Share on other sites
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.
[url="http://gleed2d.codeplex.com/"]GLEE2D[/url] might work. Or perhaps not. I am often happy with [url="http://blender.org"]Blender[/url].
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 [url="http://www.gamedev.net/topic/612355-ground-collision-methods/"]this old thread[/url], including visual clues about the process.

Then, the thing will get awry. Very awry.

Share this post


Link to post
Share on other sites

This topic is 2075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this