# Two player fighting on keyboard

**URL:** https://forum.kirupa.com/t/two-player-fighting-on-keyboard/191939
**Category:** programming
**Created:** [June 24, 2006, 4:14am UTC](https://forum.kirupa.com/t/two-player-fighting-on-keyboard/191939 "2006-06-24T04:14:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Chibineas](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Chibineas](https://forum.kirupa.com/u/Chibineas)
#### Post date: [June 24, 2006, 4:14am UTC](https://forum.kirupa.com/t/two-player-fighting-on-keyboard/191939/1 "2006-06-24T04:14:44Z")

</div>

I am making a game where two people control characters on the keyboard. Player one uses numbers (with the getASCII method) and the other one uses the arrow keys and the Key class. For some reason, the first character’s motion is really choppy and whenever the arrow keys are pressed (by player two). What’s wrong?

Here’s my engine in a nutshell:  
onClipEvent(keyDown){  
key = Key.getASCII();  
}  
onClipEvent(keyUp){  
key = 999;  
}  
//move p1 left if ‘a’ is pressed  
onClipEvent(enterFrame){  
if(key == 97){  
playerOne.moveLeft();  
}else{  
playerOne.stand();  
}  
//move p2 left if LEFT is pressed  
if(Key.isDown(Key.LEFT)){  
playerTwo.moveLeft();  
}else{  
playerTwo.stand();  
}  
}
