Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Bouncing Block

Author
Message
RadiusOFT
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Aloha, OR(egon)
Posted: 6th Jun 2008 22:41
I'm working on a little platformer project similar to Mario Bros. and I can't seem to get boxes to bounce correctly when I jump into them.

Heres what I'm using to check the collision above my character:



And heres the code I'm using for the hopping:



Now I realize my problem lies within the fact that variable TC is constantly changing, making it impossible to use TC for the Object Id. So my question is how can I save the value of the object that I'm colliding with so that I can keep the block moving?

Thanks Everyone,
Radi

Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 6th Jun 2008 23:23
Exactly how you said, just save the variable, either in another variable or in an array if you many blocks can "hop" at once.

Try something like this:



Sorry its a bit messy i just typed it in browser

Login to post a reply

Server time is: 2024-09-27 16:30:09
Your offset time is: 2024-09-27 16:30:09