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

#1 2013-01-03 09:32:08

RuudVanMurfin
New Scratcher
Registered: 2013-01-03
Posts: 6

How to make my game end! Please help.

I have made a shooting game which is quite similar to space inavders. But the problem is i want the game to end and say something like "well done" when all the things have been shot.. (when the aliens have been hit by the laser i have simply hidden them, but everything else still carry on...)

Please help  smile

Offline

 

#2 2013-01-03 09:38:51

Sholvanic1058
Scratcher
Registered: 2012-04-21
Posts: 100+

Re: How to make my game end! Please help.

What you need to do is use the stop all block. (Picture Below) Ghost the Well done sprite and then when the game stops... It should say Well Done!

stop all


http://i44.tinypic.com/2lj6o94.png

Offline

 

#3 2013-01-03 09:43:41

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: How to make my game end! Please help.

Sholvanic1058 wrote:

What you need to do is use the stop all block. (Picture Below) Ghost the Well done sprite and then when the game stops... It should say Well Done!

stop all

That's actually an interesting trick. When the Stop sign is clicked or the STOP ALL command is initated or executed, the graphic effects are reset. So if a Well Done screen is ghosted, you will see it appear when STOP ALL is initated.

Offline

 

#4 2013-01-03 09:53:29

RuudVanMurfin
New Scratcher
Registered: 2013-01-03
Posts: 6

Re: How to make my game end! Please help.

What do you mean by ghost? im new to scratch..

Offline

 

#5 2013-01-03 10:04:15

Sholvanic1058
Scratcher
Registered: 2012-04-21
Posts: 100+

Re: How to make my game end! Please help.

RuudVanMurfin wrote:

What do you mean by ghost? im new to scratch..

In the looks palette there should be a Set Color to 0, click the down arrow and select ghost to 100.


http://i44.tinypic.com/2lj6o94.png

Offline

 

#6 2013-01-03 10:19:07

RuudVanMurfin
New Scratcher
Registered: 2013-01-03
Posts: 6

Re: How to make my game end! Please help.

How do i make the game actually stop though? where do i put this stop all block? I have 6 sprites which you have to shoot, and if you shoot them all i want the game to stop.

Offline

 

#7 2013-01-03 10:23:59

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: How to make my game end! Please help.

RuudVanMurfin wrote:

How do i make the game actually stop though? where do i put this stop all block? I have 6 sprites which you have to shoot, and if you shoot them all i want the game to stop.

What i would do is use a variable called Score (you can create one under variables) and every time you shoot a sprite you change the score by one and then you have a block saying


if <(score) = (6)>
stop all
end
and then the game stops

Hope this helps  smile

Last edited by Willpower (2013-01-03 10:24:41)


http://i49.tinypic.com/e84kdj.png

Offline

 

#8 2013-01-03 10:44:33

Sholvanic1058
Scratcher
Registered: 2012-04-21
Posts: 100+

Re: How to make my game end! Please help.

RuudVanMurfin wrote:

How do i make the game actually stop though? where do i put this stop all block? I have 6 sprites which you have to shoot, and if you shoot them all i want the game to stop.

This is what you need to do:

when gf clicked
forever
if <<(Score) = (6)>>
stop all


http://i44.tinypic.com/2lj6o94.png

Offline

 

#9 2013-01-03 21:26:23

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: How to make my game end! Please help.

just remember:
  set the score to 0 when starting a new game
  change the score by 1 when each alien is shot
  wait until the score is what you want, show the well done, then stop all
  do NOT ghost the well done screen, because it will show whenever someone presses stop, even if they have not won yet
  make sure the well done is hidden when the game starts and shown when the game wins

Last edited by kayybee (2013-01-03 21:27:10)

Offline

 

#10 2013-01-04 08:07:41

BLU_Spy
Scratcher
Registered: 2012-01-05
Posts: 1000+

Re: How to make my game end! Please help.

kayybee wrote:

just remember:
  set the score to 0 when starting a new game
  change the score by 1 when each alien is shot
  wait until the score is what you want, show the well done, then stop all
  do NOT ghost the well done screen, because it will show whenever someone presses stop, even if they have not won yet
  make sure the well done is hidden when the game starts and shown when the game wins

Something like this:

when gf clicked
set [score v] to [0]
wait [0.1] secs //A delay is necessary if the person restarts the game.
wait until <(score)=[6]>
broadcast [end v]


when gf clicked
hide
set [ghost v] effect to [100]


when i receive [end v]
show
repeat [50]
change [ghost v] effect by [-2] 
end
stop all



Last edited by BLU_Spy (2013-01-04 08:15:38)


I HAVE SWITCHED ACCOUNTS! My new username is NoxSpooth.

Offline

 

#11 2013-01-04 09:46:14

RuudVanMurfin
New Scratcher
Registered: 2013-01-03
Posts: 6

Re: How to make my game end! Please help.

thanks for the help guys these do work well, however i have certain objects in which if you shoot them you get say -1 points, so to complete the game doesnt require you to get the best possible score if you know what i mean. Do you know what i can do for that?

Offline

 

#12 2013-01-04 09:56:53

Willpower_Reviews
Scratcher
Registered: 2012-10-04
Posts: 100+

Re: How to make my game end! Please help.

RuudVanMurfin wrote:

thanks for the help guys these do work well, however i have certain objects in which if you shoot them you get say -1 points, so to complete the game doesnt require you to get the best possible score if you know what i mean. Do you know what i can do for that?

So you have some things that gain points and some things that lose points?

EDIT- whoops this is my review account!

Last edited by Willpower_Reviews (2013-01-04 09:57:27)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i47.tinypic.com/xpsdgg.png&amp;link2=http://i50.tinypic.com/29408lg.jpg

Offline

 

#13 2013-01-04 10:03:08

RuudVanMurfin
New Scratcher
Registered: 2013-01-03
Posts: 6

Re: How to make my game end! Please help.

Willpower_Reviews wrote:

RuudVanMurfin wrote:

thanks for the help guys these do work well, however i have certain objects in which if you shoot them you get say -1 points, so to complete the game doesnt require you to get the best possible score if you know what i mean. Do you know what i can do for that?

So you have some things that gain points and some things that lose points?

EDIT- whoops this is my review account!

Yeah exactly, can you help?

Offline

 

#14 2013-01-04 10:16:58

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: How to make my game end! Please help.

RuudVanMurfin wrote:

Willpower_Reviews wrote:

RuudVanMurfin wrote:

thanks for the help guys these do work well, however i have certain objects in which if you shoot them you get say -1 points, so to complete the game doesnt require you to get the best possible score if you know what i mean. Do you know what i can do for that?

So you have some things that gain points and some things that lose points?

EDIT- whoops this is my review account!

Yeah exactly, can you help?

can you only click on each target once?

I am trying to recreate your problem as i am having trouble visualising it

Willpower_Reviews is me if you have not already guessed that!


http://i49.tinypic.com/e84kdj.png

Offline

 

#15 2013-01-04 10:19:55

RuudVanMurfin
New Scratcher
Registered: 2013-01-03
Posts: 6

Re: How to make my game end! Please help.

Willpower wrote:

RuudVanMurfin wrote:

Willpower_Reviews wrote:


So you have some things that gain points and some things that lose points?

EDIT- whoops this is my review account!

Yeah exactly, can you help?

can you only click on each target once?

I am trying to recreate your problem as i am having trouble visualising it

Willpower_Reviews is me if you have not already guessed that!

i have 7 things that you have to shoot, and you get points for shooting them, but there are some objects moving infront of them to make it harder to shoot them, if you hit this object you get -1 points. The idea is to shoot all 7 things without them reaching the bottom of the screen. Then see what score you got.

Offline

 

#16 2013-01-04 10:20:41

Willpower
Scratcher
Registered: 2012-01-26
Posts: 1000+

Re: How to make my game end! Please help.

RuudVanMurfin wrote:

Willpower wrote:

RuudVanMurfin wrote:

Yeah exactly, can you help?

can you only click on each target once?

I am trying to recreate your problem as i am having trouble visualising it

Willpower_Reviews is me if you have not already guessed that!

i have 7 things that you have to shoot, and you get points for shooting them, but there are some objects moving infront of them to make it harder to shoot them, if you hit this object you get -1 points. The idea is to shoot all 7 things without them reaching the bottom of the screen. Then see what score you got.

ah okay, give me a second

EDIT- the only way i can think of at the moment is having two variables- have one called "Score" or something similar when you get one for shooting what you are supposed to and lose one for touching bad things but then have a second variable called "Win" or something similar- where you only gain points for hitting the correct targets and when that = 7 you win. I would hide the "Win" variable so no-one can see it because it is not important for the player to see- it just lets the game know when the player has won

Something like this project i have just made to replicate your problem
Testing

Your problem is surprisingly hard- i am trying to think of situations in my games where i have come across this problem.

Last edited by Willpower (2013-01-04 10:37:49)


http://i49.tinypic.com/e84kdj.png

Offline

 

Board footer