Sign in to follow this  
Landon Patmore

iOS Game Level

Recommended Posts

It sounds like you need to investigate different methods of managing game levels for your game, before you ask this question. Identify the type of game you are making. Your levels are likely tile-based, so you need to investigate tile-based level management. Start with 2D arrays, and go from there. This sort of thing shouldn't be SDK-specific, as it is more or less a building-block (no pun intended) of 2D games.

Share this post


Link to post
Share on other sites
Landon Patmore    107
Thanks for the response,

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 like an example.

Thanks again for the response!

Share this post


Link to post
Share on other sites
SimonForsman    7642
http://www.cplusplus.com/reference/iostream/fstream/

Start by using plain textfiles until you get the hang of how to read and write data, then think of a way to organize your level data in one or more files.

Using pure textfiles it could look something like this:

Worlds.txt
[code]
First World: world1.txt
Second World: world2.txt
.....
.....
Name of the Seventh World: world7.txt
[/code]

each world file then contains a list of levels in a similar format

and the levels, say
level1.txt
could look like:
[code]
Background : coolbackground.png
Groundlevel : 20
Cannon : 20,50
WallType1 : 30,30,40,80
WallType1 : 40,30,100,40
WallType2 : 20,10,30,70
[/code]

This format allows for walls and other objects to be placed freely , to use the levels you simply open the file, read the contents, parse it and add the objects to the game.

binary formats are handled in a similar way (Allthough you can't really write your levels in notepad for testing purposes then so i'd recommend starting using a plaintext format until you get the hang of things and have a level editor to create your levels with)

Share this post


Link to post
Share on other sites
Landon Patmore    107
Thanks for the reply,

I am new to C++. Can you explain to me a little bit more about what you posted before. Also, how would I call the different worlds when they are clicked on like you stated here:

First World: world1.txt
Second World: world2.txt
.....
.....
Name of the Seventh World: world7.txt


Also, can you explain this part a little bit more:

Background : coolbackground.png
Groundlevel : 20
Cannon : 20,50
WallType1 : 30,30,40,80
WallType1 : 40,30,100,40
WallType2 : 20,10,30,70

Then how would I call the different levels if they are .txt files.

Also, what do you mean by binary format and also you said something about a level editor so that I could make my levels. Can you explain that more in depth?

Sorry if I am asking for a lot I just want to understand everything.

Thanks!

Share this post


Link to post
Share on other sites

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