Whats wrong with mario?

I am having trouble with my characters (marios) ground landing. If mario jumps on to a higher platform, he goes into the ground. And if mario jumps down onto the ground, he will either land above the ground, or in it. I would be very grateful if someone could help me out. Thanks in advance.

peace

P.S. I will need your email so that I can send the fla to you.

actaully i know exactly what ur problem is.

email me ur fla first.

pathideout@hotmail.com

ur problem i am assuming is that u put mario probably in the middle of the little cartecian plain ( x/y axis)

u have to mario above it, over the x axis.

just send it to me and i’ll fix u up if i can

Ok, I sent it :).

i havnt got it yet

The email didnt get to you didnt get to you. Here, I made a smaller one so as to fit it on kirupa.

hmmm… iim seeing it and i think u may have to make sperate hittests…

im not sure… ill try doing it myself…

ps: ur doing a mario game 2… me 2!!!

its in early stages but i working on it.!!

hmmm im not sure wat to ddo though… where did u get the script… or did u write it urself?

Well, the jumping and ground hitTest was actually ment to help someone else, but I also found it and taught it to myself. By the way, nice game ;). You used the “Super Mario All Stars” mario :smiley: (ahhhh… Nastalga!). Do you think you could teach me a good hitTest? ( I Badly need one ).

lol… i’ll see wat i can do…

i made my own but it isnt as good as this one… mines basic and i dun really like it…

// hero hitTest
function sideTopHitTest() {
for (i=0; i<1; i++) {
// Hero Side hitTests
// Left
if (ps.hitTest(h._x+x+hb.xmin, h._y+y+(hb.ymin), true) || ps.hitTest(h._x+x+hb.xmin, h._y+y-10, true) || ps.hitTest(h._x+x+hb.xmin, h._y+y-20, true) || ps.hitTest(h._x+x+hb.xmin, h._y+y-30, true) || ps.hitTest(h._x+x+hb.xmin, h._y+y+(hb.ymax-buffer), true)) {
h._x += xSpeed;
}
// Right
if (ps.hitTest(h._x+x+hb.xmax, h._y+y+(hb.ymin), true) || ps.hitTest(h._x+x+hb.xmax, h._y+y-10, true) || ps.hitTest(h._x+x+hb.xmax, h._y+y-20, true) || ps.hitTest(h._x+x+hb.xmax, h._y+y-30, true) || ps.hitTest(h._x+x+hb.xmax, h._y+y+(hb.ymax-buffer), true)) {
h._x -= xSpeed;
}
// Hero Top hitTest
if (ps.hitTest(h._x+x+(hb.xmin+1), h._y+y+(hb.ymin-2), true) || ps.hitTest(h._x+x+(hb.xmax-1), h._y+y+(hb.ymin-2), true)) {
velY = 4;
xSpeed = -.2;
}
// Boundaries
if (h._x-(h._width/2) <= 0) {
h._x = h._width/2;
} else if (h._x+(h._width/2) >= 450) {
h._x = 450-(h._width/2);
}
}
}

best hittest… from leights turtorial…

best one ive found i think

Oh! I saw that one in an fla source. I tried that one. didnt work for me (it got really wierd).

really…

hmm well theeres a few turtorials by leight… i prefer her old versions… better hittest.

Tutorials, eh? Do you know where?

http://www.actionscripts.org/showMovie.php?id=514

http://www.flashkit.com/board/showt...threadid=130126

http://www.flashkit.com/board/showt...atform+tutorial
http://www.flashkit.com/tutorials/G…-1052/index.php
http://www.freewebs.com/savco/site.htm
http://www.edmack.com/flash/
http://www.edmack.com/flash_tutorials/
http://www.hot.ee/tonypa/flash/flas/
http://www.the-stickman.com/tutoria...ellaneous.shtml
http://www.flashkit.com/board/showt...atform+tutorial
http://www22.brinkster.com/hamzaf/experiments.html
http://www.geocities.com/thefastfiles/

hitTest -

http://www.flashkit.com/board/showt...20&pagenumber=1

AI - http://www.kirupaforum.com/forums/s…&threadid=16649

skribble or someone posted it a while back and i saved it as i figured i would once need it.

i dun know if they all work… but im sure some are bound 2…

O as well goto

http://www.gotoandplay.it/_articles/2003/12/scrolling_upd.php

on the bottom left tehre is a list of stuff that include platform game open Fla’s/
check it out

http://www.gotoandplay.it/_articles/2003/12/scrolling_upd.php

sorry it got cut off.

Thank you for the tutorials and your help, patricktheking :beam:! You will be credited in my game’s credits :).

Thats alright :thumb:.

the easiest thing to do is:
when mario hits the ground, set mario’s _y property to equal that of the ground. you may need to subtract _height from the _y property of the ground - it all depends on the registration points.

Hmmm, I didnt know you could do that with a hitTest.