Discuss Scratch

JujuBeeMr
Scratcher
24 posts

help for games plz

hey yall i just need to ask how make sprites move, but they have to stick to a path. (for tpt) i tried
when green flag clicked
forever
repeat until <touching color [#0ff4a7] ?>
go to [random position v]
end

Last edited by JujuBeeMr (April 27, 2023 01:35:34)

BreadcatGames
Scratcher
1000+ posts

help for games plz

This should be in help with scripts
Mini_Man2013
Scratcher
100+ posts

help for games plz

u can do this:

when green flag clicked
forever
if <key [left v] pressed?> then
move left
end
if <key [right v] pressed?> then
move right
end
end
JujuBeeMr
Scratcher
24 posts

help for games plz

but i want the guest to be moved by ai not the player like what i have rn is
when green flag clicked
forever

glide (5) secs to x: (random position) y: (random position)
end

Last edited by JujuBeeMr (April 27, 2023 14:13:12)

JujuBeeMr
Scratcher
24 posts

help for games plz

Mini_Man2013 wrote:

u can do this:

when green flag clicked
forever
if <key [left v] pressed?> then
move left
end
if <key [right v] pressed?> then
move right
end
end
that would make it so the player moves it
Mini_Man2013
Scratcher
100+ posts

help for games plz

JujuBeeMr wrote:

Mini_Man2013 wrote:

u can do this:

when green flag clicked
forever
if <key [left v] pressed?> then
move left
end
if <key [right v] pressed?> then
move right
end
end
that would make it so the player moves it
k
Kites2022-2023
Scratcher
7 posts

help for games plz

JujuBeeMr wrote:

hey yall i just need to ask how make sprites move, but they have to stick to a path. (for tpt) i tried
when green flag clicked
forever
repeat until <touching color [#0ff4a7] ?>
go to [random position v]
end






[/quote]
Nice Try,
To make a sprite move copy the code bellow:
when this sprite clicked
move (amount) steps

or

when green flag clicked
move (amount) steps

or

when [KEY v] key pressed
move (amount) steps
Kites2022-2023
Scratcher
7 posts

help for games plz

JujuBeeMr wrote:

hey yall i just need to ask how make sprites move, but they have to stick to a path. (for tpt) i tried
when green flag clicked
forever
repeat until <touching color [#0ff4a7] ?>
go to [random position v]
end






[/quote]
Nice Try,
To make a sprite move copy the code bellow:
when this sprite clicked
move (amount) steps

or

when green flag clicked
move (amount) steps

or

when [KEY v] key pressed
move (amount) steps
JujuBeeMr
Scratcher
24 posts

help for games plz

Kites2022-2023 wrote:

JujuBeeMr wrote:

hey yall i just need to ask how make sprites move, but they have to stick to a path. (for tpt) i tried
when green flag clicked
forever
repeat until <touching color [#0ff4a7] ?>
go to [random position v]
end






[/quote]
Nice Try,
To make a sprite move copy the code bellow:
when this sprite clicked
move (amount) steps

or

when green flag clicked
move (amount) steps

or

when [KEY v] key pressed
move (amount) steps[/quote]
I NEED THERE MOVE MENT TO BE AI GENERATED BUT STILL STICK TO A PATHH
JujuBeeMr
Scratcher
24 posts

help for games plz

AIGHT PEOPLE SINCE IT SEEMS NO ONE KNOWS HOW TO DO THIS, I OFFER REWARD. FIRST PERSON TO FIND OUT HOW TO MAKE GUEST MOVE RANDOMLY BUT STICK TO A PATH WINS A FOLLOW ALSO THE PATH IS NOT A SPRITE. https://media.tenor.com/hhaL2BZOw84AAAAd/leg-dog.gif///https://media.tenor.com/hhaL2BZOw84AAAAd/leg-dog.gif/// and lastly to advertise for scratch,
when green flag clicked
forever
imagine program share
end

Last edited by JujuBeeMr (April 29, 2023 18:10:55)

JujuBeeMr
Scratcher
24 posts

help for games plz

hey yall im back and worrkin! yall, let me just say, ITS SO FUN TO MAKE REWIND btw advertise and i will play your games
PaperAviator
Scratcher
32 posts

help for games plz

how is the path defined? is it just a area of color in a sprite or background or something?
medians
Scratcher
1000+ posts

help for games plz

Can you send the link to the project please so we can help and not have to guess the solution?

JujuBeeMr wrote:

but i want the guest to be moved by ai not the player like what i have rn is
when green flag clicked
forever

glide (5) secs to x: (random position) y: (random position)
end
I think you mean like this:
glide (5) secs to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
coIIide
Scratcher
100+ posts

help for games plz

medians wrote:

Can you send the link to the project please so we can help and not have to guess the solution?

JujuBeeMr wrote:

but i want the guest to be moved by ai not the player like what i have rn is
when green flag clicked
forever

glide (5) secs to x: (random position) y: (random position)
end
I think you mean like this:
glide (5) secs to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
It's not glide, it's go to, plus
go to [random position v]
and
glide (1) secs to (random position v) :: motion
both exist in 3.0.
medians
Scratcher
1000+ posts

help for games plz

coIIide wrote:

medians wrote:

Can you send the link to the project please so we can help and not have to guess the solution?

JujuBeeMr wrote:

but i want the guest to be moved by ai not the player like what i have rn is
when green flag clicked
forever

glide (5) secs to x: (random position) y: (random position)
end
I think you mean like this:
glide (5) secs to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
It's not glide, it's go to, plus
go to [random position v]
and
glide (1) secs to (random position v) :: motion
both exist in 3.0.
Oh my god okay I was confused because of the fact they put that, and I completely forgot that they implemented the glide to sprite/random pos/mouse block
Mini_Man2013
Scratcher
100+ posts

help for games plz

JujuBeeMr wrote:

Mini_Man2013 wrote:

u can do this:

when green flag clicked
forever
if <key [left v] pressed?> then
move left
end
if <key [right v] pressed?> then
move right
end
end
that would make it so the player moves it
ik but it will stick to the path
quackTWO
Scratcher
29 posts

help for games plz

JujuBeeMr wrote:

AIGHT PEOPLE SINCE IT SEEMS NO ONE KNOWS HOW TO DO THIS, I OFFER REWARD. FIRST PERSON TO FIND OUT HOW TO MAKE GUEST MOVE RANDOMLY BUT STICK TO A PATH WINS A FOLLOW ALSO THE PATH IS NOT A SPRITE. https://media.tenor.com/hhaL2BZOw84AAAAd/leg-dog.gif///https://media.tenor.com/hhaL2BZOw84AAAAd/leg-dog.gif/// and lastly to advertise for scratch,
when green flag clicked
forever
imagine program share
end

Make a list with all of the coordinates for the “path”. Make an X and Y list to separate them. Make the character move across the path, changing the index number by either 1 or -1. Make a variable for the index, and change it by a pick random every time he arrives at a place. This will make it so it doesn’t go off the path. Attach both the X value at the index and the Y value at the index to a glide object and your done

glide (1) secs to x: (item ((idxv) of [x v] :: list) y: (item ((idxv) of [y v] :: list)

Last edited by quackTWO (May 8, 2023 08:51:08)

JujuBeeMr
Scratcher
24 posts

help for games plz

quackTWO wrote:

JujuBeeMr wrote:

AIGHT PEOPLE SINCE IT SEEMS NO ONE KNOWS HOW TO DO THIS, I OFFER REWARD. FIRST PERSON TO FIND OUT HOW TO MAKE GUEST MOVE RANDOMLY BUT STICK TO A PATH WINS A FOLLOW ALSO THE PATH IS NOT A SPRITE. https://media.tenor.com/hhaL2BZOw84AAAAd/leg-dog.gif///https://media.tenor.com/hhaL2BZOw84AAAAd/leg-dog.gif/// and lastly to advertise for scratch,
when green flag clicked
forever
imagine program share
end

Make a list with all of the coordinates for the “path”. Make an X and Y list to separate them. Make the character move across the path, changing the index number by either 1 or -1. Make a variable for the index, and change it by a pick random every time he arrives at a place. This will make it so it doesn’t go off the path. Attach both the X value at the index and the Y value at the index to a glide object and your done

glide (1) secs to x: (item ((idxv) of [x v] :: list) y: (item ((idxv) of [y v] :: list)


let me clairify, the path is not a sprite. it is made by pen. although i like how much effort your putting in this!
JujuBeeMr
Scratcher
24 posts

help for games plz

PaperAviator wrote:

how is the path defined? is it just a area of color in a sprite or background or something?


its pen so……. just color yes
JujuBeeMr
Scratcher
24 posts

help for games plz

more help plz. soooo for some dumb reason the switch costume block isnt working! ik it isnt a script messing it upp bc i made a detector! its for a game jam so i need help quick! what i have rn is
when [ space v] key pressed
[scratchblocks]

if <[player] = [2]> then
switch costume to [ my oc- attack v]
play sound [ hup v]
switch costume to [ my oc- neutral v]
end
[/scratchblocks]

Last edited by JujuBeeMr (May 10, 2023 03:36:36)

Powered by DjangoBB