Can you post the actual code that you are using, so that we can help debug it?
Is the code checking for the key-press inside some type of loop? If so, perhaps it is incrementing the variable several times while you are holding down the key?
Offline
If you are holding down a key you may be getting autorepeat from your keyboard.
Like thisssssssssssssssssssssssssss
Offline
@kevin : i just press once
@ this is how i got probs
When i receive "start" ( when i press my mouse it'll broadcast "start" - no probs here )
forever if : arrow pressed
changed "key" by 1 ( key is variable )
thanks for helping
Offline
Ahhh nemouno, I see what is happening. When you use
forever if: arrow pressed
it is "constantly" checking if the arrow is pressed, and if so it changes "key" by 1. But it checks so fast that it changes "key" many times in the short period of time that you push down the arrow. I would recommend putting a wait block into the "forever if" loop. Or, if I wanted to take a different approach, I would use the control block "when ____ key pressed"
Offline
do you mean with the code you have now is there any way to fix it? i'd try putting a
"wait 1 second"
block into the loop
If that isn't what you're asking can you post again with more description? You can even upload your project that you want help on if you want to.
Offline
i've changed the code - so i'll finish the project first
im not good at english much
but i still can say the way i want that code works like this :
With 4 arrows - in about 15s - i press 4 arrows randomly
so with each arrow - 1 symbol appear from left to right
and after pressing 4 arrow - i cant press animore
-- so i make a variable here to count the times arrow pressed
---- i guess no-one will understand wad im talking )
my writing skill iz bad T~T
Offline
Instead of using "if arrow pressed" try using a script that starts with "when arrow clicked"
Offline
Hi nemouno,
What if you had these four scripts:
When <up arrow> key pressed
change key by <1>
When <down arrow> key pressed
change key by <1>
When <left arrow> key pressed
change key by <1>
When <right arrow> key pressed
change key by <1>
Then you could have another script that checks the value of key and stops the program if it equals 4:
forever if <key = 4>
stop all
Does that help?
-Tammy
Offline