# Whats wrong with this

**URL:** <https://forum.kirupa.com/t/whats-wrong-with-this/227925>\
**Category:** programming\
**Created:** [June 3, 2007, 10:57pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this/227925 "2007-06-03T22:57:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LordArkain](https://avatars.discourse-cdn.com/v4/letter/l/f07891/32.png) [@LordArkain](https://forum.kirupa.com/u/LordArkain)\
**Post date:** [June 3, 2007, 10:57pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this/227925/1 "2007-06-03T22:57:44Z")

</div>

[COLOR=red]EDIT[/COLOR]:Okay, this is the mini game I made so far since I was bored.  
[PLAY](http://www.geocities.com/hostedstuff/FunnyGame.swf)

This should work, it’s a simple movement code for moving and jumping and falling. So why does the bold part not work?

```auto

//defined variables on load
onClipEvent(load){
 PLAYERX=this._x;
 PLAYERY=this.Hero._y;
 jumping = true; 
 jump = 0;
 movespeed=4;
 falling=true;
 fallspeed=10;
}
onClipEvent(enterFrame){
 if(Key.isDown(Key.RIGHT)&&this._xscale==-100||Key.isDown(68)&&this._xscale==-100){
  this._xscale=100;
  **this._x+=movespeed;**
 }
 if(Key.isDown(Key.LEFT)&&this._xscale==100||Key.isDown(65)&&this._xscale==100){
  this._xscale=-100;
  **this._x-=movespeed;**
 }
 //jumping
 if (Key.isDown(Key.UP) && !jumping && !falling||Key.isDown(87)&& !jumping && !falling) { 
  _root.jumpsound.start();
  jumping = true; 
 } 
 if (jumping) {  
  this._y -= jump; 
  jump -= 1; 
  if (jump<0) { 
   falling = true; 
  } 
  if (jump<-12) { 
   jump = -12; 
  } 
 } 
 //falling 
 if (_root.Ground.hitTest(this._x, this._y, true) && falling) { 
  jump = 15; 
  jumping = false; 
  falling = false; 
 }
 if (!_root.Ground.hitTest(this._x, this._y, true) && !jumping) { 
  this._y += fallspeed; 
  falling=true;
 } 
}

```
