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

#1 2011-09-11 13:52:20

PDaBaus
New Scratcher
Registered: 2011-09-11
Posts: 2

Time, score and spawning problems.

Hello

I am making a game (((named cannon defense)I know I'm not the only one using that name)It can be changed), where you have a cannon that shoots "bullets" to "enemys". Everytime the bullet hits enemy, the enemy "spawns" in different place.

Now to my questions: How can I make a timer that lets me play for 1 minute, then stops the game and tells me the "points" of how many enemys I killed? And how can I use that game in other websites than this?

Thank you.

Offline

 

#2 2011-09-11 14:03:01

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Time, score and spawning problems.

I think this will work:

#1:  Put all the game-playing scripts in a "forever if <not<(timer) > 60>> { }" loop.
#2:  Add this script (without the forever if I mentioned):

When Green Flag Clicked:
|wait until <(timer) > 60>|
code to say score here

You could use |say (score)|, |show variable {score  v}|, etc.

Offline

 

#3 2011-09-12 03:00:00

PDaBaus
New Scratcher
Registered: 2011-09-11
Posts: 2

Re: Time, score and spawning problems.

Could you please put #1 and #2 in those scratch boxes? I am very new to this. Thank you

Offline

 

#4 2011-09-13 09:28:35

slammer111
New Scratcher
Registered: 2011-09-01
Posts: 33

Re: Time, score and spawning problems.

[blocks]<forever if><<  <not>  >><( <timer> <>> 60 )>[/blocks] is what you need to add to each scrpt

and this is how to say score:
[blocks]<when green flag clicked><wait until><( <timer> <>> 60 )><say[ <{ score }> [/blocks]

Offline

 

#5 2011-09-13 14:28:19

slammer111
New Scratcher
Registered: 2011-09-01
Posts: 33

Re: Time, score and spawning problems.

slammer111 wrote:

[blocks]<forever if><<  <not>  >><( <timer> <>> 60 )>[/blocks] is what you need to add to each scrpt

and this is how to say score:
[blocks]<when green flag clicked><wait until><( <timer> <>> 60 )><say[ <{ score }> [/blocks]

DISCLAIMER: second code may be a more or less code

Offline

 

Board footer