• Advertisement
Sign in to follow this  

sterting new scene by event

This topic is 4739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive only been learning directx for about 2 months having trouble starting a new scene ready for drawing by an event such as keybourd input or going through a door and such but I cant seem to get it working.

Share this post


Link to post
Share on other sites
Advertisement
I may be tired, but what do you mean by starting a new scene?
Please give us more details about your problem.. them someone may me able to help.

Peter

Share this post


Link to post
Share on other sites
What im trying to do is when they complete a level I want to delete the old bring in the new, new level, new npc's and new enemies. I want it to be managed code becuase I want to keep the players chacter too. so if you could help me that would be great.

Share this post


Link to post
Share on other sites
you're going to need a scene system.
what i have is a game class, which a pointer to a scene class object.
every scene class object has its own resources, etc.
i derive a new class for every single scene, and implement the Load,
Free, Play, and Reset functions for each scene.
the scene's functions are called from the game's pointer.
for example, game.scene->Play();
now i have instantiated every single scene.
so when i receive a signal to switch, all i have to do is:
game.scene = &menu;
game.scene = &level1;
etc.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement