Discuss Scratch

cs472739
Scratcher
4 posts

Up and Down Arrow Key Problem

I am trying to use physical interaction for my project and it requires the use of arrow keys. not only that, but it requires the use of “if <key> is pressed” block in an “if” block in order for the interaction to work. The problem is that in the context of my project, the only way I can get it to work is through the use of a forever block.

Here is my project:
https://scratch.mit.edu/projects/163131771/#editor

Thanks everyone!
asivi
Scratcher
1000+ posts

Up and Down Arrow Key Problem

GMod Tower's Keyboard Piano by HoofEMP

I think that project is what you need.

Last edited by asivi (June 2, 2017 16:21:04)

cs472739
Scratcher
4 posts

Up and Down Arrow Key Problem

Unfortunately, this didn't really help me out. Sorry

Thanks for trying though
footsocktoe
Scratcher
1000+ posts

Up and Down Arrow Key Problem

cs472739 wrote:

I am trying to use physical interaction for my project and it requires the use of arrow keys. not only that, but it requires the use of “if <key> is pressed” block in an “if” block in order for the interaction to work. The problem is that in the context of my project, the only way I can get it to work is through the use of a forever block.

Here is my project:
https://scratch.mit.edu/projects/163131771/#editor

Thanks everyone!

What is the problem? Any “If” type block only works continuously if it is in a loop.


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

NeonFrostburn
Scratcher
100+ posts

Up and Down Arrow Key Problem

I'm pretty sure it'll have to be in a forever or
repeat until <(use this variable to show when to stop the loop) = [anything that will make sense to you]>

end

WOL FY!
benjiscool
Scratcher
20 posts

Up and Down Arrow Key Problem

if you only have a few options with the key block (in this case up and down key), use this script…



define when asked...
wait until <<key [up arrow key v] pressed?> or <key [down arrow key v] pressed?>>
if <key [up arrow key v] pressed?> then
Your script here...
end
if <key [down arrow key v] pressed?> then
Your script here...
end

Last edited by benjiscool (June 2, 2017 17:08:25)

cs472739
Scratcher
4 posts

Up and Down Arrow Key Problem

It's okay everyone, I figured out how to solve it! Thanks everyone
stachu3478
Scratcher
4 posts

Up and Down Arrow Key Problem

cs472739 wrote:

I am trying to use physical interaction for my project and it requires the use of arrow keys. not only that, but it requires the use of “if <key> is pressed” block in an “if” block in order for the interaction to work. The problem is that in the context of my project, the only way I can get it to work is through the use of a forever block.

Here is my project:
https://scratch.mit.edu/projects/163131771/#editor

Thanks everyone!
This is not the only way… :
when [ x] key pressed
repeat until <not <key [ x] pressed?>>
your block
end
deck26
Scratcher
1000+ posts

Up and Down Arrow Key Problem

Mustafatheshark wrote:

OK LISTEN MY FREAKING ARRPWS ONT WORK AND I NEED SOME HELP
1. Please create your own new topic rather than necroposting

2. Please don't post in all-capitals which is considered the same as shouting

3. Give more information and share the project or we can only guess

4. Be polite.

Powered by DjangoBB