GS equiv. of "repeat until x=3"
gyroscope
I am here.Member, Sous Chef, PRO Posts: 6,598
Hi, I've been scratching my head again (good job I don't have dandruff!). I'm trying to work out the GS equivalent of the Basic command "repeat until x=3".
Say I have a fair chunk of stuff in the Rules of an actor, that I want repeated, 3 times only for instance. Rather than copying all of it twice again, I'm wondering if there's an easier way that I've missed...
I've tried using a Game Attribute, then Change Attribute to Game Attribute + 1, and in Rules, include When this Game Attribute is less than 4, but it still won't loop, of course. I don't know if I'm missing something obvious...
Any thoughts on this appreciated, thanks.
;-)
---------------------------------------------------------------
Spiral Gyro Games
Say I have a fair chunk of stuff in the Rules of an actor, that I want repeated, 3 times only for instance. Rather than copying all of it twice again, I'm wondering if there's an easier way that I've missed...
I've tried using a Game Attribute, then Change Attribute to Game Attribute + 1, and in Rules, include When this Game Attribute is less than 4, but it still won't loop, of course. I don't know if I'm missing something obvious...
Any thoughts on this appreciated, thanks.
;-)
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Comments
Timer 1 for 3 sec
Timer 2 every 1sec
Rules
May not be best way but worked
:-)
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Blah blah blah blah
Blah blah blah blah
Blah blah blah blah
change attribute game.loop to game.loop + 1
:-(
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
:-)
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Or I may look for some end point in the rules. Example: to make something blink I have a rule that says when color alpha = 0 interpolate color alpha to 1. when alpha = 1 interpolate alpha to 0. This causes it to blink. If you also added the loop +1 rule from above in with the when alpha = 1 it should only blink 3 times. And no timers
goodnight all...zzzzzzzzzzzzzzzzzzzzz
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
For interest, I tried a game attribute again, adding 1 to it every time the Rules were gone though, running only when this particular attribute was less than 4. Anyhow, it's working fine now, I'm pleased to say. I think I put the Change Attribute in the wrong place...
Thanks again to you and jstrahan.
:-)
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps