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 / Collision zones for ramps in platform game?

Author
Message
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 29th May 2004 00:56
Hey all,

I wondered if anyone could help. I've been following Scouseknight's excellent tutorial on platform agme collision and i have come to a problem. I have some ramps in my game and i want the player to be able to run up and down it. I have been using collision zones for the other platforms, ladders etc but i don't know if this is possible for a ramp. All my platforms are on 1 big .png file.

Any help would be apreciated,

Cheers Mike


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 29th May 2004 09:55
Are you making a 3D game?

If so, you can use our collision plugin. It is totaly geared for complex collisions against models. Stairs and ramps are handled easily.

Our site is at: http://www.nuclearglory.com

What platform are you using? DBC or DBP?

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 29th May 2004 12:59 Edited at: 30th May 2004 12:30
No Sorry i forgot to mention this is in 2D and this is being coded in DBP.


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 31st May 2004 12:17
I was thinking of doing little 2 * 2 pixel blocks and staggering them up and down the ramp. When you are walking down the ramp then the gravity pulls you down but when you walk up the ramp it pushes you up. I don't know if that would work so i thought i'd ask you guys.

Cheers


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Chaos
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 1st Jun 2004 16:39 Edited at: 1st Jun 2004 18:40
Hey Code Monkey.

I had a look at the tutorial and it seems a bit messy for ramp collsion. Ramps require either pre-calculated height jumps using trig or real time calculations using triganomety unless all tiles are the same width and height in witch case the distance you are into the tile will equal you characters height on the ramp


Chaos


[center] New Project announcment coming soon[center]
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 2nd Jun 2004 11:13
Ouch. It sounds complicated. Could you explain that a little more please.

Cheers,

Michael


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Chaos
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 2nd Jun 2004 13:00
it pretty simple.

If you know how long and high the ramp is you can wrk out how far you should be up the ramp if you know how far you are into the ramp.

Chaos


[center] New Project announcment coming soon[center]
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 2nd Jun 2004 13:40
Well, ye can do this:



Thats just a basic way to calculate the new height.

Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 3rd Jun 2004 12:14
Hey thanks for your help guys. I'm pretty sure i know how to do it now. I'm going to try chaos' method using the trigonometry. Just to check. Does your method involve doing a calculation to see if the playerx position = whatever then the playery position should = so and so. If they do then you stop the gravity from pulling the player down. But if they don't then you pull the player down until it reaches the ramp.

Thanks for your help,

Cheers Mike


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 10th Jun 2004 21:49
Hey all. I've had a bash at coding the ramp collision using trigonometry and here is the code i am using.



The 164 + bit is how many pixels the player has to move to get to the ramp. However in a paint package it is 427. If anyone needs the image then i can send it to them. I need help getting this code to work though because no matter what i try i can't seem to do it.

Any help would be greatly apreciated,

Mike

PS The full source is at the bottom


Visit the Code Monkey's website at http://www.codemonkeystudios.tk
Blue Shadow
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 12th Jun 2004 14:14
Anyone have any ideas?


Visit the Code Monkey's website at http://www.codemonkeystudios.tk

Login to post a reply

Server time is: 2024-09-22 12:44:43
Your offset time is: 2024-09-22 12:44:43