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
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.
Last edited by RedRocker227 (2011-11-29 17:18:17)
Offline
aquinnell wrote:
Thanks so much!
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)
Offline
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
Offline
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
I did try that but when my character would collect the soccer balls, the score wouldn't go up.
Offline
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 helpedI 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>
Offline