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.

Newcomers DBPro Corner / unsure of how to setup code for level 2 etc

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 7th Oct 2005 09:56
hi,how would code look basically for going to a next level in a game.

like this?

gosub load level 1:

do

'main game'

'if player meets requirement for level 2'
***this is where im confused.***
***what do i code here?
endif

loop



do i have to have a 2nd do loop for level 2???
Maps
19
Years of Service
User Offline
Joined: 4th Oct 2005
Location: Paris
Posted: 7th Oct 2005 10:18
Personally I'd do something like that:

rem storing current level
Level=0
rem storing a flag to know if ready to
rem change level, 0=no, 1=yes
nextlvl=1

DO
gosub loadWorld
gosub Playermoves
gosub mobs

sync
loop

loadWorld:
if Level=0 and nextlvl=1
blabla seting up level 1
level=1
nextlvl=0
endif

if level=1 and nextlvl=1
destroy level 1
load level 2
level=2
nextlvl=0
endif
...ect...
return
Mr Bigger
19
Years of Service
User Offline
Joined: 31st Jan 2005
Location: was here!
Posted: 7th Oct 2005 13:36
Not really.Just delete unwanted objects from level 1 and reset appropriate variables then load level 2.Could be be done in a subroutine.

AMD 2.2ghz/512mb DDR ram/GeForce Fx5200 128mb/W2K pro/DBPro
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 7th Oct 2005 15:04
ok,thanks

Login to post a reply

Server time is: 2024-11-13 21:24:39
Your offset time is: 2024-11-13 21:24:39