Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help
- Valkway
-
Scratcher
71 posts
I need help
So I've been working on this new project, it's based off Lemonoids by griffpatch, and this code doesn't work:
foreverPlease help, it's a movement script I tried making and got the idea.
go to [mouse-pointer v]
point towards [mouse-pointer v]
end
- -Qlec-
-
Scratcher
100+ posts
I need help
What exactly are you trying to accomplish? The way you coded it, you basically made something that is always at your mouse position.
- Valkway
-
Scratcher
71 posts
I need help
What exactly are you trying to accomplish? The way you coded it, you basically made something that is always at your mouse position.I mean
when green flag clicked
forever
glide (1) secs to x: (mouse-pointer v)
end
- Oumuamua
-
Scratcher
1000+ posts
I need help
Perhaps…
forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
- Valkway
-
Scratcher
71 posts
I need help
Perhaps…I'll try…forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
- Burnt-Butter-Toast
-
Scratcher
78 posts
I need help
Perhaps…forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
And if you want to edit it (quicker):
define Move towards mouse (Move)
forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
end
end
Or:
define Move towards mouse (Move)
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
So when you need to quickly change it just:
foreveror just the block
Move towards mouse (Number Var)
end
- Valkway
-
Scratcher
71 posts
I need help
Is it mobile friendly?Perhaps…forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
And if you want to edit it (quicker):define Move towards mouse (Move)
forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
end
end
Or:define Move towards mouse (Move)
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
So when you need to quickly change it just:foreveror just the block
Move towards mouse (Number Var)
end
Last edited by Valkway (Oct. 14, 2022 16:50:39)
- Burnt-Butter-Toast
-
Scratcher
78 posts
I need help
I
As long as it still points to the mouse/goes to mouse when you touch the screen, yes
And one thing, for mobile, if you have an android, I recommend PictoBlox, almost exactly like Scratch, but with a worse UI.
Is it mobile friendly?Perhaps…forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
And if you want to edit it (quicker):define Move towards mouse (Move)
forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
end
end
Or:define Move towards mouse (Move)
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
So when you need to quickly change it just:foreveror just the block
Move towards mouse (Number Var)
end
As long as it still points to the mouse/goes to mouse when you touch the screen, yes
And one thing, for mobile, if you have an android, I recommend PictoBlox, almost exactly like Scratch, but with a worse UI.
- Valkway
-
Scratcher
71 posts
I need help
ImBlock is worse than that, it has a badder UI.Is it mobile friendly?Perhaps…forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
And if you want to edit it (quicker):define Move towards mouse (Move)
forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
end
end
Or:define Move towards mouse (Move)
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > (Move)> then
move (Move) steps
So when you need to quickly change it just:foreveror just the block
Move towards mouse (Number Var)
end
As long as it still points to the mouse/goes to mouse when you touch the screen, yes
And one thing, for mobile, if you have an android, I recommend PictoBlox, almost exactly like Scratch, but with a worse UI.
- Valkway
-
Scratcher
71 posts
I need help
Perhaps…Doesn't work, it doesn't point towards the mouse pointer.forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
- Oumuamua
-
Scratcher
1000+ posts
I need help
Perhaps…Doesn't work, it doesn't point towards the mouse pointer.forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
???
https://scratch.mit.edu/projects/745745564/editor/
Try setting the rotation style to all around….
- Discussion Forums
- » Help with Scripts
-
» I need help