I am looking for is a condition with Objects

Started by barefoot, Sun 06/12/2009 16:24:47

Previous topic - Next topic

barefoot

Hi

I have 6 objects in a room. 3  that are visible when the room is entered and 3 that are invisible when the room entered.

when a gun is used on the visible objects they are replaced by the other 3 objects using the  Visible = false/true statements. (monster alive is true and monster dead is false at room load)

what I am looking for is a condition that happens when ALL 3 objects (monster alive)become visible (monster dead)

ie;


Display("You have killed the 3 monsters and it's now safe to pass")
player.ChangeRoom(23, 55, 371);

Hope this is clear enough and hope someone can help.

barefoot

I May Not Be Perfect but I Have A Big Heart ..

monkey0506

That's easy. Just do something like:

Code: ags
if ((oMonster1Dead.Visible) && (oMonster2Dead.Visible) && (oMonster3Dead.Visible)) {
  Display("You have killed the 3 monsters and it's now safe to pass")
  player.ChangeRoom(23, 55, 371);
}

barefoot

Cheers monkey..

at the moment i came across:

swampmonster1.Solid = true;
swampmonster1.BlockingHeight = 420;
swampmonster1.BlockingWidth = 90;

and i change it to false when the object changed... and it works for me on this occassion..

but thanks and i will use your option next time

thanks again

barefoot
I May Not Be Perfect but I Have A Big Heart ..

monkey0506

You said you had 6 objects total and were just using the Visible property... :-\

....but...I guess you got it sorted out then?

barefoot

Hi Monkey

just for the record...

6 objects in total... 3 objects visible and 3 objects invisible.

When a visible object is killed it becomes invisible and an invisible object becomes visible to take its place, if you catch my drift..

cheers
barefoot
I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk