# Need Help resolving game bugs!

**URL:** <https://forum.kirupa.com/t/need-help-resolving-game-bugs/42386>\
**Category:** programming\
**Created:** [February 8, 2004, 7:34pm UTC](https://forum.kirupa.com/t/need-help-resolving-game-bugs/42386 "2004-02-08T19:34:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fargate](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@Fargate](https://forum.kirupa.com/u/Fargate)\
**Post date:** [February 8, 2004, 7:34pm UTC](https://forum.kirupa.com/t/need-help-resolving-game-bugs/42386/1 "2004-02-08T19:34:36Z")

</div>

I’ve created a platformer game. The problem is that sometimes my character rides to high on the platforms as well as too low. He even ends up falling through sometimes. The platforms are all in one mc. Below is the jumping and platform script.

[AS]  
onClipEvent (enterFrame) {  
if (Key.isDown(Key.UP) && !jumping) {  
vel\_y = 36;  
jumping = true;  
}  
if (jumping == true) {  
vel\_y -= 2;  
if (vel\_y\<=-15) {  
vel\_y = -15;  
}  
this.\_y -= vel\_y;  
}  
if (\_root.ground.hitTest(this.\_x, this.\_y+35, true)) {  
vel\_y = 0;  
jumping = false;  
}  
}  
onClipEvent (enterFrame) {  
this.\_y += 16;  
if (\_root.ground.hitTest(this.\_x, this.\_y+1, true)) {  
this.\_y -= 16;  
}  
}  
[/AS]

Any ideas on how fix either of this aspects would be a great help! Thanks in advance :).

---

<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:** [February 8, 2004, 11:40pm UTC](https://forum.kirupa.com/t/need-help-resolving-game-bugs/42386/2 "2004-02-08T23:40:04Z")

</div>

why does that mc have two onenterframe events?  
anyway if i got u correctly this may help, let me know if it does  
[AS]  
onClipEvent (enterFrame) {  
if (Key.isDown(Key.UP) && !jumping) {  
vel\_y = 36;  
jumping = true;  
}  
if (jumping == true) {  
vel\_y -= 2;  
if (vel\_y\<=-15) {  
vel\_y = -15;  
}  
this.\_y -= vel\_y;  
}  
if (\_root.ground.hitTest(this.\_x, this.\_y+(\_height/2), true)) {  
vel\_y = 0;  
jumping = false;  
}  
this.\_y += 16;  
if (\_root.ground.hitTest(this.\_x, this.\_y+(\_height/2), true)) {  
this.\_y -= 16;  
}  
}  
[/AS]

---

<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:** [February 9, 2004, 4:47pm UTC](https://forum.kirupa.com/t/need-help-resolving-game-bugs/42386/3 "2004-02-09T16:47:51Z")

</div>

whoa…no that made it even more messed up. My guy would speed up and slow down while jumping and wouldn’t stay on almost any of the platforms… Do you think it’s because I have two onClipEvent’s that my script is messing up? I have no clue what’s wrong…
