ScratchData LogoScratchData
Back to Locomule's profile

demo - setting player direction to closest enemy clone

LOLocomule•Created May 11, 2023
demo - setting player direction to closest enemy clone
9
9
137 views
View on Scratch

Instructions

WASD or arrows to walk the player around Check out the code to see how this system works, it is pretty simple.

Description

The explanation is that the Target resets a distance check variable then makes a broadcast, all the clones quickly check their distance to the player and writing their location data to variables if they are closest, then the Target goes to that location, For game usage the Target would be ghosted 100% To add leading for player projectile shots have each clone temporarily move ahead a distance relative to its distance from the player before writing its X/Y positions, then jump back. Don't forget to an If On edge Bounce block to that routine or the player may aim wide at clones on the verge of hitting an edge.

Project Details

Project ID848896617
CreatedMay 11, 2023
Last ModifiedOctober 24, 2024
SharedMay 11, 2023
Visibilityvisible
CommentsAllowed