Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Trying to sense the position of the mouse
- pbtechteach
- New to Scratch
2 posts
Trying to sense the position of the mouse
Just trying to figure out why my test variable never sets to 1. I feel like it should switch to 1 when the mouse is on the left side of the screen.
when green flag clicked
forever
if <(mouse x) < [0]> then
set [ test] to [1]
end
set [ test] to [0]
end
Last edited by pbtechteach (April 18, 2021 17:04:41)
- Yoosle
- Scratcher
81 posts
Trying to sense the position of the mouse
if <(mouse x) > [0]> then
else
end
- Yoosle
- Scratcher
81 posts
Trying to sense the position of the mouse
test variable never sets to 1. I feel like it should switch to 1 when the mouse is on the left side of the screen.Just trying to figure out why mywhen green flag clicked
forever
if <(mouse x) < [0]> then
set [ test] to [1]
end
set [ test] to [0]
end
also you are literally just setting the variable to 0 at the end of the loop so that even if it was 1 it changed instantly
- pbtechteach
- New to Scratch
2 posts
Trying to sense the position of the mouse
Thanks. Yeah, that's exactly it.
Wow, it's been a rough morning, haha
Wow, it's been a rough morning, haha
- Discussion Forums
- » Help with Scripts
- » Trying to sense the position of the mouse