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

#1 2011-04-08 13:25:51

PoDo
Scratcher
Registered: 2009-02-23
Posts: 500+

Game

I'm making a game that has spacebar pressing. I noticed when I tested it out you could cheat by holding down the spacebar. Is there any way I could prevent that?


http://i1214.photobucket.com/albums/cc498/Rubber_Dawg/Stop%20SOPA%20and%20PIPA/SOPAPIPA2.jpg

Offline

 

#2 2011-04-08 19:19:12

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Game

You'll want to tell the script to wait until they release the space key, like this:

Code:

When space key pressed
[blocks here]
Wait until <not < key space pressed > >

http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-04-09 04:02:10

PoDo
Scratcher
Registered: 2009-02-23
Posts: 500+

Re: Game

Harakou wrote:

You'll want to tell the script to wait until they release the space key, like this:

Code:

When space key pressed
[blocks here]
Wait until <not < key space pressed > >

Thanks

Mods: You can close this


http://i1214.photobucket.com/albums/cc498/Rubber_Dawg/Stop%20SOPA%20and%20PIPA/SOPAPIPA2.jpg

Offline

 

#4 2011-04-09 04:21:56

PoDo
Scratcher
Registered: 2009-02-23
Posts: 500+

Re: Game

Don't close this I have another question

I was testing it and when the time was 0 I could still press he spacebar. I tried

[blocks]<stop all>[/blocks] but I didn't work. I know why it doesn't work but I can't find a different script that could help.

Last edited by PoDo (2011-04-09 04:25:21)


http://i1214.photobucket.com/albums/cc498/Rubber_Dawg/Stop%20SOPA%20and%20PIPA/SOPAPIPA2.jpg

Offline

 

#5 2011-04-09 19:36:46

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Game

When you hit the stop button or use the stop all block, hat blocks will continue to function. However, leaving the project running with my given script works because the hat will not start again until it finishes its current action. (In other words, it won't start again while it's 'busy'.)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer