# K... is this way any good... or should I use another

**URL:** https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237
**Category:** programming
**Created:** [August 26, 2004, 4:06am UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237 "2004-08-26T04:06:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![patricktheking](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@patricktheking](https://forum.kirupa.com/u/patricktheking)
#### Post date: [August 26, 2004, 4:06am UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/1 "2004-08-26T04:06:18Z")

</div>

K im making a super mario game right and i’m working on the bad guys right now…

currently ill give them a predefined path and if mario walks into them or something he’ll either shrink or die, depending on his size.

anywayz… currently i was thinking of having a little line on the head of each of the bad guys and if mario touched it… the goomba’s would die…

ex of what i would put on the line of the mc on each bad guy

onClipEvent (enterFrame) {  
if (mario.hitTest(\_root.badguy1.hitter)) {  
\_root.mario.\_y += 6;  
}  
if (mario.hitTest(\_root.badguy1.hitter)) {  
\_root.badguy1.hitter.gotoAndPlay(“goombadead”);  
}  
}

this is what i am gonna do now… but i know theres gotta be a better way… any suggestions

---

<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: [August 26, 2004, 6:02pm UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/2 "2004-08-26T18:02:40Z")

</div>

how about testing if mario hits them and he is at a certain hieght?

if(mario.\_y == goomba.\_y-goombas hieght){  
goomba dies  
} else {  
mario dies  
}  
}

theory should work i guess. I dunno. just a thought

---

<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: [August 26, 2004, 7:34pm UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/3 "2004-08-26T19:34:01Z")

</div>

Hey ur ideas good…

just one question…

K ur first line , does it meen that if mario is above the goomba, the goomba dies (same y intercept) …?

---

<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: [August 27, 2004, 12:18am UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/4 "2004-08-27T00:18:35Z")

</div>

onClipEvent (enterFrame) {  
if (mario.hitTest(\_root.badguy1.hitter)) {  
\_root.mario.\_y += 6;  
\_root.badguy1.hitter.gotoAndPlay(“goombadead”);  
}  
}

You mean THIS?

---

<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: [August 27, 2004, 4:18am UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/5 "2004-08-27T04:18:05Z")

</div>

ya… ops forgot u could put it in…

lol my way still works but prob harder for AC…

thanks

---

<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: [August 27, 2004, 8:40am UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/6 "2004-08-27T08:40:45Z")

</div>

> [@Skribble](#):
>
> how about testing if mario hits them and he is at a certain hieght?
> 
> if(mario.\_y == goomba.\_y-goombas hieght){  
> goomba dies  
> } else {  
> mario dies  
> }  
> }
> 
> theory should work i guess. I dunno. just a thought

So you’re basically saying that if mario isnt alligned on the Y axis with the goomba, he’ll die? That wont work. :hr:

Chen is right.

However… You won’t be able to put that code on EACH bad guy in the game for obvious reasons. :tb:

:pirate3:

---

<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: [August 27, 2004, 4:20pm UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/7 "2004-08-27T16:20:36Z")

</div>

no i put that if mario jumps on the top of the guy where the hittest is he’ll do a lil bounce…

---

<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: [August 27, 2004, 4:23pm UTC](https://forum.kirupa.com/t/k-is-this-way-any-good-or-should-i-use-another/62237/8 "2004-08-27T16:23:07Z")

</div>

that is what my brother is trying to say, that when u jump on the goomba mario will doa lil bounce just like in the game…

ya chen urs is the one that is right

onClipEvent (enterFrame) {  
if (mario.hitTest(\_root.badguy1.hitter)) {  
\_root.mario.\_y += 6;  
\_root.badguy1.hitter.gotoAndPlay(“goombadead”);  
}  
}

i’ll tell my bro to check the forums so he may see the code
