have a condition after an action

Get help using Construct 2

Post » Sat Jun 16, 2012 9:45 am

For example I'd like to do a script like this

CONDITION: 'Pizza1' on collision with 'flooor'
ACTION: Wait 5 seconds
CONDITION: Pizza1 on collision with floor (check if it's been touching the floor for 5 seconds, 5 second rule ya know!)
ACTION: make 'Game_Over' visible!

Can I do this in one chain of scripting blocks without using variables?
B
3
G
2
Posts: 5
Reputation: 1,160

Post » Sat Jun 16, 2012 12:18 pm

hmm why you don't use variable?? with variable it would be easy...

anyway i think this work :
condition 2:pizza1 collision with floor
           -> time >= 5 seconds        : make game_over visible
           -> time < 5 seconds        : make game_over unvisible
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Sat Jun 16, 2012 2:31 pm

All "wait" does is pause the system for a given period of time and then go to the next action, whatever it is. Obviously, you want the player to be able to take action, removing the pizza from the floor before the five seconds is up. I think each pizza instance needs an instance variable that increments by one for every second that the instance is touching the floor, and when that variable hits 5 for any pizza instance, the game is over. If the player removes the pizza instance from the floor, the instance variable needs to be reset to zero for that instance. The "wait" action is not needed.

jimand2012-06-16 14:44:48
B
16
S
4
G
1
Posts: 40
Reputation: 2,705

Post » Sat Jun 16, 2012 4:00 pm

I think the OP wants to use sub-events. You can add a whole other event with conditions and actions that runs after the previous event's actions.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Sat Jun 16, 2012 7:22 pm

Thank you Ashley! Perfect!!!! This is a huge breakthrough for me
B
3
G
2
Posts: 5
Reputation: 1,160


Return to How do I....?

Who is online

Users browsing this forum: Lof, YoHoho and 20 guests