# Help me make Mario like game

**URL:** <https://forum.kirupa.com/t/help-me-make-mario-like-game/63819>\
**Category:** programming\
**Created:** [September 10, 2004, 8:13am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819 "2004-09-10T08:13:46Z")\
**Posts on this page:** 16\
**Page:** 5

<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:** [September 20, 2004, 9:20pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/81 "2004-09-20T21:20:58Z")

</div>

> [@Splash](#):
>
> mx pro?

No, Mx ed.

---

<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:** [September 20, 2004, 11:30pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/82 "2004-09-20T23:30:14Z")

</div>

not a bad idea i guess!!

---

<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:** [September 20, 2004, 11:32pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/83 "2004-09-20T23:32:17Z")

</div>

and btw what about scrolling? i’m losing my patience… just kidding!!! i have always wanted to create a game like mario, and with ur help and some free time i maybe will!! goota go now but will be checking for the scrolling tut!!

---

<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:** [September 21, 2004, 1:56am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/84 "2004-09-21T01:56:11Z")

</div>

Sorry about the scrolling! I am very busy… School, Fencing, Piano, Spanish, Flash Projects,… blah.

---

<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:** [September 21, 2004, 3:16am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/85 "2004-09-21T03:16:16Z")

</div>

Now for the scrolling! This is our final step in the art based platform tutorial! Ok, First of all, we need the code to go where? The “Char”, or “mario” in this case. So, we select mario and open his actions panel. Please type the following:

```php

onClipEvent (enterFrame) {
 if (Key.isDown(Key.RIGHT)) {
  if (_root.mario._x>=300 //or whatever you decide to set for his positions//) {
   scroll = 5;
//setting his scrolling speed//
   xspeed = 0;
//ceasing his movement//
   this._x += 5;
   _root._x -= scroll;
   _root.score._x += scroll;
//notice "this", and "score", have different _x movement than "_root", that is because we dont want to make mario and the score scroll left and right :P//
  } else {
   xspeed = 5;
  }
 } else if (Key.isDown(Key.LEFT)) {
  if (_root.mario._x<=100 //or whatever you decide to set for his positions//) {
   scroll = 5;
   xspeed = 0;
   this._x -= 5;
   _root._x += scroll;
   _root.score._x -= scroll;
  } else {
   xspeed = 5;
  }
 }
}

 

```

This is the code that I recently came up with, and I hope that it help you :). If you have any questions, remember, I’m just a click away! Later!

peace.

---

<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:** [September 22, 2004, 5:24am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/86 "2004-09-22T05:24:10Z")

</div>

I dont get it… how do I add the scrolling script to my mario’s script

```php
 onClipEvent (load) {
 gravity = 10;
 scale = _xscale;
 walkSpeed = 6;
 maxjump = 6;
}
onClipEvent (enterFrame) {
 if (air == true) {
 _y += gravity;
 state = 6;
 }
 if (Key.isDown(Key.LEFT) && !_root.leftbound.hitTest(_x, _y, true)) {
 _x -= walkSpeed;
 _xscale = -scale;
 }
 if (Key.isDown(Key.RIGHT) && !_root.rightbound.hitTest(_x, _y, true)) {
 _x += walkSpeed;
 _xscale = scale;
 }
 if (_root.platforms.hitTest(_x, _y, true)) {
 air = false;
 } else {
 air = true;
 }
 if (Key.isDown(Key.SPACE) && jump == true) {
 _y -= jumpSpeed;
 }
 if (air == false) {
 jump = true;
 jumpcount = 0;
 jumpSpeed = 19;
 }
 if (Key.isDown(Key.SPACE)) {
 jumpcount += 1;
 }
 if (jumpcount> maxjump && jumpSpeed> -2) {
 jumpSpeed -= 2;
 }
 if (air == false && !Key.isDown(Key.LEFT) && !Key.isDown(65) && _currentframe <4 or air == false && !Key.isDown(Key.RIGHT) && !Key.isDown(65) && _currentframe <4) {
 state = 1;
 }
 if (Key.isDown(Key.LEFT) && air == false && !Key.isDown(65) && _currentframe <4 or Key.isDown(Key.RIGHT) && air == false && !Key.isDown(65) && _currentframe <4) {
 state = 2;
 }
 if (!Key.isDown(65)) {
 gotoAndStop(state);
 }
 _root.statetxt = state;
}
onClipEvent (keyUp) {
 if (Key.getCode() == 83) {
 jump = false;
 }
}
 

```

---

<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:** [September 22, 2004, 1:09pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/87 "2004-09-22T13:09:28Z")

</div>

Well, you add the code right after the:

```php

onClipEvent (keyUp) {
if (Key.getCode() == 83) {
jump = false;
}
} 

```

---

<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:** [September 22, 2004, 1:57pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/88 "2004-09-22T13:57:02Z")

</div>

> [@joMan](#):
>
> Well, you add the code right after the:
> 
> ```php
> 
> onClipEvent (keyUp) {
> if (Key.getCode() == 83) {
> jump = false;
> }
> } 
> 
> ```

i wont work it just stats looping jump

---

<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:** [September 22, 2004, 3:43pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/89 "2004-09-22T15:43:09Z")

</div>

Hmm, that’s iteresting… could you show me how you are using the code please?

---

<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:** [September 22, 2004, 4:17pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/90 "2004-09-22T16:17:09Z")

</div>

As to the previous question…

If any of you remember “Faxanadu” for the NES, I’m making a flash clone called “NeoFax”, It’s hard stuff… The game is tilebased and a sidescroller so i thought we could learn a few things.

---

<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:** [September 22, 2004, 4:51pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/91 "2004-09-22T16:51:57Z")

</div>

> [@cheesy\_x](#):
>
> As to the previous question…
> 
> If any of you remember “Faxanadu” for the NES, I’m making a flash clone called “NeoFax”, It’s hard stuff… The game is tilebased and a sidescroller so i thought we could learn a few things.

I dont know the first thing about tile based.

---

<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:** [September 23, 2004, 1:27am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/92 "2004-09-23T01:27:36Z")

</div>

How far along r u in making the neofax game? or haven’t u started yet?

---

<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:** [September 23, 2004, 1:51am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/93 "2004-09-23T01:51:46Z")

</div>

> [@Dr Warm](#):
>
> How far along r u in making the neofax game? or haven’t u started yet?

It’s essentially conceptual, I ran into too many problems tring to construct a working version of Neofax

---

<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:** [September 23, 2004, 6:51am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/94 "2004-09-23T06:51:10Z")

</div>

> It’s essentially conceptual, I ran into too many problems tring to construct a working version of Neofax  
> but u at least started it? and u want to make it a side scroller with a tile base, ok does this game jump cause that immediately means i can’t tell u how to do it.  
> I’m thinking that i should make a basic tile based side scroller like mario, and just hand people the source for it, then they can sort of see what to do and at least they’ll have a start. but i’ll have to do it probably when my exams are finished, and thats about a month away.  
> PS sorry for stealing jomans mario tute

---

<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:** [October 3, 2004, 12:06pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/95 "2004-10-03T12:06:54Z")

</div>

Sorry to revive this thread (even though it is good), but i remembered someone asking about a side scrolling mario with tiles, and i had a spare 10 mins so here it is, just taken different bits of code from all tonypas and hold shift to make him faster

---

<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:** [October 3, 2004, 2:53pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/96 "2004-10-03T14:53:41Z")

</div>

thanx … for the tile scroll

[Previous page](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819.md?page=4)
