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

#1 2011-11-29 17:06:49

aquinnell
New Scratcher
Registered: 2011-11-29
Posts: 4

Game over screen?

In school, we are doing a project on a video game we have to make using scratch. I am completely new to this program and I don't really know if this is possible to do...so here's what I want to happen.

In my game, you have to gather soccer balls before the timer runs out. I have a countdown that goes from 60 down to 0. Generally, it's pretty easy to get all the soccer balls before the time runs out, but I was hoping that I could do levels where it gets more difficult to get the soccer balls each time. So when you finished level 1, it would show a screen saying "level 2" and go on to something harder. I wasn't entirely sure what kind of scripts to use to do that though.

Another thing I was hoping I could try was if you didn't get all the soccer balls in time, then it would show a screen saying "game over". I'm not entirely sure what scripts to use for that too.

Does that sound too complicated? I hope I explained things enough.

Offline

 

#2 2011-11-29 17:14:29

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Game over screen?

Use broadcasts. These are way of sending a message to all other sprites, telling them that something has happened. In your case, you would put:

When green flag clicked
Forever if lives=0    (or whatever you want to cause the game to be lost)
Broadcast 'Game over'
Stop script

Then create a sprite with the message 'Game over' on it. Put this on it:

When green flag clicked
Hide

When I receive 'Game over'
Show

What's happening?
When the amount of lives equals zero, a broadcast is sent out saying that the game is lost. The other sprite then reacts to this when it gets the message, by showing.

This is a very simple version, but as you said you've never used Scratch before then it's best not to attempt stuff too advanced.
smile

Last edited by RedRocker227 (2011-11-29 17:18:17)


Why

Offline

 

#3 2011-11-30 08:40:02

aquinnell
New Scratcher
Registered: 2011-11-29
Posts: 4

Re: Game over screen?

Thanks so much!  smile

But is there also a way for the countdown to stop once you've got all the soccer balls? Is that possible to do as well?

Offline

 

#4 2011-11-30 08:48:04

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Game over screen?

aquinnell wrote:

Thanks so much!  smile

But is there also a way for the countdown to stop once you've got all the soccer balls? Is that possible to do as well?

When you have all the soccer balls <broadcast[ SC

<when I receive[ SC
<set{ TIME }to( <timer>

Last edited by muppetds (2011-11-30 08:48:30)


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#5 2011-11-30 08:49:21

Tbtemplex97
Scratcher
Registered: 2011-11-12
Posts: 100+

Re: Game over screen?

yes.

You can make:

When flag pressed
wait until <soccerballs = 0>
Broadcast all balls collected.

Then on your soccerballs script, add if <soccerballs = 0> stop scipt

then make another script-

when i recieve all balls collected
set variable "balls" to E.G 100


hope this helped  wink


Online Status: http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=Tbtemplex97
Darkspace Coming Soon!, Try the Singleplayer Demo

Offline

 

#6 2011-11-30 18:49:11

aquinnell
New Scratcher
Registered: 2011-11-29
Posts: 4

Re: Game over screen?

Tbtemplex97 wrote:

yes.

You can make:

When flag pressed
wait until <soccerballs = 0>
Broadcast all balls collected.

Then on your soccerballs script, add if <soccerballs = 0> stop scipt

then make another script-

when i recieve all balls collected
set variable "balls" to E.G 100


hope this helped  wink

I did try that but when my character would collect the soccer balls, the score wouldn't go up.

Offline

 

#7 2011-11-30 19:52:03

Tbtemplex97
Scratcher
Registered: 2011-11-12
Posts: 100+

Re: Game over screen?

aquinnell wrote:

Tbtemplex97 wrote:

yes.

You can make:

When flag pressed
wait until <soccerballs = 0>
Broadcast all balls collected.

Then on your soccerballs script, add if <soccerballs = 0> stop scipt

then make another script-

when i recieve all balls collected
set variable "balls" to E.G 100


hope this helped  wink

I did try that but when my character would collect the soccer balls, the score wouldn't go up.

in that case, you would make a script that meant evertime you touched a soccer ball (make a new variable) you would go up 1 "balls"

<when green flag clicked>
<forever>
<wait until><touching[ Ball]
<change{ balls }by( 1)
<wait( 0.0001 )secsc>


Online Status: http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=Tbtemplex97
Darkspace Coming Soon!, Try the Singleplayer Demo

Offline

 

#8 2011-11-30 20:22:48

aquinnell
New Scratcher
Registered: 2011-11-29
Posts: 4

Re: Game over screen?

Oh hahaha I didn't notice you could do that, thanks so much!  smile

Offline

 

Board footer