Object Repulsion
Материал из Поле цифровой дидактики
Object Repulsion is the act of repulsing or repelling an object. Listed below are two methods of replicating this effect in Scratch. Шаблон:Tip
Velocity Method
The Velocity Method uses the following scripts to automatically make objects change their X and Y Velocity based upon their position. This script can go into any object that is being repelled. This method is more advanced than the next method, however this method is better in most situations.
An example can be seen here.
Direct Movement Method
The Direct Movement Method uses the scripts below to move and rotate based on its position. This method is basic, but very effective in doing its job.
An example can be seen here.