I am making a game called Stranded. It has 9 sprites and 68 scripts (with 49 of them only having 2 or 3 blocks in them). All the sprites only have one costume, but the stage has four backgrounds. All the sprites have names (not "Sprite1", "Sprite2", etc.) It has 5 regular variables, and 2 specific to the sprite "Tree". If one of "Hunger", "Thirst", or "Injury" gets to 10, or if "Health" gets to 0, the background is supposed to change to a black screen with "You died o3o" written in white in the font "Helvetica Bold" in the size 24.
See that part I bolded? That's not working. This is the script I used for it:
<when green flag clicked>
<if><( <{ Health }> <=> 0 )>
<switch to costume[ background4 (Except it's switch to BACKGROUND, since it's stage.)
(hide variable Health)
(hide variable Hunger)
(hide variable Injury)
(hide variable Thirst)
<end>
(then repeat for Hunger, Injury, and Thirst (it's all on the same script, just different "if" blocks.) )
Did I do anything wrong? If so, how do I fix it?
(Also, if you don't understand, I'd be happy to edit this post.)
Offline
You could have accidentally said for the tree to show itself forever. When scripts conflict, the first one usually takes presidence.
Offline
12three wrote:
You could have accidentally said for the tree to show itself forever. When scripts conflict, the first one usually takes presidence.
I tried making all the sprites hide when you die just now, and it still doesn't work.
And the tree is a sprite, I don't see how it would effect the background changing . . .
I'm going to upload the project as it is. I'm bad at wording things, so if it was available to download and look at the sprites it would be easier, I think.
EDIT: Here it is.
Last edited by webgal15 (2010-10-27 16:06:36)
Offline
benjamin2 wrote:
You said you did the same for each. Don't the others need to be 10 and not 0?
![]()
By "the same for each", I meant the same blocks, but I DID use 10 for the others.
Offline
[blocks]<when green flag clicked>
<forever if><( <{ Health }> <=> 0 )>
<switch to costume[ background4 (Except it's switch to BACKGROUND, since it's stage.)
(hide variable Health)
(hide variable Hunger)
(hide variable Injury)
(hide variable Thirst)
<end>[/blocks]
Try that.
Offline
majormax wrote:
[blocks]<when green flag clicked>
<forever if><( <{ Health }> <=> 0 )>
<switch to costume[ background4 (Except it's switch to BACKGROUND, since it's stage.)
(hide variable Health)
(hide variable Hunger)
(hide variable Injury)
(hide variable Thirst)
<end>[/blocks]
Try that.
Tried, didn't work,
Offline