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

#1 2012-04-13 16:16:58

ginge111
New Scratcher
Registered: 2012-04-13
Posts: 1

Variable counting

Hi,
I've got a project that needs to be created and part of it requires the counting of a variable. At the minute every time press a key, this sets the variable to true. After it i have a change variable by 1, however it jumps straight from 0 to 2 and will stay at 2 forever?

Any help will be greatly appreciated..

Thanks
-Kev

Offline

 

#2 2012-04-13 16:28:27

gamesman12
Scratcher
Registered: 2012-03-13
Posts: 67

Re: Variable counting

i am new to scratch but if you upload the project i might be able to help.

Offline

 

#3 2012-04-13 16:31:37

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Variable counting

I think you want this

when clicked
forever
if
key
any
pressed?
set
variable
to
1
wait until
not
key
any
pressed?

Offline

 

#4 2012-04-13 23:41:07

SOScratch
Scratcher
Registered: 2010-02-01
Posts: 100+

Re: Variable counting

TorbyFork234 wrote:

I think you want this

when clicked
forever
if
key
any
pressed?
set
variable
to
1
wait until
not
key
any
pressed?

Uhh... there is no

key
any
pressed?

in Scratch.

Last edited by SOScratch (2012-04-13 23:41:37)


-SOScratch
Scratch On!

Offline

 

#5 2012-04-14 04:23:55

gamesman12
Scratcher
Registered: 2012-03-13
Posts: 67

Re: Variable counting

look under sensing.
There should be a block that sais... key (right arrow) pressed?
                                                  key (left arrow) pressed?
                                                  key (up arrow) pressed?

and the list goes on

Offline

 

Board footer