From Test-Scratch-Wiki

当分身产生
當分身產生
类别 控制类积木
形狀 半圆形积木
加入於 2.0

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.

In Scratch 2.0, this is the only Hat block in the Control palette; all the others are in 事件类积木, 马达, or PicoBoard.

The original name of the block

用法示例

分身 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.

参见

Cookies help us deliver our services. By using our services, you agree to our use of cookies.