Checking if condition is NOT true
daniel.robert.campbell
Member Posts: 251
I feel like this has a super obvious solution and I'm just having a massive brain fart.
I've got an actor that is moving across the screen. I want it to continue moving until it hits another copy of the exact same actor. How do I check if collision with a certain actor is NOT happening?
Comments
You just use the "Otherwise:" section of a rule:
Thanks, but the problem is that I already have a rule in place that stops the actors movement if they reach the middle of the screen. That part works fine, but I'm having issues passing another condition telling the actor to stop once it's touched another actor.
It's an enemy, that moves till it hits the middle of the screen. I am spawning more of the same enemy that move into position as well, but I don't want them stacking up on top of each other, so I want one to stop if it's touching another enemy.
Okay
if self.position.x >= (device.width/2) then
stop
else
if collides with actor of type enemy then
-- stop
-- move forward
-endif
endif
Brilliant. Thank you very much!