Timer Issue?
grimtooth
Member Posts: 69
Having an issue with something I thought would be straightforward, but isn't that always the case. Yes I have read the "timers are for chumps" thread, but I'm just making a proof of concept template so I figured "Timer" was quicker even if dirtier.
What I want:
A "rain" of blocks falling that have different images.
My code:
Actor: Spawner
Timer: every 0.2 seconds spawn actor "block"
Global variable "count" (integer)
Actor: block
Accelerate @270(scene) speed 200
Rule: if self.time>4 destroy
Rule: if self.time<= 0.2
Do:
Rule: if count =1
set image to block1
Set count to 2
.....(3 more rules to cover 2,3,4)
Rule: if count=5
Set image to block5
Set count to 1
My block images are just rectangles with numbers 1-5 on them (like I said just want proof of concept for now)
Results: a steady stream of blocks with the #5 on them falling across the screen
I tried moving the self.time condition to 0.1 and 0.3 but it appears to make no difference.
I have tried re-ordering the rules to change count before or after change image but that also appears to make no difference.
Thoughts?
Grim
What I want:
A "rain" of blocks falling that have different images.
My code:
Actor: Spawner
Timer: every 0.2 seconds spawn actor "block"
Global variable "count" (integer)
Actor: block
Accelerate @270(scene) speed 200
Rule: if self.time>4 destroy
Rule: if self.time<= 0.2
Do:
Rule: if count =1
set image to block1
Set count to 2
.....(3 more rules to cover 2,3,4)
Rule: if count=5
Set image to block5
Set count to 1
My block images are just rectangles with numbers 1-5 on them (like I said just want proof of concept for now)
Results: a steady stream of blocks with the #5 on them falling across the screen
I tried moving the self.time condition to 0.1 and 0.3 but it appears to make no difference.
I have tried re-ordering the rules to change count before or after change image but that also appears to make no difference.
Thoughts?
Grim
Comments
Sorry for the spam, carry on
Grim