Discuss Scratch

cs275623
Scratcher
42 posts

Resolved: Glitch I Want to Fix in a Project

So….I am trying to make a game, and there are 2 choices. View the answers immediately or play the game. So, I can view the answers by clicking the arrow keys, but unfortunately, that works on the game too. I don't want it to work on the game. How can I make sure that I can't press the arrow keys during the game?

Here is my project: https://scratch.mit.edu/projects/127705521/

Please reply soon! Thank you!

This is resolved.

Last edited by cs275623 (Nov. 6, 2016 22:49:12)


Scratch-Minion
Scratcher
1000+ posts

Resolved: Glitch I Want to Fix in a Project

When an arrow key is pressed, you need to test that the game is not running before doing anything.

You could create a variable, eg. GameInProgress, and set it to “true” when the game is running, “false” when it is not running.
Then when an arrow key is pressed, check with an If block that GameInProgress is false.

or you could test whether the Game backdrop is showing to see whether the game is in progress.

when [left arrow v] key pressed
if <not <(backdrop name) = [Game]>> then
end

I hope this helps.
.

Powered by DjangoBB