Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: changing the level once my character reaches a certain posiiton [Re: Cactus] #234678
11/04/08 07:07
11/04/08 07:07
Joined: Sep 2004
Posts: 130
Italy
Alessandro Offline
Member
Alessandro  Offline
Member

Joined: Sep 2004
Posts: 130
Italy
Generally speaking, put an initialization code in a separated function, and call it just after every level is loaded. In this way you can quickly restore/setup any object for any loaded level (you can use a "switch" statement to apply changes):

(I didn't test the following code, use it only as a guideline):

Code:
#define LEVEL_1   1
#define LEVEL_2   2
#define LEVEL_3   3

function initGame(int argNewLevel) {
  switch( argNewLevel ) 
  {
    case LEVEL_1:
        // WRITE CODE TO INITIALIZE LEVEL 1;
        break;
    case LEVEL_2:
        // WRITE CODE TO INITIALIZE LEVEL 2;
        break;
    case LEVEL_3:
        // WRITE CODE TO INITIALIZE LEVEL 3;
        break;
  }
}


Re: changing the level once my character reaches a certain posiiton [Re: Alessandro] #234762
11/04/08 16:23
11/04/08 16:23
Joined: Apr 2004
Posts: 77
USA
Cactus Offline OP
Junior Member
Cactus  Offline OP
Junior Member

Joined: Apr 2004
Posts: 77
USA
thanks, and xarthar nvm the code did work I just messed up,thaks alot.


HI
Page 2 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1