The When I Start as a Clone 積木 is a 控制類積木 and a 半圓形積木. It was originally called Clone Startup, but was likely renamed to clear up confusion on what the block did. It activates in a 分身 when it gets created.
分身 are often meant to do an action when created, rather than waiting for a different 事件. They allow for multiple copies of a sprite without having to duplicate it and all its properties. When I Start as a Clone is the hat block of the scripts that will perform in the clone once it is created. There can be multiple of this block in the same sprite; the clone will just run all of the scripts simultaneously. The script itself can be running on multiple clones at once. Some of such actions that this block can perform include:
- Position a clone randomly
當分身產生 定位到 x: (隨機取數 (-240) 到 (240)) y: (隨機取數 (-180) 到 (180))
In reading this, when the clone is created, it will set its x and y 座標 to any location on the stage.
- Make a clone travel until colliding with another sprite
當分身產生 重複直到 <碰到 [角色 2 v] ?> 移動 (3) 點 end
In reading this, the clone will travel until It hits the specified sprite, in this case "sprite 2". This is useful in game where objects must be launched in attempt to collide with another sprite.