How do i make it so that when a sprite touches a certain color, it does a animation once and once only? i mean that it does the animation it's supposed to do, and not play it over and over again.
Here's the scripts:
when gf clicked forever if <touching color [RED]> play sound [f2f_hitg] switch costume to [Death1 v] wait (0.05) secs switch costume to [Death2 v] wait (0.05) secs switch costume to [Death3 v] wait (0.05) secs switch costume to [Death4 v] wait (0.05) secs switch costume to [Death5 v] end
Offline
Add
stop scriptdirectly after "switch to costume Death5".
Offline
try the hide script
Offline
Instead of "forever if", use "forever; if | else", and put the arrow/WASD key scripts in the "| else" part. And, at the end of the "if |" part, use a "stop script".
when gf clicked set [deathCostume v] to [0] forever if <touching color [#FF0000]?> play sound [f2f_hitg v] repeat (5) change [deathCostume v] by (1) switch to costume (deathCostume) wait (0.05) secs end stop script else MOVING SCRIPT HERE endRemember to set your first death costume to the first costume of the sprite.
Last edited by jontmy00 (2012-12-23 02:19:18)
Offline
Simple:
when gf clicked forever if <touching color [RED]> play sound [f2f_hitg] switch costume to [Death1 v] wait (0.05) secs switch costume to [Death2 v] wait (0.05) secs switch costume to [Death3 v] wait (0.05) secs switch costume to [Death4 v] wait (0.05) secs switch costume to [Death5 v] wait until <not(touching color [red])> end
Last edited by notaloser (2012-12-24 05:03:22)
Offline
notaloser wrote:
Simple:
when gf clicked forever if <touching color [RED]> play sound [f2f_hitg] switch costume to [Death1 v] wait (0.05) secs switch costume to [Death2 v] wait (0.05) secs switch costume to [Death3 v] wait (0.05) secs switch costume to [Death4 v] wait (0.05) secs switch costume to [Death5 v] wait until <not(touching color [red])> end
Read post #3, and your scripts are extremely inefficient.
Offline