<< Previous

Next >>

indy_logo.gif (3362 bytes)

Step 5: improving animation

Indy walks and talks, but that's not enough. At specific moments, the character must perform a special movement.

There are 4 possible "attitudes" for items. The first 3 are used by the system (#0 is standby, #1 is walking, #2 is talking) while the last one (attitude #3) is available for custom animations.
Suppose you want the character to look like he is suddenly pushing something with is hands. The SETANIMATION instructions allows to load item images at any time during the game.


ROOM main
{
	IMAGE { "gr/idol.jpg" }
	WALK { "gr/idol_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 { 170 170 0 }
	}
	ITEM Idol
	{
		IMAGE { 0  0  "gr/idol.gif" }
		POSITION { 155 135 0 }

		COMMAND push idol
		{
			SETANIMATION indy 3 0 "gr/indy_su.gif" 1 // Define image #0 for attitude #3
			SETATTITUDE indy 3			 // Switch to that mode
			SAY indy "hummmmpppfff..."
			WAIT indy
			SETATTITUDE indy 0		// Back to normal animation (standby)
			SAY indy "That doesn't work."
		}
	}
}

Notice how an image that wasn't included in the initial ANIMATION block for this item is defined inside a COMMAND block, and loaded on the fly.
It is also possible to load images for any other attitude with the same instruction.

<< Previous

Next >>

Back to the main page

1