pretty good
good... but very very cruel.
spd = 7;
jump = true
yspd = 0;
xscale = dude._xscale;
onEnterFrame = function (){
if (Key.isDown(Key.RIGHT)){
dude._xscale = xscale;
if (!ground.hitTest(dude._x+spd+_
x.dude._y+_y-15, true) &&
!ground.hitTest(dude._x+spd+_x , dude._y+_y-dude._height, true)){
dude._x += spd;
if(dude.x>_x-150){
dude._x = _x-150;
ground._x -=spd;
gspd = -spd;
} else {
gspd = 0;
}
if (!Jump && yspd<=0){
walk = true;
}
} else if (Key.isDown(Key.LEFT)){
dude._xscale = -xscale;
if (!ground.hitTest(dude._x+_x-sp d,dude._y+_y-15, true) &&
!ground. hitTest(dude._x+_x-spd, dude._y+_y-dude._height, true)){
dude._x -= spd;
if(dude._x<_x-Stage.width){
dude._x -= spd;
ground._x += spd;
gspd = spd;
}}else{
gspd = 0;
}
}else{
gspd = 0;
}
if (!jump && yspd<=0){
walk = true;
}
}else{
gspd = 0;
walk = false;
}
if(walk){
dude.gotoAndStop[2];
}else if (yspd>0){
dude.gotoAndStop[3];
}else{
dude.gotoAndStop[1];
}
if(Key.isDown(Key.UP)&&!jump){
walk = false;
jump = true;
yspd = 13;
}
if(jump){
yspd--;
if(yspd<=-20){
yspd = -20;
}
dude._y-= yspd;
}else{
yspd = 0;
}
if(!jump){
while (ground.hitTest(dude._x+_x, dude._y+_y-1, true)){
dude._y--;
}
}
if(ground.hitTest(dude._x+_x, dude._y+y, true)){
while(ground.hitTest(dude._x+_
x, dude._y+_y-1, true)){
dude._y -= 1;
}
jump = false;
}else{
jump = true;
}
if(ground.hitTest(dude._x+_x, dude._y+_y-dude._height, true&&jump
&&yspd>0)){
yspd = 0;
}
};
for(i=0; i<3; i++){
duplicateMovieClip(enemy, "e_"+1,1*100);
_root.scroll1["e_"+i]._x = random(Stage.width);
_root.scroll1["e_"+i]._y = 100;
_root.scroll1["e_"+i].spd = (spd/4)+random(4);
_root.scroll1["e_"+i].xscale = _root.scroll1["e_"+i]._xscale;
_root.scroll1["e_"+1].jump = true;
_root.scroll1["e_"+i].onEnterF rame = function(){
this._x +=gspd;
if(dude._x<this._x-5){
this._xscale = -this.xscale;
if(!ground.hitTest(this._x+_x-
this.spd, this._y+_y-15,true)){
this._x -= this.spd;
}
}else if(dude._x>this._x+5){
this._xscale = this.xscale;
if(!ground.hitTest(this._x+_x+
this.spd, this._y+_y-15, true)){
this._x += this.spd;
}
}
if(this.jump){
this.yspd--;
if(this.yspd<=-20){
this.yspd = -20;
}
this._y -= this.yspd;
}else{
this.yspd = 0;
}
if(ground.hitTest(this._x+_x, this._y+_y, true)){
dude._y -= 1;
}
this.jump = false;
}else{
this.jump = true;
}
if(this.hitTest(dude._x+_x, dude._y+_y+this._height,true)&
&
dude.hitTest(this._x+_x, this._y+_y-this._height,true)&
&yspd<0&&
this._currentframe != 2){
this.gotoAndStop(2);
yspd = 8;
}
};
theres the actionscript for the platformer seen as i took like 40 mins writin it and i dont want anyone else to go through it aswell