n00b question... Jumping

Timbuk2
01-04-2006, 06:40 AM
Ok, this is hard to explain but here it goes....

I was following noi_max's tutorial on movement and jumping, found here (http://www.xtremevbtalk.com/showthread.php?t=177598).
Now I know that but I am making a small game, based on that code. It is a super Mario side scrolling game, except its not Super Mario, but the same type of game, where you jump up on boxes and then it stops. Now following the tutorial, I have set the Integer StartPoint as the original place where the picturebox started. But if the jump comes down on top of a "box" that is floating in the air, I want it to stop there. I have tried to do this by setting StartPoint to the top of the box. It works but when you walk off the box it still stays on the level of the floating box, as if "Mario" was walking on the air!!

None of you probably got that so I attached a picture of what I want...

If you are still lost I will post some code!!!!

Thanks in advance because I know people are so good at answering here

Iceplug
01-04-2006, 05:25 PM
http://iceplug.vwebservices.com/cnpf6.htm
Unfortunately, my website seems to be down, but I have discussed how to jump onto, jump off, and walk off of platforms.

Put simply, you have to check if the bottom of Mario crosses the top threshold of the platform and check if Mario is landing at any position (left-right) that is actually ON the platform. :)

Timbuk2
01-04-2006, 05:28 PM
I will have a look at your website when it is back up because it indeed sounds very helpful!! :)

Timbuk2
01-05-2006, 04:12 AM
http://iceplug.vwebservices.com/cnpf6.htm
Unfortunately, my website seems to be down, but I have discussed how to jump onto, jump off, and walk off of platforms.

Put simply, you have to check if the bottom of Mario crosses the top threshold of the platform and check if Mario is landing at any position (left-right) that is actually ON the platform. :)
Well you see, this is what I have so far. When he has landed on the platform, and then leaves the vicinity of the platform, StartPoint resets itself back to 299 (the original one, down on the ground). So I have it working, but only if you jump off the platform. It doesn't work if you just simply walk off, because the higher horizon of the platform seems to be where he stays, you have to jump off. Your website is still down but I will look at it when it is up..

blastoboy1000
01-05-2006, 05:45 AM
Maybe you could add an If statement to the walk loop that looks something like this:

'if...then statement about walking above
'you could just check the .Left properties of the object in question and of the platform
if StartPoint <> 299 then
StartPoint = 299
Exit Sub
end if


hope this helps

Iceplug
01-05-2006, 06:59 PM
When the player walks off of the platform, you have to give it an initial velocity of 0, so that the player actually falls off of the platform. I don't know exactly how you are doing your jump, but I'm uneasy about your requiring a StartPoint.
To check if the player walks off the platform, simply check if Player.Right < Platform.Left or if Player.Left > Platform.Right
You can also add initial horizontal velocities for this case. :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum