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 problem

Author
Message
Seboolek
17
Years of Service
User Offline
Joined: 2nd Oct 2007
Location: POLAND
Posted: 2nd Oct 2007 20:59
Hi. I'm new in forum

My problem is a wery hard for me...now.
I don't now how to make a collision.
I try but i don't now...
I attach my game... No Collision. Help!

My English is a lame But i study in a school this language.

Attachments

Login to view attachments
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 2nd Oct 2007 23:30
Firstly you need two objects to collide. you must then turn on the collision for each object. Use the code:

set object collision to boxes [objetc number]

In your main loop you need to store the position of the player before he moves and then check for collisions using this command:

if object collision( [object 1] , [object 2] )=1

You must position the player at his orignial starting position if this statment is true.

If you have multiple objects and want to check easily use this command:

if object collision( [object 1] ,0)>0

This will check if object 1 is colliding with any objects at all. Warning: this can be slow with many objects.

This is the most simplest collisions you can do.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Insert Name Here
17
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 3rd Oct 2007 22:23
And, i hate to say this but...

Just a hint.

Quote: "Everyone's entitled to an opinion...but your opinions are wrong."

Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 4th Oct 2007 08:28
So telling him to search for a printer will bring up solutions to a collision problem?


Insert Name Here
17
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 4th Oct 2007 19:10
I- I meant- but but but-...
Grrrr.
I was pointing out the search function, not searching for printing.

Quote: "Everyone's entitled to an opinion...but your opinions are wrong."

Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 4th Oct 2007 23:34
lol
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 5th Oct 2007 12:56
Yeah, I know what you mean, don't worry.


DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 7th Oct 2007 09:27 Edited at: 7th Oct 2007 09:28
Use the search.
The basic idea-->


Somthing like that would work.

PS:Search Sparkys

I keep runing nowhere fast!
Seboolek
17
Years of Service
User Offline
Joined: 2nd Oct 2007
Location: POLAND
Posted: 23rd Nov 2007 14:01
Thanks All!

Login to post a reply

Server time is: 2024-11-25 12:20:04
Your offset time is: 2024-11-25 12:20:04