Discuss Scratch

UrAverageScracher
Scratcher
8 posts

[Go to mouse-pointer] not working

Greeting! I'm trying to make a throwable ball in Scratch. I'm finished with the overall ball physics but whenever I grab the ball while it is in mid air, it would slowly droop downwards even though the block is being repeated.

Here's the link to my project: https://scratch.mit.edu/projects/191151502/
jakel181
Scratcher
1000+ posts

[Go to mouse-pointer] not working

Hmm. this is wired just took a look at a your code it's very clever though.

Disco Calculator | Is it Prime?
Translate The SDS | The Scratch Wiki

define How to scratch
think [Creative]
This message was transmitted using 100% recycled electrons
;
asivi
Scratcher
1000+ posts

[Go to mouse-pointer] not working

when green flag clicked
go to x: (0) y: (-90)
forever
if <touching [mouse-pointer v] ?> then
repeat until <not <mouse down?>>
go to [mouse-pointer v]
set [X Vel v] to (((mouse x) - (mouseX)) / (5))
set [mouseX v] to (mouse x)
broadcast [message1 v]
end
end
end
Charles12310
Scratcher
1000+ posts

[Go to mouse-pointer] not working

asivi wrote:

when green flag clicked
go to x: (0) y: (-90)
forever
if <touching [mouse-pointer v] ?> then
repeat until <not <mouse down?>>
go to [mouse-pointer v]
set [X Vel v] to (((mouse x) - (mouseX)) / (5))
set [mouseX v] to (mouse x)
broadcast [message1 v]
end
end
end
I understand. There was no boolean that detected a mouse down, it only detected if a mouse isn't down. The repeat script skipped because the entire script did not detect a mouse down.

This should work:

when green flag clicked
go to x: (0) y: (-90)
forever
if <<mouse down?> and <touching [mouse-pointer v] ?>> then
repeat until <not <mouse down?>>
go to [mouse-pointer v]
set [X Vel v] to (((mouse x) - (mouseX)) / (5))
set [mouseX v] to (mouse x)
broadcast [message1 v]
end
end
end


A few internet communication companies want to corrupt the internet by getting rid of net neutrality. Stop Them!
asivi
Scratcher
1000+ posts

[Go to mouse-pointer] not working

@Charles12310 you don't need a double check for mouse down.
Greets.

Powered by DjangoBB