have a condition after an action Forum Home > Construct 2 General > How do I....? |
Post Reply
|
| Author | |
Post Options
Quote Reply
Topic: have a condition after an actionPosted: 16 Jun 2012 at 9:45am |
|
|
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? |
|
![]() |
|
Post Options
Quote Reply
Posted: 16 Jun 2012 at 12:18pm |
|
|
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 |
|
![]() |
|
Post Options
Quote Reply
Posted: 16 Jun 2012 at 2:31pm |
|
|
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.
Edited by jimand - 16 Jun 2012 at 2:44pm |
|
![]() |
|
Post Options
Quote Reply
Posted: 16 Jun 2012 at 4:00pm |
|
|
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.
|
|
![]() |
|
Post Options
Quote Reply
Posted: 16 Jun 2012 at 7:22pm |
|
|
Thank you Ashley! Perfect!!!! This is a huge breakthrough for me
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |