
![]() | Runolympics 2015 Participation |
Konradix wrote:(when I'm walking to left then it uses left sprite walking, but when im walking to right its not flipping horizontal, its changing left walking to right.)
| Error contacting Twitter | |
| Error contacting last.fm |
![]() | Runouw Votes Winner |
onClipEvent (load) {
gravity = 10;
scale = _xscale;
walkSpeed = 6;
maxjump = 6;
}
onClipEvent (enterFrame) {
if (air == true) {
_y += gravity;
state = 3;
}
if (Key.isDown(Key.LEFT) && !_root.leftbound.hitTest(_x, _y, true)) {
_x -= walkSpeed;
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT) && !_root.rightbound.hitTest(_x, _y, true)) {
_x += walkSpeed;
_xscale = scale;
}
if (_root.platforms.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(Key.SPACE) && jump == true) {
_y -= jumpSpeed;
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 22;
}
if (Key.isDown(Key.SPACE)) {
jumpcount += 1;
}
if (jumpcount > maxjump && jumpSpeed > -2) {
jumpSpeed -= 2;
}
if (air == false && !Key.isDown(Key.LEFT) && !Key.isDown(65) && _currentframe < 4 or air == false && !Key.isDown(Key.RIGHT) && !Key.isDown(65) && _currentframe < 4) {
state = 1;
}
if (Key.isDown(Key.LEFT) && air == false && !Key.isDown(65) && _currentframe < 4 or Key.isDown(Key.RIGHT) && air == false && !Key.isDown(65) && _currentframe < 4) {
state = 2;
}
if (!Key.isDown(65)) {
gotoAndStop(state);
}
_root.statetxt = state;
}
onClipEvent (keyUp) {
if (Key.getCode() == 83) {
jump = false;
}
}

![]() | Runolympics 2015 Participation |

![]() | Runolympics 2015 Participation |
| Error contacting Twitter |
![]() | The Start of Something Big |
onClipEvent (load) {
var grav:Number = 0;
var run:Number = 10;
var wlk:Number = 2.5;
var speed:Number = run;
var jumpHeight:Number = 12;
var tjump:Boolean = false;
var slow:Number = .7;
var slowspd:Number = speed/2;
var setspeed:Number = speed;
var scale:Number = _xscale;
var ex:Number = 5;
this.gotoAndStop(2);
}
onClipEvent (enterFrame) {
grav++;
_y += grav;
if (Key.isDown(65)) {
setspeed = wlk;
} else {
setspeed = run;
}
while (_root.ground.hitTest(_x, _y, true)) {
tjump = false;
_y--;
grav = 5;
}
if (_root.water.hitTest(_x, _y, true)) {
grav *= slow*1.25;
speed = slowspd;
} else {
speed = setspeed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
_xscale = scale;
if (_root.ground.hitTest(_x, _y+3, true)) {
this.gotoAndStop(1);
} else {
if (djump == false) {
this.gotoAndStop(2);
} else if (tjump == false) {
this.gotoAndStop(4);
} else {
this.gotoAndStop(5);
}
}
} else if (Key.isDown(Key.LEFT)) {
_x -= speed;
_xscale = -scale;
if (_root.ground.hitTest(_x, _y+3, true)) {
this.gotoAndStop(1);
} else {
if (djump == false) {
this.gotoAndStop(2);
} else if (tjump == false) {
this.gotoAndStop(4);
} else {
this.gotoAndStop(5);
}
}
} else {
if (_root.ground.hitTest(_x, _y+3, true) && !Key.isDown(68) && !Key.isDown(83)) {
this.gotoAndStop(3);
}
}
if (Key.isDown(68) && !Key.isDown(Key.UP) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT) && !Key.isDown(83) && _root.ground.hitTest(_x, _y+3, true)) {
this.gotoAndStop(8);
}
if (Key.isDown(83) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.UP) && !Key.isDown(68) && _root.ground.hitTest(_x, _y+3, true) && _currentframe != 6) {
this.gotoAndStop(7);
} else if (Key.isDown(83) && grav>1) {
this.gotoAndStop(6);
}
if (Key.isDown(Key.UP) && _root.ground.hitTest(_x, _y+3, true)) {
grav = -jumpHeight;
_y -= 4;
this.gotoAndStop(2);
} else if (Key.isDown(Key.UP) && djump == false && grav>0 && tjump == false) {
grav = -dbl;
this.gotoAndStop(4);
} else if (Key.isDown(68) && tjump == false && grav>1) {
grav = -tri;
tjump = true;
this.gotoAndStop(5);
}
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 -= speed;
}
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 += speed;
}
if (_root.ground.hitTest(_x, _y-_height-15, true)) {
grav = 1;
}
}| Error contacting Twitter |
![]() | The Start of Something Big |

![]() | Runolympics 2015 Participation |
| Error contacting Twitter |
![]() | The Start of Something Big |

![]() | Runolympics 2015 Participation |