Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Level 2

Author
Message
DannyISahero
12
Years of Service
User Offline
Joined: 8th Mar 2010
Location:
Posted: 25th Mar 2010 18:52
whats the code to get the game from level 1 to level 2?
Ashingda 27
14
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 26th Mar 2010 06:15
You just simply load up the same thing, but with the level 2 data.
DannyISahero
12
Years of Service
User Offline
Joined: 8th Mar 2010
Location:
Posted: 29th Mar 2010 19:17
can you be more specific?
flashing snall
17
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 30th Mar 2010 23:45
lets say you have a game where you fly around and shoot all the bad guys until they are all dead, at which you go to the next level. To load the next level, all you do is run the code you ran to start the game, except that you increase the amount of enemies you create. So if you had something like



Then when you want to go to a new level, call the setUpGame function, but increase the badguys parememeter each time.

This is a really over simplified example, because youll also need to load up all sorts of other stuff too depending on what your game is. For example, maybe you need to load a custom map from a txt file, if thats the case, then maybe you could name all your levels to a convention so that you dont have to hardcode them into your source.



And again, thats still really overly simple, becuase chances are, youll need to do some trash clean up, and display messages like "new level!!!" over the screen. But this is a start...

Ashingda 27
14
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 31st Mar 2010 07:04
@DannyISahero
BTW what kind of game is this for anyways, I don't mean to come off rude but you asked a vague question so I responded the same way.
DannyISahero
12
Years of Service
User Offline
Joined: 8th Mar 2010
Location:
Posted: 31st Mar 2010 19:24
im trying to make a game similar to a quiz like setting, after you answer the level 1 questions, you move on to the level 2 questions
TDK
Retired Moderator
20
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Apr 2010 20:50
I don't mean this in a nasty way, but would you understand the answer if we told you? It's actually quite a basic concept using a variable and the question sets in separate text files.

But in reality, telling you would mean us telling you how to write the program and I'm afraid that isn't going to happen. Please read this:

http://forum.thegamecreators.com/?m=forum_view&t=116024&b=10

But, if you want to put in the effort and work out how to do it yourself, here's a brief outline:

You start off the game with the variable Level set to 1. Your program would then load and use the questions in the level 1 text file.

When your score (or question counter) variable reaches the required value to go up a level you simply increment the Level variable and call the routine which loads the questions again - loading the text file containing the level 2 questions and so on.

If this is currently a bit too advanced for you at the moment, check out the tutorials here:

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

All the basic programming techniques you need to do what you describe are covered in the tutorials there.

TDK

Login to post a reply

Server time is: 2023-01-27 01:21:30
Your offset time is: 2023-01-27 01:21:30