BlocosIA Wiki Editor

Robot tanks: clones with parts and health

Cloning the chassis clones the turret too; robot sensors ignore their own parts.

Clone the whole vehicle

When a part is attached to another (turret on the chassis, barrel on the turret), create clone of the chassis also creates a clone of each attached part, already fixed to the new clone. Each part clone runs its own when I start as a clone. When the chassis clone is deleted, the parts go too. To turn this off, use when cloning me, bring the parts attached to me: no.

Inside a clone, Vehicle blocks that ask for a sprite (e.g. "point turret of Chassis") use the chassis of that same clone.

Robot + Vehicles

  • Use the motors of the Robot and sensors extension on the chassis (or drive with arrow keys). The attached turret follows by itself.
  • The ultrasonic and the sensors ignore the robot's own parts, but see the other robots.
  • sprite seen by sensor tells who is in front.

Combat

  • set my health to 3 (max 3) and show health bar: yes.
  • On the bullet: deal 1 damage to Enemy I am touching. Touching the turret counts too.
  • when I take damage and when my health runs out (in a clone: delete this clone).
  • smoothly turn toward the nearest …, radar (no wall in between) and number of … (with clones) for enemy waves.

See the example Robot Tank Arena.

Open in the editor