# Combos n stuff!

**URL:** <https://forum.kirupa.com/t/combos-n-stuff/59246>\
**Category:** programming\
**Created:** [July 29, 2004, 4:31pm UTC](https://forum.kirupa.com/t/combos-n-stuff/59246 "2004-07-29T16:31:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elPooter](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@elPooter](https://forum.kirupa.com/u/elPooter)\
**Post date:** [July 29, 2004, 4:31pm UTC](https://forum.kirupa.com/t/combos-n-stuff/59246/1 "2004-07-29T16:31:33Z")

</div>

Hello Kirupans!

I have been working on a mario game for some time now, and I decided to add some punching combos for mario. The only problem is that I dont know how to do this. The code I am using for this is the following:

```php
 
onClipEvent (enterFrame) {
 if (Key.isDown(90)) {
  this.gotoAndStop("punch1");
 }
 if (this.punch1._currentframe == 5) {
  if (Key.isDown(90)) {
   this.gotoAndStop("punch2");
  }
  if (this.punch2._currentframe == 5) {
   if (Key.isDown(90)) {
	this.gotoAndStop("kick");
   }
  }
 }
}

```

Please help. This has been driving me MAD :crazy:.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2004, 12:24pm UTC](https://forum.kirupa.com/t/combos-n-stuff/59246/2 "2004-07-30T12:24:39Z")

</div>

you might not want to test the Key in an onEnterFrame, use an event or listener instead.  
That way the game will always act instantanious and without lag.

check your reference on : Key.addListener()
