Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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