So im trying to make it so that when my Sprite goes to costume 6, the game waits 2 seconds, then stops as if it was a Game Over. But it seems to go to costume 7 (Power Up Costume) and continue on like nothing happened. Heres the Script:
when gf clicked set [speed] to [-10] set [Damage Taken] to [0] set [Score] to [0] switch to costume [costume1] if on edge, bounce go to x: (-202) y: (0) set x to (-202) show if <(costume #)=[6]> wait (2) secs hide broadcast [end] end
when I receive [HP] if <(costume #)=[1]> switch to costume [costume 7] end if <(costume #)=[2]> switch to costume [costume 1] end if <(costume #)=[3]> switch to costume [costume 2] end if <(costume #)=[4]> switch to costume [costume 3] end if <(costume #)=[5]> switch to costume [costume 4] end
when I receive [Hit] next costume
when I receive [End] wait (0.1) secs Stop all
Offline
Could you upload the project; the problem seems to be that when the HP broadcast is recieved, it will be switching costumes; then when the two seconds are done it will have a different costume. I need to know when HP is broadcasted
Offline
That's because you aren't continually checking to see if it's costume 6. You will want to do something like this:
wait until <(costume #) = (6)> wait (2) secs hide broadcast [end v]
Offline
Aww... I was just about to post that. :P
Anyways, also add a if <not(Costume #=6)>> Around:
When I recieve [Hit]
When [up] key is pressed
When [down] key is pressed
;)
Last edited by laptop97 (2012-02-17 22:06:55)
Offline