Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Collision Detection...Read Tutorial ...confused..
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
hello




PostPosted: Wed May 07, 2003 6:56 pm   Post subject: Collision Detection...Read Tutorial ...confused..

i read the collision detection help
but im confused still
my attempts for collision is having a a boundary like a rectangle
EXAMPLE:
if enemyx>5 and enemy<10 and enemyy>45 and enemyy<55 then
[stuff happens]
end if

but this is a rectangle and most of our ships are not rectangular
so i need to to have a circular boundary or one that is around the picture of the spaceship.

thx thx if u are helping me
and please dont just post a source code please explain it to me Very Happy
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed May 07, 2003 7:39 pm   Post subject: (No subject)

how many times did I say this already?! Scroll down to first reply of the collision detection. It explains circular collision detection

you should read the whole post (like text effects for example... source codes are scattered throughout the disussion because lots of people submit stuff). Same with every other post. Read the whole thread.

if you dont want, use SEARCH (link found on top /\ ) and find posts containing keyword you're looking for
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
William Hui Xue




PostPosted: Thu May 08, 2003 10:33 am   Post subject: (No subject)

Surprised Sad Smile Very Happy Shocked Confused 8) Laughing Crying or Very sad Embarassed Razz Mad Evil or Very Mad Twisted Evil Wink Exclamation Question Idea Arrow Mr. Green

Hello this is William, hi Hang. I am here to sooth your soul and councel you. Please do not feel that everyone is against you. You know that some loves you like your parents and I and our Christian brothers. Do not be bothered with such matter Hang. Instead forgive them, and show your light to the world.

Sincerely William Hui Xue
Prince




PostPosted: Thu May 08, 2003 10:37 am   Post subject: (No subject)

Rolling Eyes
Tony




PostPosted: Thu May 08, 2003 10:38 am   Post subject: (No subject)

sorry if I appear edgy... its just that it gets annoying when the same question is asked over and over and over again and noone bothers to look up the anwers already posted.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
ThunderChuncky




PostPosted: Thu May 08, 2003 11:53 am   Post subject: (No subject)

Nobody blames u, tony. <pat on back>
naoki




PostPosted: Sat May 10, 2003 2:46 pm   Post subject: (No subject)

sorry if hello's been on everyone's nerves .... he's just a demanding guy

so obviously he'd be on everyone if his work wasn't progressing well
Homer_simpson




PostPosted: Sat May 10, 2003 4:25 pm   Post subject: (No subject)

hmmm... the guy said that he wanted collision detection for his ship and i dont think his ship is circular so he has to use another way to detect collision...
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat May 10, 2003 4:39 pm   Post subject: (No subject)

well you could break the ship down into couple of boxes... would be somewhat accurate
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
naoki




PostPosted: Sat May 10, 2003 5:21 pm   Post subject: (No subject)

the ship is triangular in shape, and so a circle would at least shave off unnecessary hotspots from the detection system.
Homer_simpson




PostPosted: Sat May 10, 2003 5:43 pm   Post subject: (No subject)

tony wrote:
well you could break the ship down into couple of boxes... would be somewhat accurate

yeah that what i was thinking of too... it's a good idea but i dont think boxes would do we could just cut the ship to lines and check it that way...
Catalyst




PostPosted: Sun May 11, 2003 12:03 am   Post subject: (No subject)

theres a way to check if a point is inside a polygon (cant remeber exactly)
that would be an accurate way
Homer_simpson




PostPosted: Sun May 11, 2003 10:44 am   Post subject: (No subject)

that would be the faster way both ways work fine....
hello




PostPosted: Sun May 11, 2003 1:03 pm   Post subject: hello

we have many ships some are rectangular so thats easy but we want like a basic way to detect if the projectile is hitting the enemy and vice versa also we need to check if the enemy ship is crashing into the main ship
Tony




PostPosted: Sun May 11, 2003 1:12 pm   Post subject: (No subject)

you can consider the projectile to be a dot so you can just check if that dot is inside rectangle/circle/triangle to determine if collision has occured or not.

As for the collision between ships... well its easy to determine that if both are circles. If they're rectangles I think it would be enough to just check if any of the corners of the ship is inside the rectangle of another.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 18 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: