Frame 1
function Game() {
this.HP = 50;
this.BadHP = 25;
this.Sword = 1;
this.Baddy = "Waiting";
this.SwordShown = true;
this.Victory = false;
}
A = new Game();
Frame 2
stop();
Frame 4
_root.HpDisplay = _root.A.HP;
_root.BaddyDisplay = _root.A.BadHp;
blade._x = _xmouse;
blade._y = _ymouse;
if (_root.A.Victory) {
gotoAndStop (6);
}
if (_root.A.Baddy == "Waiting") {
if (Math.random() < 0.01) {
if (_root.A.Sword == 1) {
_root.A.Baddy = "Attack1";
tellTarget (Bad) {
play();
};
} else {
_root.A.Baddy = "Attack2";
tellTarget (Bad) {
gotoAndPlay (24);
};
}
}
if (Math.random() < 0.03) {
if (_root.A.Sword == 0) {
_root.A.Baddy = "Attack1";
tellTarget (Bad) {
play();
};
} else {
_root.A.Baddy = "Attack2";
tellTarget (Bad) {
gotoAndPlay (24);
};
}
}
}
Instance of Symbol 46 MovieClip "Blade" in Frame 4
onClipEvent (mouseUp) {
play();
}
onClipEvent (mouseMove) {
setProperty(this, _rotation , (((_root._xmouse - 150) / -90) * (_root._ymouse + 100)) / 100);
}
onClipEvent (keyDown) {
if (0 >= _root.a.BadHp) {
tellTarget (_root.bum) {
play();
};
}
}
Instance of Symbol 49 MovieClip "bum" in Frame 4
/* no clip actions */
Frame 5
gotoAndPlay (4);
Frame 6
stop();
Symbol 7 Button
on (release) {
gotoAndPlay (3);
}
Symbol 43 MovieClip Frame 1
stop();
Symbol 43 MovieClip Frame 18
if (_root.A.Sword == 0) {
_root.A.HP = (_root.A.HP - Math.floor(Math.random() * 10)) - 1;
} else {
_root.A.BadHp = (_root.A.BadHp - Math.floor(Math.random() * 10)) - 1;
}
if (0 >= _root.A.BadHp) {
_root.A.Baddy = "Stunned";
gotoAndPlay (50);
}
Symbol 43 MovieClip Frame 23
_root.A.Baddy = "Waiting";
gotoAndStop (1);
Symbol 43 MovieClip Frame 41
if (_root.A.Sword == 1) {
_root.A.HP = (_root.A.HP - Math.floor(Math.random() * 10)) - 1;
} else {
_root.A.BadHp = (_root.A.BadHp - Math.floor(Math.random() * 10)) - 1;
}
if (0 >= _root.A.BadHp) {
_root.A.Baddy = "Stunned";
gotoAndPlay (50);
}
Symbol 43 MovieClip Frame 46
_root.A.Baddy = "Waiting";
gotoAndStop (1);
Symbol 43 MovieClip Frame 70
_root.A.BadHp = (_root.A.BadHp + Math.floor(Math.random() * 5)) + 1;
if (0 >= _root.A.BadHp) {
gotoAndPlay (50);
} else {
_root.A.Baddy = "Waiting";
gotoAndStop (1);
}
Symbol 43 MovieClip Frame 163
_root.A.Victory = true;
Symbol 46 MovieClip Frame 1
stop();
Symbol 46 MovieClip Frame 5
_root.A.Sword = 0;
Symbol 46 MovieClip Frame 7
stop();
Symbol 46 MovieClip Frame 11
_root.A.Sword = 1;
Symbol 46 MovieClip Frame 13
gotoAndPlay (1);
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 2
tellTarget (_root.Bad) {
gotoAndPlay (100);
};
Symbol 49 MovieClip Frame 66
gotoAndPlay (1);