Add a block to point at closest clone/ closest clone of a certain sprite
-
This could save so much effort into making a decent targeting system for top-down shooter games and stuff.
-
Can you describe in more detail what would be the input parameters and how the block would work?
-
@info-creaticode
So, as a block to fit in operators (for example: If touching - (closest clone of -sprite name-) then)Based on what the closest clone is, it would calculate the distance of the closest clone of the target Sprite from the clone or sprites location. Once the distance is calculated, then (As an example: See which clone is the closest, and if that distance is in a certain parameter of what Sprite is preforming the calculations with the block from where its at, then it would affect what code is gonna run.) it does the same for other clones of that target sprite, and changes the closest clone (use the ID for the number), accordingly when updating.
So, simply put, it calculates where all clones of a target sprite is at, stores the coordinates, repetitively updates, and then points at whatever clone is the closest to it. Now that I think about it, this might need multiple blocks for each function.
-
This needs some further discussion. Even if there is a block that returns the “clone ID” of the nearest clone of another sprite, you will still not know that clone’s x/y positions, right? So how would you calculate the distance to that clone?
-
@info-creaticode I have 2 solutions to that.
1: Have the find closest clone automatically log each clone’s x and y coordinates of the target sprite every time it’s run.
2: Add a block to calculate the positions of all clones of the target sprite.