Frame 1
stop();
Instance of Symbol 5 MovieClip "loading" in Frame 1
onClipEvent (load) {
totalSize = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
bytesLoaded = _root.getBytesLoaded();
amountLoaded = bytesLoaded / totalSize;
percent = int(100 * amountLoaded);
if (amountLoaded >= 1) {
_root.gotoAndStop("title");
}
}
Frame 2
stop();
if (!score) {
score = 0;
}
high_score_clip.score = score;
Instance of Symbol 35 MovieClip [sbeast] "welcome_beast" in Frame 2
onClipEvent (load) {
dead = 0;
if (this._name != "sbeast_clip") {
kKillPoints = 1;
kRight = 2;
kLeft = 1;
kGrav = 1;
direction = 0;
jumping = 0;
dy = 0;
kNumFrames = 3;
frames = new Array();
frames[kRight] = new Array("0", "right1", "right2", "right3");
frames[kLeft] = new Array("0", "left1", "left2", "left3");
frame_counter = 0;
kNumDeathFrames = 7;
death_frames = new Array("0", "d1", "d2", "d3", "d4", "d5", "d6", "d7");
size = int(Math.random() * 40) + 60;
this._xscale = size;
this._yscale = size;
speed = random(5) + 2;
jumpSpeed = random(9) + 5;
this._y = 290;
if (random(2) == 0) {
this._x = -40;
direction = kRight;
} else {
this._x = 740;
direction = kLeft;
}
land_at = this._y;
}
}
onClipEvent (enterFrame) {
var i;
if ((this._name == "sbeast_clip") || (_root.paused)) {
return(0);
}
if (dead == 0) {
if (_root._xmouse < this._x) {
if (((direction != kLeft) && (jumping == 0)) && (int(Math.random() * 4) == 0)) {
direction = kLeft;
}
} else if (((direction != kRight) && (jumping == 0)) && (int(Math.random() * 4) == 0)) {
direction = kRight;
}
if (jumping == 0) {
if (int(Math.random() * 20) == 1) {
jumping = 1;
dy = jumpSpeed;
}
}
if (jumping == 1) {
dy = dy - kGrav;
this._y = this._y - dy;
if (this._y > land_at) {
this._y = land_at;
jumping = 0;
}
}
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
frame_counter++;
if (frame_counter > kNumFrames) {
frame_counter = 1;
}
this.gotoAndStop(frames[direction][frame_counter]);
if ((_root.steve.dead == 0) && (this.hitTest(_root.steve_clip))) {
if ((((_root.steve.moving == _root.kDuckPunching) || (((_root.steve.moving == _root.kPunching) && (this._y <= (_root.steve.y - _root.kPunchMinHeight))) && (this._y >= (_root.steve.y - _root.kPunchMaxHeight)))) || ((_root.steve.moving == _root.kKicking) && (this._y >= (_root.steve.y - _root.kKickHeight)))) && (((_root.steve.x < this._x) && (_root.steve.facing == kRight)) || ((_root.steve.x > this._x) && (_root.steve.facing == kLeft)))) {
if (_root.steve.facing == _root.kRight) {
direction = kRight;
this._rotation = 10;
} else {
direction = kLeft;
this._rotation = -10;
}
dy = int((120 - size) / 3);
speed = int(Math.random() * 5) + 5;
dead = 1;
_root.gotPoints(kKillPoints);
} else {
var dist_x_right = 0;
var dist_x_left = 0;
if (_root.steve.ducked == 0) {
var dist_x_right = 15;
var dist_x_left = 15;
} else if ((_root.steve.moving == _root.kLeft) || (_root.steve.moving == _root.kRight)) {
dist_x_right = 20;
dist_x_left = 20;
} else if (_root.steve.facing == _root.kLeft) {
dist_x_left = 50;
dist_x_right = 30;
} else {
dist_x_left = 30;
dist_x_right = 50;
}
if ((this._x > (_root.steve_clip._x - dist_x_left)) && (this._x < (_root.steve_clip._x + dist_x_right))) {
if (_root.steve.safe == 0) {
_root.killSteve();
}
}
}
} else {
i = _root.kBulletStartLevel;
while (i <= _root.kBulletEndLevel) {
if (_root["bullet" + i]) {
the_bullet = _root["bullet" + i];
if (this.hitTest(the_bullet)) {
the_bullet.dead = 1;
dead = 2;
frame_counter = 0;
_root.gotPoints(kKillPoints * the_bullet.point_multiplier);
}
}
i++;
}
}
} else if (dead == 1) {
dy = dy - kGrav;
this._y = this._y - dy;
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
if (this._y >= land_at) {
this._y = land_at;
dead = 2;
frame_counter = 0;
}
} else if (dead == 2) {
frame_counter++;
if (frame_counter > kNumDeathFrames) {
dead = 0;
_root.enemy_counter--;
if (_root.enemy_timer > _root.enemy_make_timer) {
_root.enemy_timer = 0;
}
this._y = 290;
if (random(2) == 0) {
this._x = -40;
direction = kRight;
} else {
this._x = 740;
direction = kLeft;
}
size = int(Math.random() * 40) + 60;
this._xscale = size;
this._yscale = size;
speed = random(5) + 2;
jumpSpeed = random(9) + 5;
this._rotation = 0;
} else {
this.gotoAndStop(death_frames[frame_counter]);
}
}
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root._xmouse < this._x) {
direction = kRight;
this._rotation = 10;
} else {
direction = kLeft;
this._rotation = -10;
}
dy = int((120 - size) / 3);
speed = int(Math.random() * 5) + 5;
dead = 1;
}
}
Frame 4
function setup() {
score = 0;
kills = 0;
level = 1;
ammo = 0;
lives = 1;
kMaxLives = 5;
kPointsToGetLife = 25;
next_get_life = kPointsToGetLife;
kSafeTime = 60;
kMaxAmmo = 10;
ink_timer = 0;
kSteveLevel = 4;
kBulletStartLevel = 101;
kBulletEndLevel = 110;
kEnemyStartLevel = 5;
kEnemyEndLevel = 100;
kForegroundLevel = 500;
kInkLevel = 499;
kShadowLevel = 3;
kSBeast = 1;
kSWorm = 2;
kDBird = 3;
enemy_level = kEnemyStartLevel;
kEnemyMakeTimer = 90;
enemy_make_timer = kEnemyMakeTimer;
enemy_timer = 0;
enemy_make_timer_levels = new Array(0, 90, 75, 60, 60, 50, 50, 50, 40, 40, 40, 30, 30, 30, 20, 20, 15, 15, 10, 10, 5);
enemy_type_levels = new Array();
enemy_type_levels[kSBeast] = new Array(0, 100, 90, 80, 75, 70, 70, 65, 65, 60);
enemy_type_levels[kSWorm] = new Array(0, 0, 0, 10, 10, 15, 15, 20, 20, 25);
enemy_type_levels[kDBird] = new Array(0, 0, 10, 10, 15, 15, 15, 15, 15, 15);
sbeast_percent = enemy_type_levels[kSBeast][1];
sworm_percent = enemy_type_levels[kSWorm][1];
dbird_percent = enemy_type_levels[kDBird][1];
enemy_counter = 0;
bullet_level = kBulletStartLevel;
kBulletOffsety = 35;
kBulletOffsetx = 25;
kDuckBulletOffsety = 10;
kDuckBulletOffsetx = 40;
kMaxEnemies = 5;
kStopped = 0;
kLeft = 1;
kRight = 2;
kKicking = 3;
kDucking = 4;
kUnducking = 5;
kRunDucking = 6;
kThrowing = 7;
kDuckThrowing = 8;
kPunching = 9;
kDuckPunching = 10;
kKickReloadTime = 10;
kGrav = 2;
kSteveSpeed = 5;
kSteveRollSpeed = 12;
kSteveJumpSpeedx = 7;
kSteveJumpSpeedy = 20;
kFloor = 290;
kLeftSide = 20;
kRightSide = 680;
kForegroundPosx = 475;
kForegroundPosy = 400;
kJumpOffset = 20;
kKickHeight = 20;
kPunchMinHeight = 25;
kPunchMaxHeight = 60;
kRollOffsetx = 15;
kRollOffsety = 15;
kKeyLeft = 74;
kKeyRight = 76;
kKeyJump = 73;
kKeyKick = 32;
kKeyDuck = 75;
kKeyThrow = 186;
kNumRunFrames = 6;
kNumKickFrames = 5;
kNumDuckFrames = 4;
kNumRunDuckFrames = 3;
kNumThrowFrames = 9;
kNumDuckThrowFrames = 5;
kNumPunchFrames = 7;
kNumDuckPunchFrames = 5;
steve = {dead:0, x:random(640) + 30, y:kFloor, dy:0, moving:kStopped, facing:kRight, jumping:0, ducked:0, kick_frame:0, kick_frame_list:new Array(), punch_frame_list:new Array(), duck_punch_frame_list:new Array(), run_frame:0, run_frame_list:new Array(), duck_frame:0, duck_frame_list:new Array(), run_duck_frame_list:new Array(), throw_frame:0, throw_frame_list:new Array(), duck_throw_frame_list:new Array(), kick_timer:0, safe:0, safe_timer:0};
steve.kick_frame_list[kLeft] = new Array("0", "kl1", "kl2", "kl3", "kl2", "kl1");
steve.kick_frame_list[kRight] = new Array("0", "kr1", "kr2", "kr3", "kr2", "kr1");
steve.run_frame_list[kRight] = new Array("0", "rr1", "rr2", "rr3", "rr4", "rr5", "rr6");
steve.run_frame_list[kLeft] = new Array("0", "rl1", "rl2", "rl3", "rl4", "rl5", "rl6");
steve.duck_frame_list[kLeft] = new Array("0", "dl1", "dl2", "dl3", "dl4");
steve.duck_frame_list[kRight] = new Array("0", "dr1", "dr2", "dr3", "dr4");
steve.run_duck_frame_list[kRight] = new Array("0", "rdr1", "rdr2", "rdr3");
steve.run_duck_frame_list[kLeft] = new Array("0", "rdl1", "rdl2", "rdl3");
steve.throw_frame_list[kRight] = new Array("0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", "tr8", "tr9");
steve.throw_frame_list[kLeft] = new Array("0", "tl1", "tl2", "tl3", "tl4", "tl5", "tl6", "tl7", "tl8", "tl9");
steve.duck_throw_frame_list[kRight] = new Array("0", "dtr1", "dtr2", "dtr3", "dtr2", "dtr1");
steve.duck_throw_frame_list[kLeft] = new Array("0", "dtl1", "dtl2", "dtl3", "dtl2", "dtl1");
steve.punch_frame_list[kRight] = new Array("0", "pr1", "pr2", "pr3", "pr4", "pr3", "pr2", "pr1");
steve.punch_frame_list[kLeft] = new Array("0", "pl1", "pl2", "pl3", "pl4", "pl3", "pr2", "pr1");
steve.duck_punch_frame_list[kRight] = new Array("0", "dtr1", "dtr2", "dtr3", "dtr2", "dtr1");
steve.duck_punch_frame_list[kLeft] = new Array("0", "dtl1", "dtl2", "dtl3", "dtl2", "dtl1");
attachMovie("steve_sprite", "steve_clip", kSteveLevel);
steve_clip._xscale = 75;
steve_clip._yscale = 75;
steve_clip._x = steve.x;
steve_clip._y = steve.y;
bottle_clip.stop();
bottle_clip.ink_clip.stop();
setInk();
lives_clip.gotoAndStop("l" + lives);
done = 0;
}
function checkInput() {
if ((steve.moving == kStopped) && (key.isDown(kKeyLeft))) {
steve.moving = kLeft;
steve.facing = kLeft;
if (steve.ducked) {
steve_clip.gotoAndStop("rolling_left");
steve.x = steve.x - kRollOffsetx;
steve.y = steve.y - kRollOffsety;
} else {
steve.run_frame = 1;
}
} else if ((steve.moving == kStopped) && (key.isDown(kKeyRight))) {
steve.moving = kRight;
steve.facing = kRight;
if (steve.ducked) {
steve_clip.gotoAndStop("rolling_right");
steve.x = steve.x + kRollOffsetx;
steve.y = steve.y - kRollOffsety;
} else {
steve.run_frame = 1;
}
} else if ((steve.moving == kLeft) && (!key.isDown(kKeyLeft))) {
steve.moving = kStopped;
if (steve.jumping == 0) {
if (steve.ducked == 1) {
steve_clip._rotation = 0;
steve.x = steve.x + kRollOffsetx;
steve.y = steve.y + kRollOffsety;
steve_clip.gotoAndStop("dl4");
} else {
steve_clip.gotoAndStop("standing_left");
}
}
} else if ((steve.moving == kRight) && (!key.isDown(kKeyRight))) {
steve.moving = kStopped;
if (steve.jumping == 0) {
if (steve.ducked == 1) {
steve_clip._rotation = 0;
steve.x = steve.x - kRollOffsetx;
steve.y = steve.y + kRollOffsety;
steve_clip.gotoAndStop("dr4");
} else {
steve_clip.gotoAndStop("standing_right");
}
}
} else if ((((steve.moving == kStopped) || (steve.moving == kRight)) || (steve.moving == kLeft)) && (steve.jumping == 0)) {
if (key.isDown(kKeyKick) && (steve.ducked == 0)) {
if (steve.kick_timer >= kKickReloadTime) {
steve.moving = kKicking;
steve.kick_frame = 0;
steve.kick_timer = 0;
}
} else if (key.isDown(kKeyJump) && (steve.ducked == 0)) {
steve.jumping = 1;
steve.y = steve.y - kJumpOffset;
steve.dy = kSteveJumpSpeedy;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("jumping_right");
} else if (steve.facing == kLeft) {
steve_clip.gotoAndStop("jumping_left");
}
} else if (key.isDown(kKeyThrow) && (steve.ducked == 0)) {
if (steve.kick_timer >= kKickReloadTime) {
if (ammo > 0) {
steve.moving = kThrowing;
steve.throw_frame = 0;
} else {
steve.moving = kPunching;
steve.kick_frame = 0;
}
steve.kick_timer = 0;
}
} else if ((key.isDown(kKeyThrow) && (steve.ducked == 1)) && (steve.moving == kStopped)) {
if (steve.kick_timer >= kKickReloadTime) {
if (ammo > 0) {
steve.moving = kDuckThrowing;
steve.throw_frame = 0;
} else {
steve.moving = kDuckPunching;
steve.kick_frame = 0;
}
steve.kick_timer = 0;
}
} else if ((key.isDown(kKeyDuck) && (steve.ducked == 0)) && (steve.moving == kStopped)) {
steve.moving = kDucking;
steve.duck_frame = 0;
steve.ducked = 1;
} else if ((steve.ducked == 1) && (!key.isDown(kKeyDuck))) {
if (steve.moving == kLeft) {
steve_clip._rotation = 0;
steve.x = steve.x + kRollOffsetx;
steve.y = steve.y + kRollOffsety;
} else if (steve.moving == kRight) {
steve_clip._rotation = 0;
steve.x = steve.x - kRollOffsetx;
steve.y = steve.y + kRollOffsety;
}
steve.moving = kUnducking;
steve.duck_frame = kNumDuckFrames;
steve.ducked = 0;
} else if ((key.isDown(kKeyDuck) && (steve.ducked == 0)) && ((steve.moving == kRight) || (steve.moving == kLeft))) {
steve.moving = kRunDucking;
steve.duck_frame = 0;
steve.ducked = 1;
}
} else if (steve.moving == kUnducking) {
if (key.isDown(kKeyJump) && (steve.ducked == 0)) {
steve.jumping = 1;
steve.y = steve.y - kJumpOffset;
steve.dy = kSteveJumpSpeedy;
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("jumping_right");
} else if (steve.facing == kLeft) {
steve_clip.gotoAndStop("jumping_left");
}
}
}
}
function moveSteve() {
var i;
if (steve.safe == 1) {
steve.safe_timer--;
if (steve.safe_timer <= 0) {
steve.safe = 0;
steve_clip._visible = true;
} else {
steve_clip._visible = !steve_clip._visible;
}
}
steve.kick_timer++;
if (steve.moving == kRight) {
if (steve.jumping == 1) {
steve.x = steve.x + kSteveJumpSpeedx;
} else if (steve.ducked == 1) {
steve_clip._rotation = steve_clip._rotation + 50;
steve.x = steve.x + kSteveRollSpeed;
} else {
steve.x = steve.x + kSteveSpeed;
steve_clip.gotoAndStop(steve.run_frame_list[steve.moving][steve.run_frame]);
steve.run_frame++;
if (steve.run_frame > kNumRunFrames) {
steve.run_frame = 1;
}
}
if (steve.x > kRightSide) {
steve.x = kRightSide;
}
} else if (steve.moving == kLeft) {
if (steve.jumping == 1) {
steve.x = steve.x - kSteveJumpSpeedx;
} else if (steve.ducked == 1) {
steve_clip._rotation = steve_clip._rotation - 50;
steve.x = steve.x - kSteveRollSpeed;
} else {
steve.x = steve.x - kSteveSpeed;
steve_clip.gotoAndStop(steve.run_frame_list[steve.moving][steve.run_frame]);
steve.run_frame++;
if (steve.run_frame > kNumRunFrames) {
steve.run_frame = 1;
}
}
if (steve.x < kLeftSide) {
steve.x = kLeftSide;
}
} else if (steve.moving == kKicking) {
steve.kick_frame++;
if (steve.kick_frame > kNumKickFrames) {
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("standing_right");
} else {
steve_clip.gotoAndStop("standing_left");
}
} else {
steve_clip.gotoAndStop(steve.kick_frame_list[steve.facing][steve.kick_frame]);
}
} else if (steve.moving == kPunching) {
steve.kick_frame++;
if (steve.kick_frame > kNumPunchFrames) {
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("standing_right");
} else {
steve_clip.gotoAndStop("standing_left");
}
} else {
steve_clip.gotoAndStop(steve.punch_frame_list[steve.facing][steve.kick_frame]);
}
} else if (steve.moving == kDuckPunching) {
steve.kick_frame++;
if (steve.kick_frame > kNumDuckPunchFrames) {
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("dr4");
} else {
steve_clip.gotoAndStop("dl4");
}
} else {
steve_clip.gotoAndStop(steve.duck_punch_frame_list[steve.facing][steve.kick_frame]);
}
} else if (steve.moving == kDucking) {
steve.duck_frame++;
if (steve.duck_frame > kNumDuckFrames) {
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("dr4");
} else {
steve_clip.gotoAndStop("dl4");
}
} else {
steve_clip.gotoAndStop(steve.duck_frame_list[steve.facing][steve.duck_frame]);
}
} else if (steve.moving == kUnducking) {
steve.duck_frame--;
if (steve.duck_frame < 1) {
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("standing_right");
} else {
steve_clip.gotoAndStop("standing_left");
}
} else {
steve_clip.gotoAndStop(steve.duck_frame_list[steve.facing][steve.duck_frame]);
}
} else if (steve.moving == kRunDucking) {
steve.duck_frame++;
if (steve.duck_frame > kNumRunDuckFrames) {
if (steve.facing == kRight) {
steve_clip.gotoAndStop("rolling_right");
steve.moving = kRight;
steve.x = steve.x + kRollOffsetx;
steve.y = steve.y - kRollOffsety;
} else {
steve_clip.gotoAndStop("rolling_left");
steve.moving = kLeft;
steve.x = steve.x - kRollOffsetx;
steve.y = steve.y - kRollOffsety;
}
} else {
steve_clip.gotoAndStop(steve.run_duck_frame_list[steve.facing][steve.duck_frame]);
}
} else if (steve.moving == kThrowing) {
steve.throw_frame++;
if (steve.throw_frame > kNumThrowFrames) {
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("standing_right");
} else {
steve_clip.gotoAndStop("standing_left");
}
} else {
steve_clip.gotoAndStop(steve.throw_frame_list[steve.facing][steve.throw_frame]);
if (steve.throw_frame == 8) {
makeBullet();
}
}
} else if (steve.moving == kDuckThrowing) {
steve.throw_frame++;
if (steve.throw_frame > kNumDuckThrowFrames) {
steve.moving = kStopped;
if (steve.facing == kRight) {
steve_clip.gotoAndStop("dr4");
} else {
steve_clip.gotoAndStop("dl4");
}
} else {
steve_clip.gotoAndStop(steve.duck_throw_frame_list[steve.facing][steve.throw_frame]);
if (steve.throw_frame == 3) {
makeBullet();
}
}
}
if (steve.jumping == 1) {
if (steve.facing == kRight) {
steve_clip._rotation = steve_clip._rotation + 60;
} else if (steve.facing == kLeft) {
steve_clip._rotation = steve_clip._rotation - 60;
}
steve.y = steve.y - steve.dy;
steve.dy = steve.dy - kGrav;
if ((steve.y + kJumpOffset) >= kFloor) {
steve.y = kFloor;
steve_clip._rotation = 0;
if (steve.facing == kRight) {
if (steve.moving == kRight) {
steve_clip.gotoAndStop("standing_right");
} else {
steve_clip.gotoAndStop("standing_right");
}
} else if (steve.facing == kLeft) {
if (steve.moving == kLeft) {
steve_clip.gotoAndStop("standing_left");
} else {
steve_clip.gotoAndStop("standing_left");
}
}
if (steve.dead == 2) {
killSteve();
}
steve.jumping = 0;
}
}
steve_clip._x = steve.x;
steve_clip._y = steve.y;
}
function killSteve() {
if (lives > 0) {
lives--;
lives_clip.gotoAndStop("l" + lives);
steve.safe_timer = kSafeTime;
steve.safe = 1;
} else {
getHighScores();
if (steve.jumping == 1) {
if (steve.dead == 0) {
steve.dead = 2;
if (steve.facing == kLeft) {
steve_clip.gotoAndStop("jumping_death_left");
} else {
steve_clip.gotoAndStop("jumping_death_right");
}
} else if (steve.dead == 2) {
if (steve.facing == kLeft) {
steve_clip.gotoAndPlay("splat_left");
} else {
steve_clip.gotoAndPlay("splat_right");
}
steve_clip.y = kFloor;
steve.dead = 1;
done = 1;
}
} else if (steve.ducked == 1) {
if ((steve.moving == kLeft) || (steve.moving == kRight)) {
steve_clip._rotation = 0;
steve_clip._y = steve_clip._y + kRollOffsety;
} else if (steve.facing == kLeft) {
steve_clip._x = steve_clip._x - kRollOffsetx;
} else {
steve_clip._x = steve_clip._x + kRollOffsetx;
}
if (steve.facing == kLeft) {
steve_clip.gotoAndPlay("splat_left");
} else {
steve_clip.gotoAndPlay("splat_right");
}
steve_clip.y = kFloor;
steve.dead = 1;
done = 1;
} else {
if (steve.facing == kLeft) {
steve_clip.gotoAndPlay("death_left");
} else {
steve_clip.gotoAndPlay("death_right");
}
steve_clip.y = kFloor;
steve.dead = 1;
done = 1;
}
}
}
function makeBullet() {
if (ammo > 0) {
bullet_clip.duplicateMovieClip("bullet" + bullet_level, bullet_level);
bullet_level++;
if (bullet_level > kBulletEndLevel) {
bullet_level = kBulletStartLevel;
}
ammo--;
setInk();
}
}
function makeEnemyCheck() {
if ((enemy_counter < kMaxEnemies) && (enemy_timer >= enemy_make_timer)) {
makeEnemy();
enemy_timer = 0;
}
enemy_timer++;
}
function makeEnemy() {
var _local1 = random(100) + 1;
if (_local1 <= sbeast_percent) {
sbeast_clip.duplicateMovieClip("enemy" + enemy_level, enemy_level);
} else {
_local1 = _local1 - sbeast_percent;
if (_local1 <= sworm_percent) {
sworm_clip.duplicateMovieClip("enemy" + enemy_level, enemy_level);
} else {
_local1 = _local1 - sworm_percent;
if (_local1 <= dbird_percent) {
dbird_clip.duplicateMovieClip("enemy" + enemy_level, enemy_level);
}
}
}
enemy_level++;
if (enemy_level > kEnemyEndLevel) {
enemy_level = kEnemyStartLevel;
}
enemy_counter++;
}
function makeInkCheck() {
if (ink_timer >= 30) {
if (random(10) == 0) {
if (!_root.ink_clip) {
makeInk();
}
}
ink_timer = 0;
}
ink_timer++;
}
function makeInk() {
ink_parent.duplicateMovieClip("ink_clip", kInkLevel);
}
function gotInk(new_ink) {
ammo = ammo + new_ink;
if (ammo > kMaxAmmo) {
ammo = kMaxAmmo;
}
setInk();
}
function end() {
i = enemy_level - 1;
while (i >= 5) {
removeMovieClip("enemy" + i);
i--;
}
removeMovieClip("ink_clip");
removeMovieClip("shadow_clip");
removeMovieClip("steve_clip");
if (((score_getter.score4_text.length > 0) && (score > 0)) && (score > score_getter.score4_text)) {
got_high_score = 1;
name_ask_clip._visible = true;
} else {
got_high_score = 0;
this.gotoAndStop("title");
}
}
function gotPoints(new_points) {
score = score + new_points;
kills++;
extraLifeCheck();
levelCheck();
}
function extraLifeCheck() {
if (score >= next_get_life) {
if (lives < kMaxLives) {
lives++;
lives_clip.gotoAndStop("l" + lives);
}
next_get_life = next_get_life + kPointsToGetLife;
}
}
function setInk() {
var _local1 = (ammo / kMaxAmmo) * 100;
bottle_clip.ink_clip._yscale = _local1;
}
function levelCheck() {
level = Math.ceil(kills / 4.9);
if (level < enemy_make_timer_levels.length) {
enemy_make_timer = enemy_make_timer_levels[level];
}
if (level < enemy_type_levels[kSBeast].length) {
sbeast_percent = enemy_type_levels[kSBeast][level];
sworm_percent = enemy_type_levels[kSWorm][level];
dbird_percent = enemy_type_levels[kDBird][level];
}
}
function getHighScores() {
}
function getName() {
name = name_ask_clip.name;
name_ask_clip._visible = false;
if (name.length < 1) {
name = "Anonymous";
}
this.gotoAndStop("title");
}
Instance of Symbol 153 MovieClip "actions" in Frame 4
onClipEvent (load) {
_root.name_ask_clip._visible = false;
_root.paused_clip._visible = false;
_root.score_getter._visible = false;
_root.sbeast_clip._visible = false;
_root.sworm_clip._visible = false;
_root.dbird_clip._visible = false;
_root.ink_parent._visible = false;
_root.shadow_parent._visible = false;
_root.bulet_clip._visible = false;
this._visible = false;
_root.sbeast_clip.stop();
_root.setup();
endTimer = 0;
kPauseWaitTime = 15;
pause_wait_timer = kPauseWaitTime;
_root.paused = false;
}
onClipEvent (enterFrame) {
if ((key.isDown(80) && (pause_wait_timer > kPauseWaitTime)) && (_root.done == 0)) {
_root.paused = !_root.paused;
_root.paused_clip._visible = !_root.paused_clip._visible;
pause_wait_timer = 0;
}
pause_wait_timer++;
if (_root.done == 0) {
if (!_root.paused) {
if (_root.steve.dead == 0) {
_root.checkInput();
}
if (_root.steve.dead != 1) {
_root.moveSteve();
}
_root.makeEnemyCheck();
_root.makeInkCheck();
}
} else if (endTimer >= 60) {
_root.end();
} else {
endTimer++;
}
}
Instance of Symbol 35 MovieClip [sbeast] "sbeast_clip" in Frame 4
onClipEvent (load) {
dead = 0;
if (this._name != "sbeast_clip") {
kKillPoints = 1;
kRight = 2;
kLeft = 1;
kGrav = 1;
direction = 0;
jumping = 0;
dy = 0;
kNumFrames = 3;
frames = new Array();
frames[kRight] = new Array("0", "right1", "right2", "right3");
frames[kLeft] = new Array("0", "left1", "left2", "left3");
frame_counter = 0;
kNumDeathFrames = 7;
death_frames = new Array("0", "d1", "d2", "d3", "d4", "d5", "d6", "d7");
size = int(Math.random() * 40) + 60;
this._xscale = size;
this._yscale = size;
speed = int(Math.random() * 4) + 1;
jumpSpeed = random(9) + 3;
this._y = _root.kFloor;
if (random(2) == 0) {
this._x = _root.kLeftSide - 30;
direction = kRight;
} else {
this._x = _root.kRightSide + 30;
direction = kLeft;
}
land_at = this._y;
}
}
onClipEvent (enterFrame) {
var i;
if ((this._name == "sbeast_clip") || (_root.paused)) {
return(0);
}
if (dead == 0) {
if (_root.steve_clip._x < this._x) {
if (((direction != kLeft) && (jumping == 0)) && (int(Math.random() * 4) == 0)) {
direction = kLeft;
}
} else if (((direction != kRight) && (jumping == 0)) && (int(Math.random() * 4) == 0)) {
direction = kRight;
}
if (jumping == 0) {
if (int(Math.random() * 20) == 1) {
jumping = 1;
dy = jumpSpeed;
}
}
if (jumping == 1) {
dy = dy - kGrav;
this._y = this._y - dy;
if (this._y > land_at) {
this._y = land_at;
jumping = 0;
}
}
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
frame_counter++;
if (frame_counter > kNumFrames) {
frame_counter = 1;
}
this.gotoAndStop(frames[direction][frame_counter]);
if ((_root.steve.dead == 0) && (this.hitTest(_root.steve_clip))) {
if ((((_root.steve.moving == _root.kDuckPunching) || (((_root.steve.moving == _root.kPunching) && (this._y <= (_root.steve.y - _root.kPunchMinHeight))) && (this._y >= (_root.steve.y - _root.kPunchMaxHeight)))) || ((_root.steve.moving == _root.kKicking) && (this._y >= (_root.steve.y - _root.kKickHeight)))) && (((_root.steve.x < this._x) && (_root.steve.facing == kRight)) || ((_root.steve.x > this._x) && (_root.steve.facing == kLeft)))) {
if (_root.steve.facing == _root.kRight) {
direction = kRight;
this._rotation = 10;
} else {
direction = kLeft;
this._rotation = -10;
}
dy = int((120 - size) / 3);
speed = int(Math.random() * 5) + 5;
dead = 1;
_root.gotPoints(kKillPoints);
} else {
var dist_x_right = 0;
var dist_x_left = 0;
if (_root.steve.ducked == 0) {
var dist_x_right = 15;
var dist_x_left = 15;
} else if ((_root.steve.moving == _root.kLeft) || (_root.steve.moving == _root.kRight)) {
dist_x_right = 20;
dist_x_left = 20;
} else if (_root.steve.facing == _root.kLeft) {
dist_x_left = 50;
dist_x_right = 30;
} else {
dist_x_left = 30;
dist_x_right = 50;
}
if ((this._x > (_root.steve_clip._x - dist_x_left)) && (this._x < (_root.steve_clip._x + dist_x_right))) {
if (_root.steve.safe == 0) {
_root.killSteve();
}
}
}
} else {
i = _root.kBulletStartLevel;
while (i <= _root.kBulletEndLevel) {
if (_root["bullet" + i]) {
the_bullet = _root["bullet" + i];
if (this.hitTest(the_bullet)) {
the_bullet.dead = 1;
dead = 2;
frame_counter = 0;
_root.gotPoints(kKillPoints * the_bullet.point_multiplier);
}
}
i++;
}
}
} else if (dead == 1) {
dy = dy - kGrav;
this._y = this._y - dy;
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
if (this._y >= land_at) {
this._y = land_at;
dead = 2;
frame_counter = 0;
}
} else if (dead == 2) {
frame_counter++;
if (frame_counter > kNumDeathFrames) {
dead = 3;
_root.enemy_counter--;
if (_root.enemy_timer > _root.enemy_make_timer) {
_root.enemy_timer = 0;
}
this.removeMovieClip();
} else {
this.gotoAndStop(death_frames[frame_counter]);
}
}
}
Instance of Symbol 165 MovieClip [bullet] "bullet_clip" in Frame 4
onClipEvent (load) {
dead = 0;
if (this._name != "bullet_clip") {
kRight = 2;
kLeft = 1;
kGrav = 1;
direction = 0;
speed = 0;
dy = 0;
offsetx = 0;
offsety = 0;
frames = new Array();
frames[kLeft] = new Array("0", "q1", "q2", "q1", "q3");
frames[kRight] = new Array("0", "q1", "q2", "q1", "q3");
frame_counter = 0;
kNumFrames = 4;
kNumDeathFrames = 4;
death_frames = new Array("0", "d1", "d2", "d3", "d4");
if (_root.steve.ducked == 1) {
speed = 6;
dy = 12;
offsety = _root.kDuckBulletOffsety;
offsetx = _root.kDuckBulletOffsetx;
point_multiplier = 2;
} else {
speed = 15;
dy = 8;
offsety = _root.kBulletOffsety;
offsetx = _root.kBulletOffsetx;
point_multiplier = 2;
}
this._y = _root.steve.y - offsety;
if (_root.steve.facing == _root.kRight) {
direction = kRight;
this._x = _root.steve.x + offsetx;
} else {
direction = kLeft;
this._x = _root.steve.x - offsetx;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused) {
return(0);
}
if ((dead == 0) && (this._name != "bullet_clip")) {
dy = dy - kGrav;
this._y = this._y - dy;
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
frame_counter++;
if (frame_counter > kNumFrames) {
frame_counter = 1;
}
this.gotoAndStop(frames[direction][frame_counter]);
if (this._y >= _root.kFloor) {
dead = 1;
frame_counter = 0;
}
} else if (dead == 1) {
frame_counter++;
if (frame_counter > kNumDeathFrames) {
dead = 2;
this.removeMovieClip();
} else {
this.gotoAndStop(death_frames[frame_counter]);
}
}
}
Instance of Symbol 176 MovieClip [ink_ammo] "ink_parent" in Frame 4
onClipEvent (load) {
if (this._name == "ink_parent") {
return(0);
}
this.gotoAndStop("normal");
this._visible = false;
this._x = random(640) + 30;
this._y = -30;
dead = 0;
timer = 0;
kAmmoAmount = 2;
kNumBreakFrames = 5;
break_frame_list = new Array("0", "b1", "b2", "b3", "b4", "b5");
frame = 0;
_root.attachMovie("shadow", "shadow_clip", _root.kShadowLevel);
_root.shadow_clip._y = _root.kFloor;
_root.shadow_clip._x = this._x;
_root.shadow_clip._xscale = 10;
_root.shadow_clip._yscale = 10;
}
onClipEvent (enterFrame) {
if ((this._name == "ink_parent") || (_root.paused)) {
return(0);
}
if (dead == 0) {
if (_root.shadow_clip._xscale < 90) {
_root.shadow_clip._xscale = _root.shadow_clip._xscale + 1;
_root.shadow_clip._yscale = _root.shadow_clip._yscale + 1;
} else {
if (this._visible == false) {
this._visible = true;
}
if (_root.shadow_clip._xscale < 100) {
_root.shadow_clip._xscale = _root.shadow_clip._xscale + 1;
_root.shadow_clip._yscale = _root.shadow_clip._yscale + 1;
}
this._y = this._y + 11;
if ((_root.steve.dead == 0) && (this.hitTest(_root.steve_clip))) {
_root.shadow_clip.removeMovieClip();
_root.gotInk(kAmmoAmount);
this.removeMovieClip();
}
if (this._y > _root.kFloor) {
dead = 1;
frame = 0;
this._y = _root.kFloor;
_root.shadow_clip.removeMovieClip();
}
}
} else if (dead == 1) {
frame++;
if (frame > kNumBreakFrames) {
this.removeMovieClip();
} else {
this.gotoAndStop(break_frame_list[frame]);
}
}
}
Instance of Symbol 189 MovieClip [sworm_sprite] "sworm_clip" in Frame 4
onClipEvent (load) {
dead = 0;
if (this._name == "sworm_clip") {
return(0);
}
kKillPoints = 2;
kRight = 2;
kLeft = 1;
kGrav = 1;
direction = 0;
jumping = 0;
dy = 0;
kNumFrames = 4;
frames = new Array();
frames[kRight] = new Array("0", "m1", "m2", "m3", "m4", "m5");
frames[kLeft] = new Array("0", "m1", "m2", "m3", "m4", "m5");
frame_counter = 0;
kNumDeathFrames = 5;
death_frames = new Array("0", "d1", "d2", "d3", "d4", "d5", "d6");
size = random(51) + 50;
this._xscale = size;
this._yscale = size;
speed = random(5) + 8;
this._y = _root.kFloor;
if (random(2) == 0) {
this._x = _root.kLeftSide - 40;
direction = kRight;
} else {
this._x = _root.kRightSide + 40;
direction = kLeft;
}
}
onClipEvent (enterFrame) {
var i;
if ((this._name == "sworm_clip") || (_root.paused)) {
return(0);
}
if (dead == 0) {
if (jumping == 1) {
dy = dy - kGrav;
this._y = this._y - dy;
if (this._y > land_at) {
this._y = land_at;
jumping = 0;
}
}
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
if ((direction == kLeft) && (this._x < -40)) {
_root.enemy_counter--;
this.removeMovieClip();
} else if ((direction == kRight) && (this._x > 740)) {
_root.enemy_counter--;
this.removeMovieClip();
}
frame_counter++;
if (frame_counter > kNumFrames) {
frame_counter = 1;
}
this.gotoAndStop(frames[direction][frame_counter]);
if ((_root.steve.dead == 0) && (this.hitTest(_root.steve_clip))) {
if ((((_root.steve.moving == _root.kDuckPunching) || (((_root.steve.moving == _root.kPunching) && (this._y <= (_root.steve.y - _root.kPunchMinHeight))) && (this._y >= (_root.steve.y - _root.kPunchMaxHeight)))) || ((_root.steve.moving == _root.kKicking) && (this._y >= (_root.steve.y - _root.kKickHeight)))) && (((_root.steve.x < this._x) && (_root.steve.facing == kRight)) || ((_root.steve.x > this._x) && (_root.steve.facing == kLeft)))) {
if (_root.steve.facing == _root.kRight) {
direction = kRight;
} else {
direction = kLeft;
}
dead = 1;
frame_counter = 0;
_root.gotPoints(kKillPoints);
} else if (_root.steve.safe == 0) {
_root.killSteve();
}
} else {
i = _root.kBulletStartLevel;
while (i <= _root.kBulletEndLevel) {
if (_root["bullet" + i]) {
the_bullet = _root["bullet" + i];
if (this.hitTest(the_bullet)) {
the_bullet.dead = 1;
if (the_bullet.direction == the_bullet.kRight) {
direction = kRight;
} else {
direction = kLeft;
}
dead = 1;
frame_counter = 0;
_root.gotPoints(kKillPoints * the_bullet.point_multiplier);
}
}
i++;
}
}
} else if (dead == 1) {
frame_counter++;
if (frame_counter > kNumDeathFrames) {
dead = 2;
_root.enemy_counter--;
if (_root.enemy_timer > _root.enemy_make_timer) {
_root.enemy_timer = 0;
}
this.removeMovieClip();
} else {
this.gotoAndStop(death_frames[frame_counter]);
if (direction == kRight) {
this._x = this._x + 6;
} else {
this._x = this._x - 6;
}
}
}
}
Instance of Symbol 220 MovieClip [dbird_sprite] "dbird_clip" in Frame 4
onClipEvent (load) {
dead = 0;
if (this._name != "dbird_clip") {
kKillPoints = 2;
kRight = 2;
kLeft = 1;
kGrav = 1;
direction = 0;
diving = 1;
dy = 10;
kNumFrames = 13;
frames = new Array();
frames[kRight] = new Array("0", "mr1", "mr2", "mr3", "mr4", "mr5", "mr6", "mr7", "mr6", "mr5", "mr4", "mr3", "mr2", "mr1");
frames[kLeft] = new Array("0", "ml1", "ml2", "ml3", "ml4", "ml5", "ml6", "ml7", "ml6", "ml5", "ml4", "ml3", "ml2", "ml1");
frame_counter = 0;
kNumDeathFrames = 7;
death_frames = new Array();
death_frames[kRight] = new Array("0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7");
death_frames[kLeft] = new Array("0", "dl1", "dl2", "dl3", "dl4", "dl5", "dl6", "dl7");
size = int(Math.random() * 40) + 60;
this._xscale = size;
this._yscale = size;
speed = random(4) + 3;
diveSpeed = random(6) + 5;
this._y = random(51) + 180;
if (random(2) == 0) {
this._x = _root.kLeftSide - 50;
direction = kRight;
} else {
this._x = _root.kRightSide + 50;
direction = kLeft;
}
switch_at = this._y;
}
}
onClipEvent (enterFrame) {
var i;
if ((this._name == "dbird_clip") || (_root.paused)) {
return(0);
}
if (dead == 0) {
if (diving == 0) {
if (int(Math.random() * 20) == 1) {
diving = 1;
dy = diveSpeed;
}
}
if (diving == 1) {
if (this._y < switch_at) {
dy = dy - kGrav;
this._y = this._y - dy;
} else {
dy = dy + kGrav;
this._y = this._y - dy;
}
}
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
if ((direction == kLeft) && (this._x < -50)) {
_root.enemy_counter--;
this.removeMovieClip();
} else if ((direction == kRight) && (this._x > 750)) {
_root.enemy_counter--;
this.removeMovieClip();
}
frame_counter++;
if (frame_counter > kNumFrames) {
frame_counter = 1;
}
this.gotoAndStop(frames[direction][frame_counter]);
if ((_root.steve.dead == 0) && (this.hitTest(_root.steve_clip))) {
if ((((_root.steve.moving == _root.kDuckPunching) || (((_root.steve.moving == _root.kPunching) && (this._y <= (_root.steve.y - _root.kPunchMinHeight))) && (this._y >= (_root.steve.y - _root.kPunchMaxHeight)))) || ((_root.steve.moving == _root.kKicking) && (this._y >= (_root.steve.y - _root.kKickHeight)))) && (((_root.steve.x < this._x) && (_root.steve.facing == kRight)) || ((_root.steve.x > this._x) && (_root.steve.facing == kLeft)))) {
this.gotoAndStop(frames[direction][1]);
if (_root.steve.facing == _root.kRight) {
direction = kRight;
this._rotation = 5;
} else {
direction = kLeft;
this._rotation = -5;
}
dy = 2;
speed = random(4) + 5;
dead = 1;
_root.gotPoints(kKillPoints);
} else if ((this._x > (_root.steve_clip._x - 30)) && (this._x < (_root.steve_clip._x + 30))) {
if (_root.steve.safe == 0) {
_root.killSteve();
}
}
} else {
i = _root.kBulletStartLevel;
while (i <= _root.kBulletEndLevel) {
if (_root["bullet" + i]) {
the_bullet = _root["bullet" + i];
if (this.hitTest(the_bullet)) {
the_bullet.dead = 1;
dead = 2;
frame_counter = 0;
_root.gotPoints(kKillPoints * the_bullet.point_multiplier);
}
}
i++;
}
}
} else if (dead == 1) {
dy = dy - kGrav;
this._y = this._y - dy;
if (direction == kLeft) {
this._x = this._x - speed;
} else if (direction == kRight) {
this._x = this._x + speed;
}
if (this._y >= _root.kFloor) {
this._y = _root.kFloor;
dead = 2;
frame_counter = 0;
this._rotation = 0;
if (direction == kLeft) {
direction = kRight;
} else {
direction = kLeft;
}
}
} else if (dead == 2) {
frame_counter++;
if (frame_counter > kNumDeathFrames) {
dead = 3;
_root.enemy_counter--;
if (_root.enemy_timer > _root.enemy_make_timer) {
_root.enemy_timer = 0;
}
this.removeMovieClip();
} else {
this.gotoAndStop(death_frames[direction][frame_counter]);
}
}
}
Instance of Symbol 239 MovieClip [paused] "paused_clip" in Frame 4
/* no clip actions */
Symbol 16 Button
on (release) {
_root.gotoAndStop("playing");
}
on (keyPress "<Space>") {
_root.gotoAndStop("playing");
}
Symbol 21 Button
on (release) {
_root.gotoAndStop("help");
}
Symbol 39 Button
on (release) {
getURL ("http://www.iguanagames.com");
}
Symbol 44 Button
on (release) {
_root.gotoAndStop("title");
}
Symbol 135 MovieClip [steve_sprite] Frame 1
stop();
Symbol 135 MovieClip [steve_sprite] Frame 90
stop();
Symbol 135 MovieClip [steve_sprite] Frame 95
stop();
Symbol 135 MovieClip [steve_sprite] Frame 120
stop();
Symbol 135 MovieClip [steve_sprite] Frame 133
stop();
Instance of Symbol 149 MovieClip [score] in Symbol 150 MovieClip [background] Frame 1
onClipEvent (load) {
old_score = 0;
ones_clip.gotoAndStop("n0");
tens_clip.gotoAndStop("n0");
hundreds_clip.gotoAndStop("n0");
}
onClipEvent (enterFrame) {
if (_root.score != old_score) {
score = _root.score;
old_score = score;
hundreds = Math.floor(score / 100);
score = score - (hundreds * 100);
tens = Math.floor(score / 10);
score = score - (tens * 10);
ones = score;
hundreds_clip.gotoAndStop("n" + hundreds);
tens_clip.gotoAndStop("n" + tens);
ones_clip.gotoAndStop("n" + ones);
}
}
Symbol 165 MovieClip [bullet] Frame 1
stop();
Symbol 176 MovieClip [ink_ammo] Frame 1
stop();
Symbol 189 MovieClip [sworm_sprite] Frame 1
stop();
Symbol 220 MovieClip [dbird_sprite] Frame 1
stop();
Symbol 220 MovieClip [dbird_sprite] Frame 9
stop();
Symbol 226 MovieClip [lives] Frame 1
stop();
Symbol 236 Button
on (release) {
_root.getName();
}
on (keyPress "<Enter>") {
_root.getName();
}