Discuss Scratch

Gengarlover1000
Scratcher
16 posts

wierd mechanic needed for a game

I want to make a game where you have to keep a potato off the ground, you do that by dragging the mouse to an intended direction and it shows a line of where you want to point it, and the potato will go that direction. does anyone know how to do that
the code for it rn
when green flag clicked
forever
hide
if on edge, bounce
if <mouse down?> then
show
point towards [ mouse pointer]
end
end
The_Imaginarium
Scratcher
1000+ posts

wierd mechanic needed for a game

Do you have a specific problem?
Gengarlover1000
Scratcher
16 posts

wierd mechanic needed for a game

what was the point in that?
Jareddddddd
Scratcher
1000+ posts

wierd mechanic needed for a game

were not here to do the code for you, but rather to debug and help youre current code run better. We need a specific problem to resolve first to debug it
Jlerpy
Scratcher
1000+ posts

wierd mechanic needed for a game

Where is the line going to be within the game? Because as written, this will make it appear and swivel toward the pointer when you hold the mouse button down, then vanish as soon as you let go.

If you want that to influence the potato, you could give the potato a “point in direction”, then instead of a number, put in “direction of Line” (from Sensing), and a “move X steps” kind of motion (probably plus a “change y by -x” sort of gravity-esque motion.
Gengarlover1000
Scratcher
16 posts

wierd mechanic needed for a game

the little pointer when you hold down the mouse key, it will go opposite of where you move the mouse pointer, and it will only be a straight ine
Jlerpy
Scratcher
1000+ posts

wierd mechanic needed for a game

As in you hold the button down, then drag it, and the sprite moves in the opposite direction from the mouse pointer?
Gengarlover1000
Scratcher
16 posts

wierd mechanic needed for a game

yes

Powered by DjangoBB