var samX = 0;
var samY = 0;

# The main character. If you don't want to be able to perform actions on
# this character, change the name to the empty string ("").
objectType sam ("") {
	speechColour 163, 115, 7;
        speechGap 25;
	event lookAt {
		say (sam, "Who?");
	}
	event talkTo {
		say (sam, "Erm...hello.");
                say (sam, "Got some advice for me?");
                say (sam, "Turn off the computer and go get a life!");
                say (sam, "Thanks.");
	}
	event pickUp {
		say (sam, pickOne ("And how would you like me to do that?", "You are dumb as I look.", "Get a professional wrestler to do that for me."));
	}
	event use {
		say (sam, "Not in a family game!");
	}
}

# This function returns Sam's standard costume - which beats including it in
# every room definition
sub makeEgoAnim () {
	return costume (
		# STANDING STILL...
		anim ('sam/sam.duc', 0),
                anim ('sam/sam.duc', 12),
		anim ('sam/sam.duc', 24),
                anim ('sam/sam.duc', 35),
		# WALKING...
               	anim ('sam/sam.duc', wait (4, 2), wait (5, 2), wait (6, 2), wait (7, 2), wait (8, 2), wait (9, 2), wait (10, 2), wait (11, 2)),
                anim ('sam/sam.duc', wait (16, 2), wait (17, 2), wait (18, 2), wait (19, 2), wait (20, 2), wait (21, 2), wait (22, 2), wait (23, 2)),             
		anim ('sam/sam.duc', wait (27, 2), wait (28, 2), wait (29, 2), wait (30, 2), wait (31, 2), wait (32, 2), wait (33, 2), wait (34, 2)),
                anim ('sam/sam.duc', wait (39, 2), wait (40, 2), wait (41, 2), wait (42, 2), wait (43, 2), wait (44, 2), wait (45, 2), wait (46, 2)),
        	# TALKING...
		anim ('sam/sam.duc', wait (1, 4), wait (0, 4), wait (2, 4), wait (3, 4), wait (1, 4), wait (0, 4), wait (2, 4)),
                anim ('sam/sam.duc', wait (13, 4), wait (12, 4), wait (14, 4), wait (15, 4), wait (13, 4), wait (12, 4), wait (14, 4)),
		anim ('sam/sam.duc', wait (24, 4), wait (25, 4), wait (26, 4)),
                anim ('sam/sam.duc', wait (36, 4), wait (35, 4), wait (37, 4), wait (38, 4), wait (36, 4), wait (35, 4), wait (37, 4)));
}

sub scrollSam () {
     loop {
      samX = getObjectX (sam);
      samY = getObjectY (sam);
      aimCamera (samX, samY);
      pause (1);
     }
}