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 Discussion / walking up stairs...

Author
Message
QuothTheRaven
17
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Oct 2002 02:25
I had a really good idea for stairs for my game, where each individual step would be a box with sliding collision implimted. The basic idea is that when you collide with the stair, it adds the height of the box to your current y height and determines if it's too high to step onto. But since that would be a box for each step, that would require hundreds of objects to make a level.

the character collision is get object collision(11,0). How can I determine the number of the object it is colliding with? I cant test for each object cause that would lag the game like nobody's grandma. so what code would find the number of the box/cone/cylinder its colliding with?
Shadow Robert
17
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 13th Oct 2002 03:27
perhaps setup an array... as you shouldn't have a ridculous amount of objects should be simple enough.



i mean you could actually just set this all up to check over the array of objects rather than using the array as a global, however this shouldn't slow the code by much.

Holy jumping mother of god NOOOO!!!...
QuothTheRaven
17
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Oct 2002 03:49
that code would be really really really uncontrollably terrible. first of, it would place all 100 boxes in the same position, you'd have to place each one by hand.

And for each loop you'd be checking for ONE HUNDRED COLLISIONS PER LOOP!!!11!! Checking TEN collisions in a loop literally cuts the frames per second down to 1/3 of normal. Checking for 100...the game would be utterly unplayable. Object collision(x,0) checks if only 1 object is colliding, and works very quickly. That code is 100 manual checks, which would take forever. It simply wouldn't work!
QuothTheRaven
17
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Oct 2002 23:37
can no one tell me how to find the number of the object it is colliding with?
Zep
17
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 14th Oct 2002 02:47
OBJECT COLLISION
This command will return a one if the two specified 3D objects are overlapping. If
the second object number is set to zero, the number of the object overlapping
with the first object will be returned as an integer value.


so, if you have
x=object collision(11,0)

and you hit object 30
x would = 30

Zep--

QuothTheRaven
17
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 14th Oct 2002 04:48
really? you're kidding me, it's that easy?

can I make sweet sweet panda love to you?
MiRRoRMaN
17
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 15th Oct 2002 03:21
[offtopic]
LOL @ QuothTheRaven

Btw, what IS considered Panda love?
[/offtopic]

[ontopic]
Most of the time the easiest pieces of code are the easiest solution.
[/ontopic]

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.

Login to post a reply

Server time is: 2020-08-13 19:06:56
Your offset time is: 2020-08-13 19:06:56