Topic Information

Pointing Toward Clones by K3v_D3v in Help With Scripts

Posts: 14

1: K3v_D3v wrote at 12:07:07 AM 16/9/20204421442
What is the shortest possible way of making something point toward a clone? Thank you in advance.
2: MopperFat1 wrote at 12:33:58 AM 16/9/20204421485
Create a sprite with ghost effect set to 100, make it go to the clone, and have a sprite point at the ghost sprite.
3: griefercube wrote at 12:38:48 AM 16/9/20204421492
What about I have 50 clones and I need them to all point at 3 random spots(my boss fight game needs it)
4: K3v_D3v wrote at 12:43:11 AM 16/9/20204421502

griefercube wrote:

What about I have 50 clones and I need them to all point at 3 random spots(my boss fight game needs it)

Sorry to bother you, but if you want help you can make a new topic.
5: K3v_D3v wrote at 12:45:11 AM 16/9/20204421511

MopperFat1 wrote:

Create a sprite with ghost effect set to 100, make it go to the clone, and have a sprite point at the ghost sprite.

I will at least have 10 clones on the screen, all the time.
6: MopperFat1 wrote at 2:04:43 AM 16/9/20204421621
The ghost sprite option is the easiest to do. If the sprite will only point at one clone at a time, save the x and y positions of all the clones into a list and have the ghost sprite travel to different clones.
7: Just_ng wrote at 3:32:46 AM 16/9/20204421713
You must input the x pos and y pos of the clone to the list, and make a system that takes randomly which clone position will be chosen
8: SparshG wrote at 5:28:30 AM 16/9/20204421838
I don't know exactly what you want to do so here is what I can tell you:

basic principle:
store position of sprite in variables x, y and in the arrow sprite (that points towards the 1st sprite) paste this:

when I receive [point-now v]
if <(x) > [0]> then //where x and y is position where we have to point
point in direction ((180) - ([atan v] of ((x) / (y))))


else
point in direction ((10) - ([atan v] of ((x) / (y))))
end

Now for multiple clones, you can make a list storing their x and y positions like

item1 is x1 and item2 is y1 (for clone1)
item3 is x2 and item4 is y2 (for clone2)
item5 is x3 and item6 is y3 (for clone3)

once you got all positions you want to point to you can replace (x, y) in my script with (item1 of list, item2 of list) for clone1, similarly if you want to point towards clone2, replace (x, y) with (item3, item4)
If you want to point at multiple sprites at the same time you can make clones of arrow sprite and proceed similarly
9: deck26 wrote at 7:26:49 AM 16/9/20204421944
Search for ‘nearest clone’ to see different methods of checking positions of multiple clones.
10: Just_ng wrote at 9:26:23 AM 16/9/20204422077
This may help :
( assuming the clone is not moving places )

when I start as a clone
add (x position) to [list v]
add (y position) to [list v]

For the boss :

when I receive [anything or when green flag clicked v]
repeat until <((random clone) mod (2)) = [1]>
set [random clone v] to (pick random (1) to (length of [list v] :: list))
end
point in direction x = (item (random clone) of [list v] :: list) y = (item ((random clone) + (1)) of [list v] :: list)

define point in direction x = (x) y = (y)
point in direction ([atan v] of (((x) - (x position)) / ((y) - (y position))))


11: K3v_D3v wrote at 2:43:05 PM 16/9/20204422703
Hmmm, I have the sprite moving toward a clone, and the clones also moves, so… Anyways I'mm gonna try them out. Thank you
12: Just_ng wrote at 2:49:42 PM 16/9/20204422729
13: Just_ng wrote at 2:50:55 PM 16/9/20204422733

K3v_D3v wrote:

Hmmm, I have the sprite moving toward a clone, and the clones also moves, so… Anyways I'mm gonna try them out. Thank you

Can you give me the link? ( you don't need to share it ) I want to see how you did that!
14: K3v_D3v wrote at 2:56:57 PM 16/9/20204422750

Just_ng wrote:

K3v_D3v wrote:

Hmmm, I have the sprite moving toward a clone, and the clones also moves, so… Anyways I'mm gonna try them out. Thank you

Can you give me the link? ( you don't need to share it ) I want to see how you did that!

I meant that I wanted to not have, sry lol