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

#1 2011-06-30 10:09:19

roadrunner444
Scratcher
Registered: 2010-01-21
Posts: 6

How do I make a Sprite count???

I am making a project and need the sprite to count. I don't want it to have a limit. How do I do it????

Thanks,
    Roadrunner444
big_smile

Offline

 

#2 2011-06-30 11:14:15

shiguy101
Scratcher
Registered: 2010-11-17
Posts: 1000+

Re: How do I make a Sprite count???

if you are counting seconds
<when green flag clicked>
<say[ <timer> ]>

if you are counting things
<when green flag clicked>
<set{  }to(0)
<forever>
<say[<{  }>
<end>

<when green flag clicked>
<change{  }by(1)

Offline

 

#3 2011-06-30 12:28:44

roadrunner444
Scratcher
Registered: 2010-01-21
Posts: 6

Re: How do I make a Sprite count???

big_smile
Im confused. What I want to do is count how many time a button has been clickedd. Thank you Shyguy101 for trying to help. Could you try to explain again??? Thanks again

Roadrunner444

big_smile 
smile
sad

Last edited by roadrunner444 (2011-06-30 12:29:18)

Offline

 

#4 2011-06-30 13:13:57

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: How do I make a Sprite count???

Simply make a variable called 'clicks' and add this script to the button's sprite:

[blocks]
<when[ button ]clicked>
<change{ clicks }by( 1
[/blocks]

Hope it helped  smile

Offline

 

#5 2011-06-30 13:19:21

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do I make a Sprite count???

LS97 wrote:

Simply make a variable called 'clicks' and add this script to the button's sprite:

[blocks]
<when[ button ]clicked>
<change{ clicks }by( 1
[/blocks]

Hope it helped  smile

And the variable http://theblocklibrary.site11.com/include/img/blocks/specparser.php?spec=clicks&amp;type=reporter&amp;color=variables will report how many times it has been clicked, if you didn't get that.  wink

Last edited by scimonster (2011-06-30 13:20:31)

Offline

 

#6 2011-06-30 13:52:30

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: How do I make a Sprite count???

scimonster wrote:

LS97 wrote:

Simply make a variable called 'clicks' and add this script to the button's sprite:

[blocks]
<when[ button ]clicked>
<change{ clicks }by( 1
[/blocks]

Hope it helped  smile

And the variable http://theblocklibrary.site11.com/inclu … =variables will report how many times it has been clicked, if you didn't get that.  wink

I have a feeling that was just to try out your spec parser...
Awesome, anyway  smile

Maybe add bingo's category colors, as well as %s and %n inputs?  tongue

Last edited by LS97 (2011-06-30 13:56:07)

Offline

 

#7 2011-06-30 18:12:04

roadrunner444
Scratcher
Registered: 2010-01-21
Posts: 6

Re: How do I make a Sprite count???

Thanks guys!!! helped alot!!!

big_smile

Offline

 

#8 2011-07-02 15:22:32

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do I make a Sprite count???

LS97 wrote:

scimonster wrote:

LS97 wrote:

Simply make a variable called 'clicks' and add this script to the button's sprite:

[blocks]
<when[ button ]clicked>
<change{ clicks }by( 1
[/blocks]

Hope it helped  smile

And the variable http://theblocklibrary.site11.com/inclu … =variables will report how many times it has been clicked, if you didn't get that.  wink

I have a feeling that was just to try out your spec parser...
Awesome, anyway  smile

Maybe add bingo's category colors, as well as %s and %n inputs?  tongue

It wasn't, and it's not mine.  tongue  Talk to TheSuccessor.  wink

Offline

 

Board footer