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 / Collisions?

Author
Message
n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 25th Apr 2007 23:27
How would you set up collisions for multiple objects? Like a brick-break game, you have like 20 of the same objects, how would you set up collisions for them besides making one line for each?

Ling creckt tsi nocreckto havela? NASA chetallnar mo lu'ul nasding!
aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 25th Apr 2007 23:34
Array them.
Or do this.



And you know, change the variable names.

I will Learn to rule 2d. Someday...
n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 25th Apr 2007 23:38
Sorry, im REALLY new here and that confused me. Care to elaborate?

Ling creckt tsi nocreckto havela? NASA chetallnar mo lu'ul nasding!
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 25th Apr 2007 23:55
he means to use a For - Next loop to browse through the bricks for collision check:

Suppose your bricks are object number 11 to 30 (that's 20 bricks and you better have them contiguous as to object number) and your projectile is object 1

you can set a For - Next loop counter (n or whatever name) to browse through:

For n = 11 to 30
if object collision(1,n)=1 then "break brick number n"
Next n

"....." = pseudo code
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 27th Apr 2007 19:13 Edited at: 27th Apr 2007 19:15

Login to post a reply

Server time is: 2024-09-25 21:23:45
Your offset time is: 2024-09-25 21:23:45