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 / Collisions, on an angle.

Author
Message
mit45
15
Years of Service
User Offline
Joined: 28th Apr 2011
Location:
Posted: 29th Apr 2011 07:12
Im making a came where the player controls a cylinder, that moves and collects things, its a platformer, the can movement and collision detection controlls are already in place. so I vecreated a box ( one of the platforms ) that is 9000 long, 2000 wide, and 100 tall ( the collision box is, -1000,-4500,-50,1000,4500,50). Ive also created and understand all there is for it's collision box. The only problem is I want to now rotate the object along the x axis, the object rotated as it should, but the collision box stays in the same place. So it's just like An invisible box there, when moved the cylinder acts as if the box never rotated and will go through the now rotated box along the static collision box. So my question, is how do I make this can go up the inclined box, not through it? Any help is appreciated.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Apr 2011 15:11
To rotate the collision box with the object, you need to use:

make object collision box -1000,-4500,-50,1000,4500,50,1

However, I don't know how to check for collision then... If I were you, I'd check out sparky's collision plugin : http://forum.thegamecreators.com/?m=forum_view&t=74762&b=5

It is a little hard to understand at first, but once you understand it, you can do amazing things with it. So go check it out, install it, and play around with it a little. If you need help, we'll be waiting here

TheComet

Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 30th Apr 2011 04:17
Quote: "However, I don't know how to check for collision then"

Wouldn't it be your basic
if object collision(obj1, obj2) = 1
// do something here
endif

but I do agree with the sparkys suggestion.

A clever person solves a problem, a wise person avoids it - Albert Einstein

Login to post a reply

Server time is: 2026-07-11 12:20:45
Your offset time is: 2026-07-11 12:20:45