# Making a mario type platform game! Need Help!

**URL:** <https://forum.kirupa.com/t/making-a-mario-type-platform-game-need-help/235920>\
**Category:** programming\
**Created:** [August 15, 2007, 7:32pm UTC](https://forum.kirupa.com/t/making-a-mario-type-platform-game-need-help/235920 "2007-08-15T19:32:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiderduckie](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Spiderduckie](https://forum.kirupa.com/u/Spiderduckie)\
**Post date:** [August 15, 2007, 7:32pm UTC](https://forum.kirupa.com/t/making-a-mario-type-platform-game-need-help/235920/1 "2007-08-15T19:32:27Z")

</div>

Hi, I’m working on a mario style platform game, and I used the platform game tutorial from this site, but I’m having problems making another platform for the character to jump on. The only one I have currently is the “ground” platform. Also I’m having trouble with enemies and killing them.

if anyone could help it’d be great thanks.

this is the code I’m using for the main character.

```auto
onClipEvent (load) {
jumping = true;
speed = 0;
maxmove = 15;
jump = 0;
}
onClipEvent (enterFrame) {
if (_root.dead) {
this.gotoAndStop("dead");
} else {
speed *= .85;
if (speed>0) {
dir = "right";
} else if (speed<0) {
dir = "left";
}
if (dir == "right" && !_root.leftblock.hitTest(this._x+20, this._y, true)) {
_root.score._x += speed;
this._x += speed;
_root._x -= speed;
}
if (dir == "left" && !_root.rightblock.hitTest(this._x-20, this._y, true)) {
_root.score._x += speed;
this._x += speed;
_root._x -= speed;
}
if (Key.isDown(Key.LEFT)) {
if (speed>-maxmove) {
speed--;
}
this.gotoAndPlay("run");
this._xscale = -100;
} else if (Key.isDown(Key.RIGHT)) {
if (speed<maxmove) {
speed++;
}
this._xscale = 100;
this.gotoAndStop("run");
} else if (speed<1 && speed>-1) {
speed = 0;
this.gotoAndStop("idle");
}
if (Key.isDown(Key.SPACE) && !jumping) {
jumping = true;
}
if (jumping) {
this.gotoAndStop("jump");
this._y -= jump;
jump -= .5;
if (jump<0) {
falling = true;
}
if (jump<-15) {
jump = -15;
}
}
if (_root.ground.hitTest(this._x, this._y, true) && falling) {
jump = 12;
jumping = false;
falling = false;
}
}
}

```
