BlocosIA Wiki Editor

Vehicles and Combat

Tanks and cars: aim with smooth turning, use image points (barrel tip, turret mount) and attach one part to another.

Cloning the chassis also clones the turret and barrel attached to it, with their code ("when I start as a clone"). For robot tanks, combine with the Robot and sensors extension: the motors move the chassis and the turret follows. Mark points in the paint editor ("Image points" tool, P key). E.g. on the chassis a point "turret"; on the barrel a point "tip". On the turret use "attach my position to point turret of Chassis and turn along: no" and, inside a "forever", "smoothly turn toward mouse pointer". Attaching is applied at drawing time, with no lag.

To use it: in the editor, click "Extensions" (bottom corner) and add "Vehicles and Combat".

Stack

smoothly turn toward [ ▾ ] up to ( ) degrees at a time

Does an action. Snap it below another block.

Stack

smoothly turn toward x: ( ) y: ( ) up to ( ) degrees at a time

Does an action. Snap it below another block.

Stack

smoothly turn to direction ( ) up to ( ) degrees at a time

Does an action. Snap it below another block.

Reporter

direction to [ ▾ ]

Gives a number or text. Put it inside a round slot.

Reporter

turn left to face [ ▾ ]

Gives a number or text. Put it inside a round slot.

Boolean

aiming at [ ▾ ] within ( ) degrees?

Answers true or false. Use it in "if", "repeat until" and "wait until".

Stack

drive: move ( ) steps and turn ( ) degrees

Does an action. Snap it below another block.

Reporter

[x] of my point [ ▾ ]

Gives a number or text. Put it inside a round slot.

Reporter

[x] of point [ ▾ ] of [ ▾ ]

Gives a number or text. Put it inside a round slot.

Stack

go to point [ ▾ ] of [ ▾ ]

Does an action. Snap it below another block.

Stack

create clone of [ ▾ ] at my point [ ▾ ] pointing my direction

Does an action. Snap it below another block.

Boolean

I have point [ ▾ ] ?

Answers true or false. Use it in "if", "repeat until" and "wait until".

Stack

attach my position to point [ ▾ ] of [ ▾ ] and turn along: [yes]

Does an action. Snap it below another block.

Stack

attach [ ▾ ] to point [ ▾ ] of [ ▾ ] and turn along: [yes]

Does an action. Snap it below another block.

Stack

detach [ ▾ ]

Does an action. Snap it below another block.

Boolean

am I attached to another sprite?

Answers true or false. Use it in "if", "repeat until" and "wait until".

Stack

when cloning me, bring the parts attached to me: [yes]

Chooses whether cloning this sprite also clones the parts attached to it (turret, barrel). Default is yes.

Stack

smoothly turn toward the nearest [ ▾ ] up to ( ) degrees at a time

Turns little by little toward the nearest sprite with that name, counting clones.

Reporter

[distance] of the nearest [ ▾ ]

Distance, direction, x, y or how much to turn to the nearest sprite (clones count).

Reporter

number of [ ▾ ] on stage (with clones)

How many sprites with that name are visible, counting clones.

Boolean

radar: do I see [ ▾ ] within ( ) steps and ( ) degrees?

True if a target is near, inside the angle in front and with no wall in between.

Stack

set my health to ( ) (max ( ))

Sets the vehicle's health and max health (stored on the main part, the chassis).

Stack

show health bar: [yes]

Shows a small health bar above the vehicle.

Stack

deal ( ) damage to [ ▾ ] I am touching

Takes health from each vehicle with that name this sprite is touching (touching the turret counts too).

Stack

take ( ) damage

Takes health from my own vehicle.

Stack

heal ( ) health

Gives health back to my vehicle, up to the max.

Reporter

[my health]

Current health, max health or the percentage.

Hat

when I take damage

Starts when my vehicle takes damage (works for all its parts).

Hat

when my health runs out

Starts when my vehicle's health reaches zero. In a clone, use "delete this clone": the parts go too.