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 / Colliding With A Box On All Sides

Author
Message
MonchoMeecho
15
Years of Service
User Offline
Joined: 10th Aug 2010
Location:
Posted: 16th Aug 2010 20:25
Hey just having a problem with something.

Basically I've set an array of cubes for a game I'm making to be collided with by the player, I have him colliding fine with the top and bottom of each cube, but it's going through the sides.



The 100.26 is just the size of the cube.

It's in a for loop because I've loaded all of the cubes in my level via an array (10 + i).

Does anyone have a idea how I could make the player collide with the sides of the object without going through it?

Any help / code will be greatly appreciated!
MonchoMeecho
15
Years of Service
User Offline
Joined: 10th Aug 2010
Location:
Posted: 17th Aug 2010 15:27
Sorry to bump this thread, but this is seriously the only major milestone I need to get over if I want to complete my game. It's been ridiculously frustrating trying to get this simple collision to work .

I have updated my code though, however there's an issue when I try to compile it, 'Both operands are required for non-uniary operations at line x' (where the left collision starts).

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 17th Aug 2010 15:59
Your code has nothing to do with latteral collision. You put the rems in but you have no code.....

The fastest code is the code never written.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Aug 2010 19:03
Use sparky's collision, it returns more information about the collision than darkbasic commands, which tell you if it's colliding or not, which isn't very useful when you think about it.

Search the forums for collision dll, there are some examples that come with it.

Login to post a reply

Server time is: 2026-07-25 17:49:56
Your offset time is: 2026-07-25 17:49:56