Translations of this page:

This is an old revision of the document!
—-

9. Finetuning the game

Before we go further, we need to fix a few things we didn't pay attention in the previous chapter and demonstrate a few little concepts along the way. This will be only a little relaxing chapter, so we could gather some energy for the upcoming chapters.

First problem is that our character should walk from the correct spot depending on the previous scene. If you now for example exit through the door in the Room, you appear next to the car. Let's fix it!

Open the scene_init.script in the Street scene and change the beginning to read:

if (Game.PrevScene == "Room") 
{ 
	actor.SkipTo(680, 340); 
	actor.Direction = DI_LEFT; 
 
} 
else 
{ 
	actor.SkipTo(253, 571); 
	actor.Direction = DI_RIGHT; 
} 
 
actor.Active = true;

What we're doing here is referencing Game.PrevScene which contains the name of the room we've just left (previous scene). If it's room, we appear next to the door, otherwise we
appear next to the car. You can of course add as many previous scenes as you like.


 
wmebook/ch9.1197217471.txt.gz · Last modified: 2007/12/09 17:24 by metamorphium
Recent changes RSS feed Creative Commons License Driven by DokuWiki