Mar 29
Welcome back, At the end of the last tutorial i wondered what would happen if we had a platform that you could jump underneath from.
As you can see, i have made the map a lot more complicated, and the simulation runs quite accurately until you go under the overhang on the left side. Where you can jump through the bottom of that platform. Lets change that.
We need to add a hit detection for when the top of the character hits the bottom of the land.
Ok, now you can’t jump up through platform bottoms, but if you jump sideways into the hovering platform, you float down.
I will think on this matter for the next step in the tutorial.



April 1st, 2008 at 9:57 pm
This is really cool. I’m looking forward to seeing this go further with collectibles and levels.
Thank you!
- Josh
April 4th, 2008 at 1:13 am
why not give the character a hitbox, rather than make arts of him/it collision detecting?
April 4th, 2008 at 8:12 pm
What do you mean william? i’m sorry, i don’t understand what you’re saying.
April 6th, 2008 at 10:06 pm
I love your blog. Very nice tutorials.
Looking forward to more.
August 27th, 2008 at 2:11 pm
Coolio! I looked at your other site and commented. Cool new site. Im looking forward to the ape tutorial remember!
September 28th, 2008 at 8:17 pm
So uhh. Where’s the code example of the collision detection on the bottom? I cant figure it out myself. Pls help man. Your tutorials are great btw.
September 28th, 2008 at 9:55 pm
It will be out shortly, i am currently working on some server side script which is taking up a lot of my free time. I will get this done soon.
September 28th, 2008 at 10:04 pm
Great, thanks a lot bud!
September 28th, 2008 at 10:06 pm
Actually, I have a somewhat ghetto-rigged way of handling this… Hoping it’s something like what you’re doing:
if (bg.hitTestPoint(block.nextx, block.nexty – (block.height / 2), true)) {
velocity = Math.abs(velocity);
}
bg is my background clip with ground and obstacles in it.
September 29th, 2008 at 6:49 am
i think that is virtually how my code went, but i have 2 hittests, one for each corner of the box. when a hit is detected i just set the velocity to 0. I have lost the original files, so i will have to rebuild it.
October 21st, 2008 at 11:55 pm
hey this is a great tutorial. So how can I make the box jump faster?
October 22nd, 2008 at 5:37 pm
just change the”velocity = -5″ to a lower number.
if (attemptJump==true) {
char.y–;
velocity =-10;
}
June 7th, 2009 at 2:29 pm
This is THE TUTORIAL!
Over the internet there are only tutorials for this kind of game in AS2.0
And u explain really good!
Where is the code of the step #5 and the explanation? I cant find?
And have u already released the correction for not lifting within the walls ?
I am looking forward to that!
CONGRATS!!!
June 8th, 2009 at 5:11 pm
I never got round to putting the code up on the site because of the floating glitch. I am currently busy with other projects but i will fix the code as soon as i can!
Check out some of the other tutorials while your waiting
July 10th, 2009 at 3:31 am
Can some one give me a link to part 1 I can not seem to find it. Thanks
July 10th, 2009 at 4:13 am
nevermind I found it
September 10th, 2009 at 9:54 am
hi there, I was wondering of you had managed to fix the going through platform bottoms bug? I have created some floating platforms and my guy goes through the bottom of them.
Thanks!
Andy (moogle001)