ScratchData LogoScratchData
Back to kriblo_test's profile

Example: Food / Feeder Clones

KRkriblo_test•Created March 24, 2022
Example: Food / Feeder Clones
19
10
157 views
View on Scratch

Instructions

This project is a demo of how the 'touching+closest clone' method might be used to manage clone interaction (see original project). Red dots are Feeders, green dots are Food. Feeders use the touching-block to detect collision with Food, and global lists to determine which of the Food clones is the closest. It (the Feeder clone) then uses the global lists to calculate direction to the closest Food clone, and to decrease the size of that Food clone. All code by me (@kriblo). FROM THE ORIGINAL PROJECT: "...a more or less generic and more or less accurate method to keep track of which clones are touching which other clones, including clones of different sprites. This method uses global lists of clone coordinates. Each clone checks if it touches other clones, and calculate which of those is the closest." This example could be optimized... for instance, the Feeders don't need to (shouldn't) check if they're touching other feeders. But I didn't want to change the original (generic) code more than necessary.

Project Details

Project ID665020766
CreatedMarch 24, 2022
Last ModifiedJune 13, 2022
SharedMarch 24, 2022
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root