Discuss Scratch

diegamer2325
Scratcher
6 posts

i'm trying to make a game but i can't figure it out. any help?

i'm trying to figure out how to make the tentacles follow the cursor, but if the cursor goes beneath the body it goes over the top. anyone able to help? i typed the code below.

when flag clicked
point in direction 90
go to x 0 y 0
go to Sprite2
set variable1 to direction
point towards mouse pointer
set variable2 to direction

many thanks

this is me when
deck26
Scratcher
1000+ posts

i'm trying to make a game but i can't figure it out. any help?

Best if you share the project - it makes it much easier to understand the problem.
diegamer2325
Scratcher
6 posts

i'm trying to make a game but i can't figure it out. any help?

deck26 wrote:

Best if you share the project - it makes it much easier to understand the problem.
link to the game

this is me when
Jereb-co7
Scratcher
100+ posts

i'm trying to make a game but i can't figure it out. any help?

diegamer2325 wrote:

i'm trying to figure out how to make the tentacles follow the cursor, but if the cursor goes beneath the body it goes over the top. anyone able to help? i typed the code below.

when flag clicked
point in direction 90
go to x 0 y 0
go to Sprite2
set variable1 to direction
point towards mouse pointer
set variable2 to direction

many thanks

Like This?

when green flag clicked
point in direction ( 90 )
go to x: (0) y: (0)
go to [ Sprite II ]
set [ var 1 ] to (direction)
point towards [ mouse_pointer ]
set [ var 2 ] to (direction)

Use Scratchblocks


Hi, I'm Jeremiah; A kid who likes coding. I want to help people and become successful. I pretty please want you to join a team called “Shappire games” to make projects I also want 200 followers at the end of 2022.

you wrote:

when green flag clicked
set [ I help you ] to [you help me]
if <( I help you ) = [you help me]> then
say [get scratchin'] for (2) secs
end
My account: Jereb-co7




Sincerely,


Jeremiah. B
diegamer2325
Scratcher
6 posts

i'm trying to make a game but i can't figure it out. any help?

new code

when flag clicked
point in direction (90)
go to x (0) y (0)
forever
go to [Sprite2]
set [variable1] to (direction)
point towards [mouse pointer]
set [variable2] to (direction)
point in direction ((((variable1) * (9)) + (variable2)) / (10))
move (40) steps
end

The sprite is now the other way around so it can be a joint thingy
link to the project

this is me when
deck26
Scratcher
1000+ posts

i'm trying to make a game but i can't figure it out. any help?

So what you're saying is you want to point towards the mouse but always move the sprite in the most efficient direction so it always turns 180 degrees or less. The calculations in this project https://scratch.mit.edu/projects/55006278 may help.

diegamer2325
Scratcher
6 posts

i'm trying to make a game but i can't figure it out. any help?

nvm figured it out

this is me when

Powered by DjangoBB