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! / Change stage

Author
Message
Pepzi
13
Years of Service
User Offline
Joined: 22nd Feb 2011
Location:
Posted: 21st Sep 2011 09:55
Hi I'm still a newbie so please bear with me
how do I code that when my player sprite reached a certain point or a platform, it will go to next stage?

Should I put the whole codes for that stage in a label,
then when my player reach the portal or a sprite, I'll use gosub?
Or any better way?
If so, any clue how to properly code it?

Thanks!

New to darkbasic
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Sep 2011 11:39
The way I would do it is call an 'initialise' function/subroutine which would prepare everything for the next level e.g hide un-necessary sprites, reposition enemies/player etc. I would then call the 'next level' function/subroutine. The things that I would put into the 'initialise' func/sub would be things that only need to be done once while in the 'next level' func/sub I would put in things that need to be done each loop.

Login to post a reply

Server time is: 2024-11-21 12:00:21
Your offset time is: 2024-11-21 12:00:21