I need an function(collapsion test) to test if 2 shapes collapsed or not ^^
i tried to do it like that: if Xshape1 == Xshape 2 and if Yshape1==Yshape2 then Collapse = ture else false
failed :(
And it should push back ^^
ty :D
if ((imgX1 == imgX2) && (imgY1 == imgY2)) {alert('collapsed')} else {alert('failed')}
alert is just a display function
I usually break it into flags instead of going for the whole boolean
amm kk as i do ^^ so alres gives true to collapsed value ye?
but amistre i tried it too and it didn'T work :(
id have to see the programming to really get an understanding of it...
hmm kk but i have an idea just wait
OK I GOT IT JUST LOOK and a "ve" means and in turkish :( i wrote it turkish because of my agitation sorry :(
just look at these amistre
height and width /2 is center of image good; x and y are plots...
yea..
to you, will it work nice?
still looking it over; when do you want to call the collision? at center points of when edges meet?
i want to call when edges meet
no centers
are they both inmotion? or is one stationary?
yea they are in motion
so that, when they collapse, i want them to push back too
well, push back would be just a negation right? opoosite direction of motion
yea
collision happens regardless of both in motion so its simply breaching the area of the other then...
and it hink that if we have a variable named speed speed should be-0.1 f 60 times per sec yea?
u right , so when it collapese if it moves on X+1 direction it will move in X-1 direction and speed -0.1f 60 times per sec and if speed < 0 the it should stop ya?
cant say fer sure on speed yet but.... for collision I get: if Cxmin = xb-(hb/2) ; Cxmax = xb+(hb/2)
no 'if' there lol just naming variables
yea its like that
ok kk ^^ i am so unpatinet xp
maybe better to name then Axmin, Aymin, Axmax, Aymax, and such right?
amistre u know i am only 14 years old and I am not in highschool yet xd yea
if (Bxmin <= Axmax AND Bxmin >= Axmin) {then collapse}
im 39 so.... so lets keep it proper :)
:)
well its logical
that would generate a collapse if they are inline along the xaxis
factor in the y axis the same way and it should cover all diretions then
whatever your alogrithm for motion is, reverse it
and 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!!!!!!!!
OMG!!! u solved tht? O.o
you got it :) maybe an easier way to do it, but I never go that route lol
xd anyway we solved this it hink and tomorrow ill try to program it
good luck :)
name your corners; and when they are between each other or equal to each other, collapse
i wanted this collapsion thest to see if cannonball collapsed with theenemey ship
kk thank you
well i wrote algorithm for pushing back :D its ok now
really good work here
Join our real-time social learning platform and learn together with your friends!