indy_logo.gif (3362 bytes)

Step 7: multiple characters

If you ever played Fate Of Atlantis™ or The Dig™, you must have noticed that at some point in the game it was amazingly possible to switch control to another character. This is supported by the engine, too!


ROOM main
{
	BGSOUND { "snd/indysong.mid" }
	IMAGE { "gr/street_2.gif" }
	WALK { "gr/street_2_bm.gif" }

	ITEM Indy       // My hero   :)
	{
		ANIMATION
		{
			// --- standby images ---
			0  0  "gr/indy_d.gif"  1 // Looking South
			0  1  "gr/indy_r.gif"  1 // Looking West
			0  2  "gr/indy_u.gif"  1 // Looking North
			0  3  "gr/indy_l.gif"  1 // Looking East
			// --- walking animation ---
			1  0  "gr/indy_wd.gif" 4 // Looking South
			1  1  "gr/indy_wr.gif" 6 // Looking West
			1  2  "gr/indy_wu.gif" 4 // Looking North
			1  3  "gr/indy_wl.gif" 6 // Looking East
			// --- talking animation ---
			2  0  "gr/indy_td.gif" 7 // Looking South
			2  1  "gr/indy_tr.gif" 4 // Looking West
			2  2  "gr/indy_tu.gif" 1 // Looking North
			2  3  "gr/indy_tl.gif" 4 // Looking East
		}
		POSITION { 140 140 0 }
		COMMAND talk indy
		{
			SAY sophia "I give you control again"
			SETPLAYER indy
		}
	}

	ITEM sophia	// My alternate hero   :)
	{
		IMAGE
		{
			// --- standby images ---
			0  1  "gr/sophia_r.gif"	// Looking West
			0  3  "gr/sophia_l.gif"	// Looking East
			// --- walking animation ---
			1  1  "gr/sophia_r.gif"	// Looking West
			1  3  "gr/sophia_l.gif"	// Looking East
			// --- talking animation ---
			2  1  "gr/sophia_tr.gif"// Looking West
			2  3  "gr/sophia_tl.gif"// Looking East
		}
		INK { 4 }	// Sophia's speech will be green  :)
		POSITION { 250 142 0 }
		COMMAND talk sophia
		{
			SAY indy "Ok, you are the master now."
			SETPLAYER sophia	// Here it is!
		}
	}
}

Neat, uh?  ;-)
You can use the SETPLAYER command at any time. Any item in the game can instantly become the player's character.

Next >>

Back to the main page