A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
I need an function(collapsion test) to test if 2 shapes collapsed or not ^^
anonymous
 5 years ago
I need an function(collapsion test) to test if 2 shapes collapsed or not ^^

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0i tried to do it like that: if Xshape1 == Xshape 2 and if Yshape1==Yshape2 then Collapse = ture else false

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0And it should push back ^^

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2if ((imgX1 == imgX2) && (imgY1 == imgY2)) {alert('collapsed')} else {alert('failed')}

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2alert is just a display function

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2I usually break it into flags instead of going for the whole boolean

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0amm kk as i do ^^ so alres gives true to collapsed value ye?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0but amistre i tried it too and it didn'T work :(

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2id have to see the programming to really get an understanding of it...

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0hmm kk but i have an idea just wait

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0OK I GOT IT JUST LOOK and a "ve" means and in turkish :( i wrote it turkish because of my agitation sorry :(

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0just look at these amistre

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2height and width /2 is center of image good; x and y are plots...

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0to you, will it work nice?

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2still looking it over; when do you want to call the collision? at center points of when edges meet?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0i want to call when edges meet

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2are they both inmotion? or is one stationary?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0yea they are in motion

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0so that, when they collapse, i want them to push back too

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2well, push back would be just a negation right? opoosite direction of motion

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2collision happens regardless of both in motion so its simply breaching the area of the other then...

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0and it hink that if we have a variable named speed speed should be0.1 f 60 times per sec yea?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0u right , so when it collapese if it moves on X+1 direction it will move in X1 direction and speed 0.1f 60 times per sec and if speed < 0 the it should stop ya?

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2cant say fer sure on speed yet but.... for collision I get: if Cxmin = xb(hb/2) ; Cxmax = xb+(hb/2)

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2no 'if' there lol just naming variables

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0ok kk ^^ i am so unpatinet xp

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2maybe better to name then Axmin, Aymin, Axmax, Aymax, and such right?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0amistre u know i am only 14 years old and I am not in highschool yet xd yea

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2if (Bxmin <= Axmax AND Bxmin >= Axmin) {then collapse}

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2im 39 so.... so lets keep it proper :)

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2that would generate a collapse if they are inline along the xaxis

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2factor in the y axis the same way and it should cover all diretions then

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2whatever your alogrithm for motion is, reverse it

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0and t then do same thing for y axis and put them if if (Bxmin <= Axmax AND Bxmin >= Axmin) {then collapsex=ture} and for the other equatin is ture then collapsey=ture and if collapsex==ture and collapsey== ture then collapse==True!!!!!!!!

angela210793
 5 years ago
Best ResponseYou've already chosen the best response.0OMG!!! u solved tht? O.o

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2you got it :) maybe an easier way to do it, but I never go that route lol

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0xd anyway we solved this it hink and tomorrow ill try to program it

amistre64
 5 years ago
Best ResponseYou've already chosen the best response.2name your corners; and when they are between each other or equal to each other, collapse

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0i wanted this collapsion thest to see if cannonball collapsed with theenemey ship

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0well i wrote algorithm for pushing back :D its ok now

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0really good work here
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.