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! / Changing from one scene/area to the next

Author
Message
Zuko
12
Years of Service
User Offline
Joined: 12th Feb 2010
Location:
Posted: 24th Feb 2010 09:11
Hey guys im currently making a 2d game in the format of a pokemon game while i build up my c++ and dark gdk skills. What im stuck with is how to design the transition where the character moves from the outdoors, into a house. The structure of the game at the moment will be, each individual town and house will have its own .cpp file (feel free to offer more efficient ways as this was the best i could think of), so when the the player enters a house, the outside terrain is unloaded and the house is loaded. Though the part that confuses me is, the transition between the two, I could hide the outside sprites, but the collision checking would still occur and muck it up, do I have to remove all the outside sprites and images, load the house, and then when the user goes back outside reload and position the sprites collision detection etc.

I know this post is probally a bit confusing so just ask if you need any extra information or clarity.

Thanks in advance
TDK
Retired Moderator
20
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Feb 2010 17:36
If I understand you correctly, I think your best option would be to use the Set Gamma command and slowly fade the scene to black, draw the new scene, re-initialize all your sprites/variables and then reverse the gamma fade back to normal - fading the new scene in.

You must have the positions of your 'outside' sprites stored in variables, so use Hide Sprite and don't update their positions while you are inside the house.

When you exit the house, carry on where you left off and use Show Sprite to make them all visible again.

TDK

Zuko
12
Years of Service
User Offline
Joined: 12th Feb 2010
Location:
Posted: 27th Feb 2010 05:25
Thanks that makes alot of sense, I just have to reorganise the way ive coded a few things such as collision code for the "outside", and ill add in the variables that store where the player was last at in the area before he changed to inside a house etc. I'll let you know how it goes.

Login to post a reply

Server time is: 2023-01-27 01:07:02
Your offset time is: 2023-01-27 01:07:02