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.

DarkBASIC Professional Discussion / How do you make stairs? (change in elevation)

Author
Message
Disrupter52
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 24th Aug 2011 17:25
Ok so if i make a 3d model of stairs, how can i use it as such in DBPro? I want to be able to walk up and down stairs to go from floor to floor in a building.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 24th Aug 2011 20:52
Well I think if you download Sparky's collision, there is a stairs demo.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Aug 2011 02:04
You can find an example I upload to this thread. Collision are basic, but you can go up and down stairs.

http://forum.thegamecreators.com/?m=forum_view&t=188034&b=7


Cheers.

I'm not a grumpy grandpa
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th Aug 2011 03:12
The basic theory is, when collision occurs, but before the video sync, you move the player's collision object upwards on its Y axis by the height of each stair. You then check to see if collision still occurs, if it does, move the object back down again, apply the collision constraints and then perform the video sync. If there is no collision once the collision object is moved up, then do NOT apply the collision constraints and allow the character to move forward while leaving the collision object a little higher than before.

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Disrupter52
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 31st Aug 2011 04:40


This bit of your code, from what i can gather, governs your collisions and the ramp. In the "if object collision(jugad,0)" bit, im taking it that the 0 is the ramp? So then, when the collision is positive (greater than 1) it does the gossub for both xxol and zzol and then sets x# and z# as oldx# and oldz# respectively.

What exactly does that do? I get that its testing the collision, but what do the gosubs do?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Aug 2011 04:44
We check in every collision to slide in x or z .

cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-11 10:26:19
Your offset time is: 2026-07-11 10:26:19