(FMX) hitTest

Hi,
does anyone know how to create an if statement like this:
-2conditions
-1 is a normal condition
-2 is a condition that, if it’s fulfilled, the “if” script isn’t executed

(basically it’s just thzt the second must say " if that doesn’t hitTest)

Please reply,

Luster

:h:

OK, maybe that wasn’t very clear. I’ll explain it this way:

I have an if statement , with 2 conditions, simplified:

if (condition1 AND condition2)
blablabla

condition1 is a "if Key.isDown…"
condition2 is a hitTest of 2 MC’s

Now, I want the if-statement to execute the “blablabla” stuff if condition 1 is true ( the key is down) and if there is NO collision.
It’s for something like this: you control an object, and there are obstacles in the way. If you drive against them, you cannot pass and you must go around.

Are you looking for something like this?
[AS]
if (condition1 && !condition2) {
doSomething();
}
[/AS]

Basically that says ‘if condition1 and not condition2 then do something’.

But like Voetsjoeba I’m not clear on what you want to accomplish.

Maybe the .fla will clear it up.
I want to move the pinguin around, but it cant go over the block, it needs to go around.

For the .fla, check this thread:
http://www.kirupaforum.com/forums/showthread.php?threadid=37692

Anyone?I think it has something to do with the !condition thing mentioned, but how do you use that?

I’ll have a look :slight_smile:

Anyone???