This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-02-20 19:43:21

NewProgrammer
New Scratcher
Registered: 2011-02-20
Posts: 1

How To End A Game?

I am creating a game that involves a maze and in that maza, I have a bunch of things that are constantly moving in the same area and you have to try to avoid touching them. What I am trying to do is that when my character, a cat, touches that thing, then I want a message to display that says "You Lose!" and I want everything to just stop and to freeze and I want the message to stay there forever. I tried to do this but everytime I use the "stop script" it just stops that arrow key from working because I have all these commands set up for what would happen when I press each arrow key but when I use the "stop all" command, it only stops that arrow key from working and that is not what I want. I want everything to stop working. Please help me. If you need further information please tell me so. Thanks.

This is what I try to Do:

<when[left  ]key pressed>
<point in direction( 180
<move(4  )steps>
<if> touching sprite 5
<say[ You Lose!
<stop all>

But when I do this, only the key that i pressed when I touched the sprite gets frozen and nothing else. Please help me!

Offline

 

#2 2011-02-21 02:51:37

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: How To End A Game?

Are you sure you aren't using a "Stop script" Block?
It you are sure you are using a stop all, its probably because of this the fact the stop all block stops all running scripts, but if you trigger the hat command the script will still start running again.
Its like if you have a script like this:

[When green flag clicked]
[Repeat 100                      ]
[] [Move 10 steps]
[] [if <Sensing colour Blue>  ]
[] [] [Stop all O]
[] [_______________________]
[                                     ]

If the colour blue is sensed before the repeating is up the script will stop all of a sudden.
But if you press the green flag again it will still start again.
This is the same for the arrow key scripts you have I think.

Offline

 

#3 2011-02-21 08:02:41

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: How To End A Game?

When I saw this I thought it was about "The Game" and clicked it immediately. Turns out it wasn't, and now I lost the game. >.<

But yeah, colorfusion should have cleared this up.

Offline

 

#4 2011-02-21 08:16:18

Stickman704
Scratcher
Registered: 2009-01-31
Posts: 1000+

Re: How To End A Game?

I say a 'you lose' function would simply be everything hiding and then the background changing to a 'you lose' text.

SO it would be for every sprite

[blocks]<when I receive[ You lose
<hide>[/blocks][/blocks]

then for the background,

[blocks]<when I receive[ You lose
<switch to costume[ you lose background[/blocks]

then if you want to start again and show the sprites needed, use.

[blocks]<when green flag clicked>
<show>


Dun dun dun dun dun dun.... dun dun dun dun dun dun...  tongue

Offline

 

Board footer