Is it possible to send out a broadcast once and then stop it?
Offline
If you meant to stop the broadcasted script, then no, unless you put the "stop script" in the broadasted script.
Offline
If Splodgey is correct in what you want to know:
You'd have to use the broadcast script to check a variable. Something like this:
set [stop? v] to [false] broadcast [event v] wait (5) secs set [stop? v] to [true]
When I Receive [event v] do stuff if<(stop?) = [true]> stop script end do stuff if<(stop?) = [true]> stop script end etc.or, if it is a loop:
When I Receive [event v] repeat until <(stop?) = [true]> do stuff endEdit: the more frequently you check if "stop?" is true, the faster it will stop. For instance, script #3 will stop after completing the script it is going through and simply not repeat again. If there is a lot of stuff in the loop, you might want to consider building in some if statements in the loop itself (combining the two methods)
Last edited by MoreGamesNow (2012-04-08 16:22:31)
Offline
the reason I thought I should use a broadcast is because I'm using a sprite as a 'lives bar', and I didn't want to use it as a variable. is there any other, possibly easier, way to do that?
Offline
I'm pretty sure you'd have to use a variable, though you could work around it using the "[x position] of [sprite 1]", and tying it to another sprite's costume, x position, etc., but the result would still be variable-esque. Why don't you want to use a variable?
Edit:
something like this:
when gf clicked forever if<(health) > [90]> switch to costume [90-100 v] else if<(health) > [80]> switch to costume [80-90 v] else etc. end end
Last edited by MoreGamesNow (2012-04-09 09:15:20)
Offline
it's a mario game and I just think that a variable showing the number of lives would just look ugly
Offline
MoreGamesNow wrote:
I'm pretty sure you'd have to use a variable, though you could work around it using the "[x position] of [sprite 1]", and tying it to another sprite's costume, x position, etc., but the result would still be variable-esque. Why don't you want to use a variable?
Edit:
something like this:when gf clicked forever if<(health) > [90]> switch to costume [90-100 v] else if<(health) > [80]> switch to costume [80-90 v] else etc. end end
Doesn't anyone get using costume numbers?
when gf clicked forever switch to costume (round ((health) / [10]))Simple.
Offline
If you want accuracy though, it's probably easiest to use pen (assuming you're not using pen elsewhere in the project).
@Splodgey - oops. Forgot about the round block x( Thanks for the correction
Last edited by MoreGamesNow (2012-04-09 13:56:46)
Offline