• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help with conditions

U

Uroboros Dragon

Guest
I have a problem with the next:
i have six objects in screen 3 normal shapes and 3 shadow shape of the first 3, each with its pair.
when 1 normal shape collide with the shadow shape, the shadow shape disappears and appears another one of the normal shape, when the 3 normal shapes collide with your own shadow shape and appears the other normal shapes, I have 6 normal shapes in screen and 0 shadow shapes.

I need to check if the 6 normal shapes are in the screen and launch an alarm of 2s to the next lv screen.

How do you do it with GML & D&D
 
A

arirish

Guest
I would create a parent object, make the 3 normal shapes children of it, and then just check if there are 6 of the parent object in the room:
Code:
if instance_number(shape_parent)=6
{
//do stuff
}
Otherwise it would be:
Code:
if instance_number(shape1)=2 && instance_number(shape2)=2 && instance_number(shape3)=2
{
//do stuff
}
 
U

Uroboros Dragon

Guest
I try at this way and when the first normal shape collide with the shadow shape the game crash, only if I start for the second and third form and last the first shape, it works, but start with the first shape the game crash
Code:
if instance_number(shape1)=2 && instance_number(shape2)=2 && instance_number(shape3)=2
{
//do stuff
}
[/QUOTE]
 
A

arirish

Guest
Where did you put that code, and what are your shape objects called? You need to change 'shape1' etc to whatever names you're using.
 
Top