iOS Game Level

Started by
3 comments, last by Landon Patmore 12 years, 1 month ago
I was wondering how to make different levels for my game. I have sketches made out and other things. I use DragonFireSDK which is a C++ iOS game development SDK. Thanks!
Advertisement
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.
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!
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

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


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

and the levels, say
level1.txt
could look like:

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


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)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
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!

This topic is closed to new replies.

Advertisement