Discuss Scratch

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:
forever
go to [mouse-pointer v]
point towards [mouse-pointer v]
end
Please help, it's a movement script I tried making and got the idea.
Valkway
Scratcher
71 posts

I need help

Anyone?
-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

-Qlec- wrote:

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

Oumuamua wrote:

Perhaps…

forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
I'll try…
Burnt-Butter-Toast
Scratcher
78 posts

I need help

Oumuamua wrote:

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:

forever
Move towards mouse (Number Var)
end
or just the block
Valkway
Scratcher
71 posts

I need help

Burnt-Butter-Toast wrote:

Oumuamua wrote:

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:

forever
Move towards mouse (Number Var)
end
or just the block
Is it mobile friendly?

Last edited by Valkway (Oct. 14, 2022 16:50:39)

Burnt-Butter-Toast
Scratcher
78 posts

I need help

I

Valkway wrote:

Burnt-Butter-Toast wrote:

Oumuamua wrote:

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:

forever
Move towards mouse (Number Var)
end
or just the block
Is it mobile friendly?

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

Burnt-Butter-Toast wrote:

I

Valkway wrote:

Burnt-Butter-Toast wrote:

Oumuamua wrote:

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:

forever
Move towards mouse (Number Var)
end
or just the block
Is it mobile friendly?

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.
mBlock is worse than that, it has a badder UI.
Valkway
Scratcher
71 posts

I need help

Oumuamua wrote:

Perhaps…

forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
Doesn't work, it doesn't point towards the mouse pointer.
Oumuamua
Scratcher
1000+ posts

I need help

Valkway wrote:

Oumuamua wrote:

Perhaps…

forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) > [5]> then
move (5) steps
end
end
Doesn't work, it doesn't point towards the mouse pointer.


???

https://scratch.mit.edu/projects/745745564/editor/

Try setting the rotation style to all around….

Powered by DjangoBB