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 help?

Author
Message
Elited
13
Years of Service
User Offline
Joined: 18th May 2011
Location:
Posted: 22nd May 2011 00:58
Can someone tell me what I am doing wrong with collision in the following piece of code:

make object box 100,50,10,50
position object 100,0,125,700
color object 100,rgb(100,200,100)
make object collision box 100,-25,-5,-25,25,5,25,0
set object collision on 100
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 22nd May 2011 05:04
I'm not the sharpest guy around here, but while you're waiting for a someone smart to come along I would suggest posting your whole program. We'll at least need to see your loop in order to determine the problem. Probably the problem is in detecting the collision. And try to describe what you're trying to do. What is colliding with what? You can post all of your code brackets like this:



use these (without spaces)
[ code ]
[ /code ]

Hopefully, this has been helpful and not annoying Best of luck for your game/program, Elited

yrotate when you can spin?
God Bless!
/2007/dngsig.png[/img][/href]
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 23rd May 2011 09:13 Edited at: 23rd May 2011 09:17
Well, like DayGamer said, you aren't detecting for collision and there is no loop. So far, I don't see anything "wrong" with your code but it is simply incomplete.

Here is a small snippet which demonstrates basic collision detection


If there is anything you don't understand feel free to ask

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

Login to post a reply

Server time is: 2024-11-16 21:44:18
Your offset time is: 2024-11-16 21:44:18