# 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:** 20\
**Page:** 2

<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 10, 2004, 9:45pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/21 "2004-09-10T21:45:29Z")

</div>

Hmmm, I dont know,… Maybe try:

```php

if (_root.goomba.hitTest(this.jump)) {
    if (maxjump<=10) {
        _root.goomba.gotoAndPlay("dead");
        _root.goomba.xspeed = 0;
        _root.counter.play();
        jumpSpeed = 10; 
    }
}

```

if that doesnt work, tell me.

---

<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 11, 2004, 4:01am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/22 "2004-09-11T04:01:51Z")

</div>

Now, we need a key releasing code so that mario won’t run all of the time :). So, here is what we do. First we select mario (of course), then we type:

```php

onClipEvent (keyUp) {
	 if (move) {
//again, we have "move" to determine if the movement is happenning//
		  if (Key.getCode() == Key.RIGHT) {
//now the getCode(), reffers back to the keyUp//
			  this.gotoAndStop("idle");
//this is what commands mario to go back to the standing position, or motionless frame//
	 }
	 if (Key.getCode() == Key.LEFT) {
		 this.gotoAndStop("idle");
	 }
	 if (Key.getCode() == Key.DOWN) {
		 this.gotoAndStop("idle");
		 xspeed = 5;
//remember, xspeed, if the "down" key is pressed, will drop to 0, so we need the "xspeed = 5" under this if statement, so as to allow movement once again after key release//
		}
	}
}

```

please reply if you have read this. More comin…

---

<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 11, 2004, 8:16am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/23 "2004-09-11T08:16:52Z")

</div>

Aww… it wont work. Hey maybe if you tell how to make the goomba

---

<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 11, 2004, 8:58am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/24 "2004-09-11T08:58:50Z")

</div>

i dont get it what u mean with those “idle” and stuff??

---

<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 11, 2004, 9:00am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/25 "2004-09-11T09:00:48Z")

</div>

> [@kurez](#):
>
> i dont get it what u mean with those “idle” and stuff??

Well in your mario symbol make frames where he dies jumps runs is idle = normal  
and name them as so. In frames properties there is frame label \<FRAME label\>in that you write it

---

<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 11, 2004, 9:25am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/26 "2004-09-11T09:25:46Z")

</div>

> [@FlashNewbi3](#):
>
> Well in your mario symbol make frames where he dies jumps runs is idle = normal  
> and name them as so. In frames properties there is frame label \<FRAME label\>in that you write it

so i should go into edit and make 1 frame of each? and do i need a specific name for them??

---

<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 11, 2004, 9:49am UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/27 "2004-09-11T09:49:10Z")

</div>

> [@kurez](#):
>
> so i should go into edit and make 1 frame of each? and do i need a specific name for them??

umm… yes.

---

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

</div>

joMan,

I have a quick question about your ground hitTest. Could you explain the reason for the !. if ([color=red]![/color]\_root.ground.hitTest(this… I would really appreciate it. Good job on the thread bythe way!

---

<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 11, 2004, 1:50pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/29 "2004-09-11T13:50:27Z")

</div>

what names do i need for the frames??

---

<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 11, 2004, 2:03pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/30 "2004-09-11T14:03:28Z")

</div>

Oh, sorry that I wasnt here last night, I was at AVP, Alien Vs Preditor :). Ok now to answer your questions one by one. First, flashnewbie3, to make a goomba, we draw (or import) the goomba, then we create the sequences for the goomba, but the goombas animations are going to be put together a little different then the others (I have an attachment on the bottom that shows the goombas animation). Now, lets move on to the code, so select the action panel, and type:

```php

onClipEvent (load) {
	 xspeed = 2;
	 started = true;
//AHA! there's started again! remember, the "started" controls the games action for the mcs moved on screen//
	 _root.counter.stop();
//As I have explained in the other thread, the "_root.counter.stop()" is for something later//
	 b = this.getBounds(this);
//now, this will be an important part of the collision detection farther on in the goombas action//
}

```

Alright, not to hard so far, right? Then let’s continue. So now we need his movement code, so we type:

```php

onClipEvent (enterFrame) {
	 if (started) {
		 if (this._xscale == 100) {
			 _root.counter._x -= xspeed;
			 this._x -= xspeed;
		 }
		 if (this._xscale == -100) {
			 _root.counter._x += xspeed;
			 this._x += xspeed;
		 }
	 }
//continued...//

```

And yet again, started was there. Now we need some ground, and wall code, so lets type the following:

```php

	 if (_root.ground.hitTest(_x+x+b.xmin+5, _y+y+b.ymin+5, true)) {
		 this._xscale = -100;
	 }
	 if (_root.ground.hitTest(_x+x+b.xmax-5, _y+y+b.ymin+5, true)) {
		 this._xscale = 100;
	 }
	 if (!_root.ground.hitTest(this._x, this._y+15, true) && !walking) {
		 fall += 1;
	 if (fall>5) {
		 fall = 5;
	 }
	 this._y += fall;
}
}

```

If you have any more questions, feel free to ask :). Here is the attachment I promised:

---

<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 11, 2004, 2:11pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/31 "2004-09-11T14:11:47Z")

</div>

> [@kurez](#):
>
> i dont get it what u mean with those “idle” and stuff??

Well, You always have a standing frame, right? Then what we want to do is name it “idle”, because the word “idle” is smaller than the word “stand”, and it meens “not moving, stationary”.

here is an example:

---

<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 11, 2004, 2:21pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/32 "2004-09-11T14:21:47Z")

</div>

> [@OnionSkin](#):
>
> joMan,
> 
> I have a quick question about your ground hitTest. Could you explain the reason for the !. if ([color=red]![/color]\_root.ground.hitTest(this… I would really appreciate it. Good job on the thread bythe way!

Well, when I put the exclamation point before the code, it simply means that he is not performing whatever comes after that. Example:

```php
 if (!_root.ground.hitTest(this........ //he is not touching the ground// 

```

```php
 if (_root.ground.hitTest(this........ //he is touching the ground//

```

This is what I use for the falling code.

P.S.

> Good job on the thread bythe way!  
> thanks :D.

---

<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 11, 2004, 2:27pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/33 "2004-09-11T14:27:14Z")

</div>

> [@kurez](#):
>
> what names do i need for the frames??

Well, you name them whatever you want, but if it were me, I like to keep it simple, so I suggest these names:

1. idle - for when mario is just standing.
2. walk - for when mario is walking.
3. duck - for when mario is ducking.
4. jump - this one is used for both the jumping and the falling.
5. die - for when mario is killed.

hope that helps ya :).

---

<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 11, 2004, 2:32pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/34 "2004-09-11T14:32:33Z")

</div>

I wont be here at 10:00 through 1:00 cause I have fencing class…

ENGARDE!  
 ![](http://www.magnesium.net/~sez/fencing/capt.olympics_sui_kor_hjp.jpg)

---

<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 11, 2004, 2:46pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/35 "2004-09-11T14:46:30Z")

</div>

i get this error all the time i have made mario a coin and the score thing

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 10: Operator ‘=’ must be followed by an operand  
}  
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 5: Statement block must be terminated by '}'  
for (i=2; i\<=numCoin; i++) {

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 11: Syntax error.

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement block must be terminated by '}'  
onClipEvent (load) {

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 11: Syntax error.

Total ActionScript Errors: 5 Reported Errors: 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 11, 2004, 2:52pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/36 "2004-09-11T14:52:43Z")

</div>

Hmmm, send me your fla so I can take a look at the problem.

---

<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 11, 2004, 3:04pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/37 "2004-09-11T15:04:28Z")

</div>

here it is

---

<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 11, 2004, 3:31pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/38 "2004-09-11T15:31:27Z")

</div>

Umm could you modify that goomba script. I have leftbound (left wall) rightbound (right wall) and platforms (ground)

---

<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 11, 2004, 3:34pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/39 "2004-09-11T15:34:49Z")

</div>

> [@FlashNewbi3](#):
>
> Umm could you modify that goomba script. I have leftbound (left wall) rightbound (right wall) and platforms (ground)

i dont get it…:-/ i suck at flash…could you send me yours?

---

<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 11, 2004, 3:46pm UTC](https://forum.kirupa.com/t/help-me-make-mario-like-game/63819/40 "2004-09-11T15:46:09Z")

</div>

> [@kurez](#):
>
> i dont get it…:-/ i suck at flash…could you send me yours?

That was 4 joMan but ill send my 🙂 But I have different scripts what joMan has

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

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