X hits on this document

PDF document

Rochester Institute of Technology - page 37 / 39

98 views

0 shares

0 downloads

0 comments

37 / 39

Selecting a weapon in the Butcher’s shooing game

//if user click the weapon, the selection is identified by its name this[“dart0”].onPress = function(){ setTarget(0); _root.selectedWeapon = “knife”;} this[“dart1”].onPress = function(){ setTarget(1); _root.selectedWeapon = “axe”} this[“dart2”].onPress = function(){ setTarget(2); _root.selectedWeapon = “ax”} this[“dart3”].onPress = function(){ setTarget(3); _root.selectedWeapon = “pin”}

// identify which object should move to the spotlight setTarget = function(i) { m y C l i c k e d O b j e c t = _ r o o t [ d a r t + i ] targetclick=1; move = true; ;

}

Random cow size in the stage, depending on the y-coordinates

//Game manager.as

class GameManager { var cowArray:Array; var pinArray:Array; var cowScale:Number; var score:Number; function GameManager() { cowArray = new Array(); pinArray = new Array(); //trace(“game manager created”); } function initGame(num) { for (var i = 0; i<num; i++) { var nextCow = _root.attachMovie(“cow ,”“cows”+i, _root.getNextHighest-

Depth());

nextCow._x = i*70+50; nextCow._y = Math.random()*200+75; cowScale = nextCow._y/300; nextCow._xscale = nextCow._yscale=cowScale*100; nextCow.swapDepths(nextCow._y); cowArray.push(nextCow);

} } function launchPin() {

var initObj = new Object(); initObj._x = _root._xmouse; initObj._y = Stage.height; var pin = _root.attachMovie(_root.selectedWeapon, “pin”+pinArray.length, _root.getNex- tHighestDepth(), initObj); this.pinArray.push(pin);

37

Storytelling of the Hahoe Mask

Document info
Document views98
Page views98
Page last viewedThu Dec 08 14:32:55 UTC 2016
Pages39
Paragraphs519
Words7675

Comments