Combined Code
movieClip 4 {
}
movieClip 7 {
}
movieClip 18 {
}
movieClip 24 {
}
button 27 {
on (release) {
getURL('http://www.newgrounds.com', '_blank');
}
}
movieClip 29 {
frame 40 {
stop();
}
}
movieClip 40 {
}
button 41 {
on (release) {
startMovie();
}
}
movieClip 42 {
frame 1 {
function timerHandler() {
if (!loadingComplete) {
var v4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * v4;
if (v4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop('loaded');
}
return undefined;
}
}
dt = getTimer() - time;
time += dt;
frameAccum += dt;
var v3 = 0;
for (;;) {
if (!(frameAccum >= FRAME_TIME && v3 < MAX_FRAME_SKIP)) break;
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
frameAccum -= FRAME_TIME;
v3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return undefined;
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof clip[childName] == 'movieclip') {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.33333333333334;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, 'timerHandler', FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
}
frame 51 {
stop();
}
}
movieClip 45 {
}
movieClip 47 {
}
movieClip 49 {
}
movieClip 51 {
}
movieClip 53 {
}
movieClip 55 {
}
movieClip 57 {
}
movieClip 59 {
}
movieClip 60 {
}
movieClip 63 {
}
movieClip 65 {
}
movieClip 68 {
}
movieClip 69 {
}
movieClip 71 {
}
movieClip 74 {
}
movieClip 75 {
}
movieClip 78 {
}
movieClip 79 {
}
movieClip 81 {
}
movieClip 83 {
}
movieClip 85 {
}
movieClip 87 {
}
movieClip 89 {
frame 1 {
stop();
}
}
movieClip 91 {
}
movieClip 93 {
}
movieClip 94 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
}
movieClip 95 {
}
// unknown tag 88 length 78
movieClip 100 {
}
frame 15 {
stop();
}
movieClip 104 {
frame 1 {
stop();
onEnterFrame = function () {
if (Key.isDown(13)) {
_root.gotoAndStop('Dante');
}
};
}
frame 2 {
gotoAndStop(2);
}
frame 3 {
stop();
onEnterFrame = function () {
if (Key.isDown(13)) {
_root.gotoAndStop('Vergil');
}
};
}
}
instance of movieClip 104 {
onClipEvent (enterFrame) {
if (Key.isDown(37)) {
this.gotoAndStop(1);
}
if (Key.isDown(39)) {
this.gotoAndStop(3);
}
}
}
frame 16 {
stop();
}
button 108 {
on (press) {
gotoAndStop(17);
}
}
frame 17 {
stop();
}
movieClip 111 {
frame 1 {
function camControl() {
parentColor.setTransform(camColor.getTransform());
var v4 = sX / this._width;
var v3 = sY / this._height;
_parent._x = cX - this._x * v4;
_parent._y = cY - this._y * v3;
_parent._xscale = 100 * v4;
_parent._yscale = 100 * v3;
}
function resetStage() {
var v2 = {'ra': 100, 'rb': 0, 'ga': 100, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 100, 'ab': 0};
parentColor.setTransform(v2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
var oldMode = Stage.scaleMode;
Stage.scaleMode = 'exactFit';
var cX = Stage.width / 2;
var cY = Stage.height / 2;
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
}
}
instance of movieClip 111 {
onClipEvent (enterFrame) {
_y = _y + (_root.player._y - _y);
_x = _x + (_root.player._x - _x);
}
}
movieClip 116 {
}
movieClip 117 {
frame 1 {
stop();
}
instance wall of movieClip 116 {
onClipEvent (enterFrame) {
if (_root.player.hitTest(this)) {
_root.player._x -= 15;
}
}
}
instance wall2 of movieClip 116 {
onClipEvent (enterFrame) {
if (_root.player.hitTest(this)) {
_root.player._x += 15;
}
}
}
}
movieClip 120 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 25 {
_root.player.gotoAndStop(3);
}
}
movieClip 128 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 15 {
_root.player.gotoAndStop(3);
}
}
movieClip 129 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
}
movieClip 132 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 21 {
_root.player.gotoAndStop(3);
}
}
movieClip 133 {
}
movieClip 134 {
frame 1 {
stop();
}
}
movieClip 154 {
}
movieClip 155 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 11 {
if (Key.isDown(65)) {
gotoAndPlay(12);
} else {
_root.player.gotoAndStop(3);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 17 {
if (Key.isDown(65)) {
gotoAndPlay(19);
} else {
_root.player.gotoAndStop(3);
}
}
frame 18 {
if (Key.isDown(65)) {
gotoAndPlay(20);
} else {
_root.player.gotoAndStop(3);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 25 {
if (Key.isDown(65)) {
gotoAndPlay(26);
} else {
_root.player.gotoAndStop(3);
}
}
frame 36 {
if (Key.isDown(65)) {
gotoAndPlay(37);
} else {
_root.player.gotoAndStop(3);
}
}
frame 47 {
_root.player.gotoAndStop(3);
}
}
movieClip 158 {
}
movieClip 160 {
}
movieClip 162 {
}
movieClip 163 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 11 {
if (Key.isDown(83)) {
gotoAndPlay(12);
} else {
_root.player.gotoAndStop(3);
}
}
frame 19 {
_root.player.gotoAndStop(3);
}
}
movieClip 164 {
frame 1 {
stop();
}
instance of movieClip 120 {
onClipEvent (keyUp) {
_root.player.gotoAndStop(3);
}
}
instance attack of movieClip 155 {
onClipEvent (load) {
var speed = 15;
scale = _root.player._xscale;
var slow = 0.7;
var slowspd = speed / 2;
var setspeed = speed;
var scale = _xscale;
var ex = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
_root.player._x += speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
} else {
if (Key.isDown(37)) {
_root.player._x -= speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
}
}
if (_root.wall2.hitTest(this)) {
_root.player._x += 8;
}
if (_root.wall.hitTest(this)) {
_root.player._x -= 15;
}
}
}
instance attack of movieClip 163 {
onClipEvent (load) {
var speed = 15;
scale = _root.player._xscale;
var slow = 0.7;
var slowspd = speed / 2;
var setspeed = speed;
var scale = _xscale;
var ex = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
_root.player._x += speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
} else {
if (Key.isDown(37)) {
_root.player._x -= speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
}
}
if (_root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 2, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 6, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height, true)) {
_root.player._x -= 35;
}
if (_root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 2, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 6, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height, true)) {
_root.player._x += 35;
}
}
}
}
instance player of movieClip 164 {
onClipEvent (load) {
var grav = 0;
var run = 15;
var wlk = 2.5;
var speed = run;
var jumpHeight = 15;
var dbl = 19;
var tri = 0;
var djump = false;
var tjump = false;
var slow = 0.7;
var slowspd = speed / 2;
var setspeed = speed;
var scale = _xscale;
var ex = 5;
this.gotoAndStop(2);
}
onClipEvent (enterFrame) {
if (Key.isDown(38) && _root.ground.hitTest(_x, _y + 3, true)) {
grav = -jumpHeight;
_y = _y - 4;
this.gotoAndStop(2);
} else {
if (Key.isDown(38) && djump == false && grav > 0 && tjump == false) {
grav = -dbl;
djump = true;
_root.jd.gotoAndPlay(2);
duplicateMovieClip(_root.jd, 'dast jump', 1000);
_root.jd._y = this._y;
_root.jd._x = this._x;
this.gotoAndStop(4);
}
}
if (Key.isDown(39)) {
this._xscale = scale;
}
if (Key.isDown(37)) {
this._xscale = -scale;
}
++grav;
_y = _y + grav;
while (_root.ground.hitTest(_x, _y, true)) {
djump = false;
tjump = false;
_y = _y - 1;
grav = 0;
}
if (_root.water.hitTest(_x, _y, true)) {
grav *= slow * 1.25;
speed = slowspd;
} else {
speed = setspeed;
}
if (Key.isDown(37)) {
this._xscale = -scale;
}
if (Key.isDown(39)) {
this._xscale = scale;
}
if (Key.isDown(83)) {
this.gotoAndStop(6);
_root.shoot._y = this._y;
_root.shoot._x = this._x;
} else {
if (Key.isDown(65)) {
this.gotoAndStop(5);
} else {
if (Key.isDown(39)) {
_x = _x + speed;
this._xscale = scale;
this.gotoAndStop(1);
} else {
if (Key.isDown(37)) {
_x = _x - speed;
this._xscale = -scale;
this.gotoAndStop(1);
}
}
}
}
if (Key.isDown(38) && _root.ground.hitTest(_x, _y + 3, true)) {
grav = -jumpHeight;
_y = _y - 4;
this.gotoAndStop(2);
} else {
if (Key.isDown(38) && djump == false && grav > 0 && tjump == false) {
grav = -dbl;
djump = true;
this.gotoAndStop(4);
_root.jd.gotoAndPlay(2);
duplicateMovieClip(_root.jd, 'dast jump', 1000);
_root.jd._y = this._y;
_root.jd._x = this._x;
}
}
if (_root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 2, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 6, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height, true)) {
_x = _x - 15;
}
if (_root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 2, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 6, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height, true)) {
_x = _x + 15;
}
if (_root.ground.hitTest(_x, _y - _height - 15, true)) {
grav = 1;
}
if (_root.dd._currentframe == 2) {
swapDepths(2);
_root.dd._x = this._x;
_root.dd._y = this._y;
this.removeMovieClip();
}
}
}
movieClip 172 {
frame 1 {
stop();
}
frame 8 {
gotoAndStop(1);
}
}
movieClip 174 {
}
movieClip 176 {
}
movieClip 177 {
frame 1 {
stop();
}
frame 639 {
_root.gotoAndStop('DWins');
onEnterFrame = function () {
swapDepths(2);
_root.vd.gotoAndPlay(2);
_root.vd._x = _root.Vergil._x;
_root.vd._y = _root.Vergil._y;
_root.Vergil.removeMovieClip();
};
}
}
movieClip 179 {
}
movieClip 180 {
frame 1 {
stop();
}
frame 617 {
onEnterFrame = function () {
swapDepths(2);
_root.dd.gotoAndPlay(2);
_root.dd._x = _root.Dante._x;
_root.dd._y = _root.Dante._y;
_root.Dante.removeMovieClip();
};
_root.gotoAndStop('VWins');
}
}
movieClip 181 {
}
instance hps of movieClip 181 {
onClipEvent (enterFrame) {
_y = _y + (_root.player._y - _y);
_x = _x + (_root.player._x - _x);
}
}
movieClip 183 {
frame 17 {
_root.player.gotoAndStop(3);
}
}
movieClip 218 {
}
movieClip 220 {
}
movieClip 221 {
}
movieClip 222 {
frame 37 {
if (_root.Vergil.hitTest(_root.player)) {
gotoAndPlay(38);
} else {
if (!_root.Vergil.hitTest(_root.player)) {
_root.Vergil.gotoAndStop(1);
}
}
}
frame 57 {
if (_root.Vergil.hitTest(_root.player)) {
gotoAndPlay(58);
} else {
if (!_root.Vergil.hitTest(_root.player)) {
_root.Vergil.gotoAndStop(1);
}
}
}
frame 64 {
if (_root.Vergil.hitTest(_root.player)) {
gotoAndPlay(65);
} else {
if (!_root.Vergil.hitTest(_root.player)) {
_root.Vergil.gotoAndStop(1);
}
}
}
}
movieClip 223 {
frame 1 {
stop();
}
instance of movieClip 183 {
onClipEvent (keyUp) {
_root.player.gotoAndStop(3);
}
}
frame 73 {
gotoAndStop(1);
}
}
instance Vergil of movieClip 223 {
onClipEvent (load) {
var ground = _root.ground;
var grav = 0;
var gravity = 2;
var speed = 8;
var maxJump = -20;
var touchingGround = false;
}
onClipEvent (enterFrame) {
_y = _y + grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y = _y - gravity;
grav = 0;
}
if (ground.hitTest(_x, _y + 5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
}
onClipEvent (enterFrame) {
if (_root.player._x < this._x) {
this._xscale = 20;
} else {
if (_root.player._x > this._x) {
this._xscale = -20;
}
}
}
onClipEvent (enterFrame) {
if (this._x > _root.player._x) {
this._x -= 6;
} else {
if (this._x < _root.player._x) {
this._x += 6;
} else {
if (this.hitTest(_root.player.attack)) {
hp -= 3;
}
}
}
if (Math.abs(this._x - _root.player._x) < 1) {
this._x = _root.player._x;
} else {
if (this.hitTest(_root.player.attack)) {
hp -= 0.1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player)) {
this.gotoAndPlay(2);
}
}
onClipEvent (load) {
moveSpeed = 8;
radius = _width / 2 - 1;
gravity = 10;
startJumpHeight = 25;
jumpHeight = 0;
jumping = false;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (this.attack.hitTest(_root.player)) {
_root.hps.DanteHp.nextFrame();
}
if (this.hitTest(_root.player.attack)) {
_root.hps.VergilHp.nextFrame();
}
if (this.hitTest(_root.shoot)) {
_root.hps.VergilHp.nextFrame();
}
if (_root.vd._currentframe == 2) {
swapDepths(2);
_root.vd._x = this._x;
_root.vd._y = this._y;
this.removeMovieClip();
}
}
}
movieClip 227 {
instance gun of movieClip 89 {
onClipEvent (mouseDown) {
this.gotoAndPlay(2);
}
}
frame 33 {
stop();
}
}
movieClip 228 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 229 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
frame 18 {
stop();
}
button 233 {
on (press) {
gotoAndStop(19);
}
}
frame 19 {
stop();
}
instance V of movieClip 111 {
onClipEvent (enterFrame) {
_y = _y + (_root.player._y - _y);
_x = _x + (_root.player._x - _x);
}
}
movieClip 234 {
}
movieClip 241 {
frame 1 {
stop();
}
frame 8 {
gotoAndStop(1);
}
}
movieClip 242 {
}
movieClip 243 {
frame 1 {
play();
}
instance attack of movieClip 155 {
onClipEvent (load) {
var speed = 15;
scale = _root.player._xscale;
var slow = 0.7;
var slowspd = speed / 2;
var setspeed = speed;
var scale = _xscale;
var ex = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
_root.player._x += speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
} else {
if (Key.isDown(37)) {
_root.player._x -= speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
}
}
if (_root.wall2.hitTest(this)) {
_root.player._x += 8;
}
if (_root.wall.hitTest(this)) {
_root.player._x -= 15;
}
}
}
instance attack of movieClip 163 {
onClipEvent (load) {
var speed = 15;
scale = _root.player._xscale;
var slow = 0.7;
var slowspd = speed / 2;
var setspeed = speed;
var scale = _xscale;
var ex = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
_root.player._x += speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
} else {
if (Key.isDown(37)) {
_root.player._x -= speed;
this.legs.gotoAndStop(2);
_root.player._xscale = scale;
}
}
if (_root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 2, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 6, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height, true)) {
_root.player._x -= 35;
}
if (_root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 2, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 6, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height, true)) {
_root.player._x += 35;
}
}
}
}
movieClip 244 {
frame 1 {
stop();
}
frame 86 {
gotoAndStop(1);
}
}
instance Dante of movieClip 244 {
onClipEvent (load) {
var ground = _root.ground;
var grav = 0;
var gravity = 2;
var speed = 8;
var maxJump = -20;
var touchingGround = false;
}
onClipEvent (enterFrame) {
_y = _y + grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y = _y - gravity;
grav = 0;
}
if (ground.hitTest(_x, _y + 5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
}
onClipEvent (enterFrame) {
if (_root.player._x < this._x) {
this._xscale = 20;
} else {
if (_root.player._x > this._x) {
this._xscale = -20;
}
}
}
onClipEvent (enterFrame) {
if (this._x > _root.player._x) {
this._x -= 6;
} else {
if (this._x < _root.player._x) {
this._x += 6;
} else {
if (this.hitTest(_root.player.attack)) {
hp -= 3;
}
}
}
if (Math.abs(this._x - _root.player._x) < 1) {
this._x = _root.player._x;
} else {
if (this.hitTest(_root.player.attack)) {
hp -= 0.1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player)) {
this.gotoAndPlay(2);
}
}
onClipEvent (load) {
moveSpeed = 8;
radius = _width / 2 - 1;
gravity = 10;
startJumpHeight = 25;
jumpHeight = 0;
jumping = false;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (this.attack.hitTest(_root.player)) {
_root.hps.VergilHp.nextFrame();
}
if (this.hitTest(_root.player.attack)) {
_root.hps.DanteHp.nextFrame();
}
if (_root.dd._currentframe == 2) {
swapDepths(2);
_root.dd._x = this._x;
_root.dd._y = this._y;
this.removeMovieClip();
}
}
}
instance hps of movieClip 181 {
onClipEvent (enterFrame) {
_y = _y + (_root.player._y - _y);
_x = _x + (_root.player._x - _x);
}
}
movieClip 252 {
frame 22 {
_root.player.gotoAndStop(3);
}
}
movieClip 253 {
}
movieClip 255 {
frame 21 {
_root.player.gotoAndStop(3);
}
}
movieClip 256 {
frame 15 {
if (Key.isDown(65) && Key.isDown(37)) {
gotoAndPlay(16);
} else {
if (Key.isDown(65) && Key.isDown(39)) {
gotoAndPlay(16);
} else {
if (Key.isDown(65) && Key.isDown(40)) {
gotoAndPlay(16);
} else {
_root.player.gotoAndStop(3);
}
}
}
}
frame 37 {
if (Key.isDown(65) && Key.isDown(37)) {
gotoAndPlay(16);
} else {
if (Key.isDown(65) && Key.isDown(39)) {
gotoAndPlay(16);
} else {
_root.player.gotoAndStop(3);
}
}
}
frame 38 {
_root.player.gotoAndStop(3);
}
}
movieClip 257 {
frame 12 {
_root.player.gotoAndStop(3);
}
}
movieClip 258 {
frame 1 {
stop();
}
instance of movieClip 183 {
onClipEvent (keyUp) {
_root.player.gotoAndStop(3);
}
}
instance attack of movieClip 256 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.Dante.attack) && Key.isDown(40)) {
this.gotoAndPlay(30);
}
if (this.hitTest(_root.Dante.attack) && Key.isDown(37)) {
this.gotoAndPlay(30);
}
if (this.hitTest(_root.Dante.attack) && Key.isDown(39)) {
this.gotoAndPlay(30);
}
}
}
}
instance player of movieClip 258 {
onClipEvent (load) {
var grav = 0;
var run = 15;
var wlk = 2.5;
var speed = run;
var jumpHeight = 15;
var dbl = 19;
var tri = 0;
var djump = false;
var tjump = false;
var slow = 0.7;
var slowspd = speed / 2;
var setspeed = speed;
var scale = _xscale;
var ex = 5;
this.gotoAndStop(2);
}
onClipEvent (enterFrame) {
if (Key.isDown(38) && _root.ground.hitTest(_x, _y + 3, true)) {
grav = -jumpHeight;
_y = _y - 4;
this.gotoAndStop(2);
} else {
if (Key.isDown(38) && djump == false && grav > 0 && tjump == false) {
grav = -dbl;
djump = true;
_root.jd.gotoAndPlay(2);
duplicateMovieClip(_root.jd, 'dast jump', 1000);
_root.jd._y = this._y;
_root.jd._x = this._x;
this.gotoAndStop(4);
}
}
if (Key.isDown(39)) {
this._xscale = scale;
}
if (Key.isDown(37)) {
this._xscale = -scale;
}
++grav;
_y = _y + grav;
while (_root.ground.hitTest(_x, _y, true)) {
djump = false;
tjump = false;
_y = _y - 1;
grav = 0;
}
if (_root.water.hitTest(_x, _y, true)) {
grav *= slow * 1.25;
speed = slowspd;
} else {
speed = setspeed;
}
if (Key.isDown(37)) {
this._xscale = -scale;
}
if (Key.isDown(39)) {
this._xscale = scale;
}
if (Key.isDown(83)) {
this.gotoAndStop(6);
_root.shoot._y = this._y;
_root.shoot._x = this._x;
} else {
if (Key.isDown(65)) {
this.gotoAndStop(5);
} else {
if (Key.isDown(39)) {
_x = _x + speed;
this._xscale = scale;
this.gotoAndStop(1);
} else {
if (Key.isDown(37)) {
_x = _x - speed;
this._xscale = -scale;
this.gotoAndStop(1);
}
}
}
}
if (Key.isDown(38) && _root.ground.hitTest(_x, _y + 3, true)) {
grav = -jumpHeight;
_y = _y - 4;
this.gotoAndStop(2);
} else {
if (Key.isDown(38) && djump == false && grav > 0 && tjump == false) {
grav = -dbl;
djump = true;
this.gotoAndStop(4);
_root.jd.gotoAndPlay(2);
duplicateMovieClip(_root.jd, 'dast jump', 1000);
_root.jd._y = this._y;
_root.jd._x = this._x;
}
}
if (_root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 2, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height / 6, true) || _root.ground.hitTest(_x + _width / 2 + ex, _y - _height, true)) {
_x = _x - 15;
}
if (_root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 2, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height / 6, true) || _root.ground.hitTest(_x - _width / 2 - ex, _y - _height, true)) {
_x = _x + 15;
}
if (_root.ground.hitTest(_x, _y - _height - 15, true)) {
grav = 1;
}
if (_root.vd._currentframe == 2) {
swapDepths(2);
_root.vd._x = this._x;
_root.vd._y = this._y;
this.removeMovieClip();
}
}
}
frame 20 {
stop();
}
button 261 {
on (press) {
stopAllSounds();
gotoAndStop('Menu');
}
}