-
Advanced test
Hello,
I need some help because I don't know how to do that :
+ Collision between OBJX and OBJX
- OBJX 1 : Alterable value A = 1
- OBJX 2 : Alterable value A = 2
> OBJX 1 : Destroy
> OBJX 2 : Bounce
The syntax is false, of course. But I can't find a way to do that... Is somebody know how to do that ?
Thanks. :)
-
Re: Advanced test
I assume your + and - are conditions, and > are actions? Then don't you want:
+ Collision between OBJX and OBJX
- OBJX: Alterable value A = 2
> OBJX: Bounce
+ Collision between OBJX and OBJX
- OBJX: Alterable value A = 1
> OBJX: Destroy
They _should_ both run I think.
If you really do need to identify both objects in a collision the only way is to use a "proxy" object. Basically you loop through all instances of OBJX and set the proxy to it, and turn the flag 0 of OBJX on. In the same loop you then test for collision between OBJX and the proxy, with the extra condition that flag 0 must be off (to stop the proxy colliding with the object you've positioned it over). Do whatever you want, and then at the end of the loop turn flag 0 off again. Like this:
*Always
-Spread value 0 in "OBJX"
*Always
-Start loop "collision" for count("OBJX") times
*On loop "collision"
+Alt Value of "OBJX" == loop index
-Set "proxy" to location of "OBJX"
-Set flag 0 of "OBJX" on
*On loop "collision"
+"OBJX" is overlapping "proxy"
+flag 0 of "OBJX" is off
-Do whatever to "OBJX" // this is the other "OBJX"(s) from the collision
-Set flags in "proxy" to say what to do to the other "OBJX"
*On loop "collision"
+flag 0 of "OBJX" is on
+flag whatever is set in "proxy"
-Do whatever to "OBJX" // this is the first "OBJX" from the collision
-clear flag in "proxy"
*On loop "collision"
-Set flag 0 of "OBJX" off