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

#1 2007-06-21 22:25:55

clapmatt
Scratcher
Registered: 2007-06-19
Posts: 18

Score Sensing

How would I be able to do something like when the score is equal to some number do some kind of action?

Offline

 

#2 2007-06-21 23:39:18

paulmedwal
Scratcher
Registered: 2007-03-09
Posts: 100+

Re: Score Sensing

switch the 5 with whatever score that you want. And switch "say hello" with whatever blocks you want to use when the score is what you want it to be.

when green flag clicked
forever if (score = 5)
say "hello"

Paulmedwal


clutter.scratch.mit.edu Visit the Clutter site to create multi-scene stories and multi-level games with Scratch.

Offline

 

#3 2007-06-22 15:34:46

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Score Sensing

You may want to keep the forever loop from doing an infinite repeat:

forever if score > 4
    say "you win!"
    wait until score < 1

This will say "you win!" once, and not check the score again until something has reset it.

Offline

 

#4 2007-06-23 15:54:09

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Score Sensing

Try this

when flag clicked
wait until score = 5
say "Win!"

I think that would be the best way to do it.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

Board footer