Discuss Scratch

THEPUG_GAMER
Scratcher
7 posts

How to make clones go to clones

I am making a game where collectibles (clones) can spawn. If you don´t collect one within 5 seconds, they despawn and create bullets that move outwards. Unfortunately, I do not know how to make the clones of the bullets to go to the position of the collectible clones. If you could help me with this, I would appreciate it.

Last edited by THEPUG_GAMER (Oct. 17, 2022 16:14:14)

2dav
Scratcher
91 posts

How to make clones go to clones

You could use the “point in direction (sprite)” block or “glide(whatever) seconds to (sprite)? Does this help?
THEPUG_GAMER
Scratcher
7 posts

How to make clones go to clones

2dav wrote:

You could use the “point in direction (sprite)” block or “glide(whatever) seconds to (sprite)? Does this help?
If I tried to do that. It would go the original sprite. I´m trying to make it go the clone that triggered it.
enalecks
Scratcher
15 posts

How to make clones go to clones

THEPUG_GAMER wrote:

2dav wrote:

You could use the “point in direction (sprite)” block or “glide(whatever) seconds to (sprite)? Does this help?
If I tried to do that. It would go the original sprite. I´m trying to make it go the clone that triggered it.

on the cloned sprite:

when green flag clicked
create clone of [myself]

when I start as a clone
forever
set [clone x] to (x position)
set [clone y] to (y position)
end

on the sprite going to the clone:

when green flag clicked
forever
go to x: (clone x) y: (clone y)
end

hopefully that's what you meant
THEPUG_GAMER
Scratcher
7 posts

How to make clones go to clones

enalecks wrote:

THEPUG_GAMER wrote:

2dav wrote:

You could use the “point in direction (sprite)” block or “glide(whatever) seconds to (sprite)? Does this help?
If I tried to do that. It would go the original sprite. I´m trying to make it go the clone that triggered it.

on the cloned sprite:

when green flag clicked
create clone of [myself]

when I start as a clone
forever
set [clone x] to (x position)
set [clone y] to (y position)
end

on the sprite going to the clone:

when green flag clicked
forever
go to x: (clone x) y: (clone y)
end

hopefully that's what you meant
Sorry, but I decided to change it
THEPUG_GAMER
Scratcher
7 posts

How to make clones go to clones

THEPUG_GAMER wrote:

enalecks wrote:

THEPUG_GAMER wrote:

2dav wrote:

You could use the “point in direction (sprite)” block or “glide(whatever) seconds to (sprite)? Does this help?
If I tried to do that. It would go the original sprite. I´m trying to make it go the clone that triggered it.

on the cloned sprite:

when green flag clicked
create clone of [myself]

when I start as a clone
forever
set [clone x] to (x position)
set [clone y] to (y position)
end

on the sprite going to the clone:

when green flag clicked
forever
go to x: (clone x) y: (clone y)
end

hopefully that's what you meant
Sorry, but I decided to change it I removed the collection part and just made it a bullet bomb. You can still collect the bananas though.
cs2722201
Scratcher
100+ posts

How to make clones go to clones

ScratchDev32
Scratcher
1 post

How to make clones go to clones

The
atreides-pao
New Scratcher
1 post

How to make clones go to clones

enalecks wrote:

THEPUG_GAMER wrote:

2dav wrote:

You could use the “point in direction (sprite)” block or “glide(whatever) seconds to (sprite)? Does this help?
If I tried to do that. It would go the original sprite. I´m trying to make it go the clone that triggered it.

on the cloned sprite:

when green flag clicked
create clone of [myself]

when I start as a clone
forever
set [clone x] to (x position)
set [clone y] to (y position)
end

on the sprite going to the clone:

when green flag clicked
forever
go to x: (clone x) y: (clone y)
end

hopefully that's what you meant

Last edited by atreides-pao (Dec. 5, 2024 04:43:27)

ametrine_
Scratcher
1000+ posts

How to make clones go to clones

ScratchDev32 wrote:

The

atreides-pao wrote:

-snip-
please don't necropost
JustPeaceMaker
Scratcher
5 posts

How to make clones go to clones

when green flag clicked
delete this list of [cloned x positions v]
delete this list of [cloned y positions v]
forever
wait (0.1) seconds
delete this list of [cloned x positions v]
delete this list of [cloned y positions v]
repeat (number of clones)
add (x position of [cloned sprite v]) to [cloned x positions v]
add (y position of [cloned sprite v]) to [cloned y positions v]
end
if <(distance to (item (1) of [cloned x positions v]) (item (1) of [cloned y positions v])) > (5)>
turn towards (item (1) of [cloned x positions v]) (item (1) of [cloned y positions v])
move (5) steps
end

Last edited by JustPeaceMaker (Dec. 31, 2024 10:42:06)

ohioguy123cool
Scratcher
2 posts

How to make clones go to clones

move (10) steps
abrakaidabra
Scratcher
500+ posts

How to make clones go to clones

ohioguy123cool wrote:

move (10) steps
Please don’t necropost. If you want to test scratchblocks, there is an official sticky at the top of the help with scripts forum.
cosmosaura
Scratch Team
1000+ posts

How to make clones go to clones

Topic closed due to necroposting.

Powered by DjangoBB