Top Down Library

Top Down Control Blocks

What are Top Down Control Blocks?

This is a category of Top Down Code Blocks designed to work with key pressed events. Players can use them to create custom controls for their Level Editor Characters.


{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"}

Attack

"Attack" will make an actor perform a close-range attack in the direction that the actor is facing. It will work best when attached to a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"a"}]}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::attack","label":"attack"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"}

Spin Attack

"Spin Attack" will make an actor perform a spinning attack that will damage multiple nearby enemies all around the actor. It will work best when attached to a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"d"}]}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::spin attack","label":"spin attack"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"}

Shoot Arrow

"Shoot Arrow" makes an actor shoot out an arrow in the direction that the actor is facing. The block will work best when attached to a key-pressed event.

Parameters:

Distance: this parameter determines how far the arrow will travel from the actor.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"a"}]}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}","values":[{"type":"string","value":"300"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"}

Shield Bash

"Shield Bash" will make an actor perform a close-range stun-attack in the direction that it is facing. Stunned enemies will be momentarily immobile. It will work best when attached to a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"a"}]}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::shield bash","label":"shield bash"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"}

Throw Bomb

"Throw Bomb" makes an current actor shoot out a bomb in the direction that the actor is facing. Bombs damage all actors near the explosion. The block will work best when attached to a key-pressed event.

Parameters:

Distance: this parameter determines how far the bomb will travel from the actor.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"b"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}","values":[{"type":"string","value":"200"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"}

Cast Fireball

"Cast Fireball" makes an actor shoot out a fireball in the direction that the actor is facing. The fireball can damage and go through multiple enemies. The block will work best when attached to a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Sample Code:
{"func":"registerTrigger","values":[{"type":"wrapper","func":"valueSensingMouseDown"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpNot","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"mouse-pointer"}]}]}],"containers":[{"func":"blockMotionPointTowards","values":[{"type":"string","value":"mouse-pointer"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::cast fireball","label":"cast fireball"}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"}

Jump Attack

"Jump Attack" will make an actor jump in the direction the actor is facing and damage nearby enemies where the actor lands. The block will work best when attached to a key-pressed event.

Parameters:

Distance: this parameter determines how far the actor will jump.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlIfElse","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"string","value":"300"},{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]}]}],"containers":[{"func":"blockMotionPointTowards","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}","values":[{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]}]}},{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::run attack enemies","label":"run attack enemies {string:range}","values":[{"type":"string","value":"200"}]}],"containerLabels":[{"type":"wrapper","func":"nop","values":[],"labelText":"else {button:add}"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::heal","label":"heal {string:actor}"}

Heal

"Heal" makes an actor change the health of (or heal) another actor.

Parameters:

Actor: set this parameter to the name of the actor who will be healed.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::attack","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::spin attack","label":"spin attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow","label":"shoot arrow {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::shield bash","label":"shield bash"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::throw bomb","label":"throw bomb {string:distance}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball","label":"cast fireball"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"heal"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::heal","label":"heal {string:actor}","values":[{"type":"string","value":"wizard"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"}

Closest Ally

"Closest Ally" will return the name of the closest ally to the actor. It can be placed inside other blocks and used as a variable.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::become good guy","label":"become good guy"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::become bad guy","label":"become bad guy"}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"h"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::heal","label":"heal {string:actor}","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}

Closest Enemy

"Closest Enemy" will return the name of the closest enemy to the actor. It can be placed inside other blocks and used as a variable.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::become good guy","label":"become good guy"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::become bad guy","label":"become bad guy"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlIfElse","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"string","value":"300"},{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]}]}],"containers":[{"func":"blockMotionPointTowards","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}","values":[{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]}]}},{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::run attack enemies","label":"run attack enemies {string:range}","values":[{"type":"string","value":"200"}]}],"containerLabels":[{"type":"wrapper","func":"nop","values":[],"labelText":"else {button:add}"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::move with key","label":"move with key {string:speed}"}

Move With Key

"Move With Key" makes an Actor move as long as the last key pressed is held down. The block will work best when attached to a key-pressed event.

Parameters:

Speed: this parameter determines how fast the actor moves.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::move","label":"move {string:speed}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::move distance","label":"move distance {string:distance} {string:speed}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"left arrow"}]}],"containers":[{"func":"blockMotionPointDirection","values":[{"type":"string","value":-90}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::move with key","label":"move with key {string:speed}","values":[{"type":"string","value":"5"}]}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::block while key pressed","label":"block while key pressed"}

Block While Key Pressed

"Block While Key Pressed" allows an actor to stop all damage coming from the direction the actor is facing. The actor will stop all damage as long as the last key that was pressed is held down. The block will work best when attached to a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::block for","label":"block for {string:sec}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForeverIf","values":[{"type":"wrapper","func":"valueSensingKeyPressed","values":[{"type":"choice","value":"s"}]}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::block while key pressed","label":"block while key pressed"}]}} Add to my Backpack



Top Down Automation Blocks

What are Top Down Automation Blocks?

This is a category of top down blocks used to make Level Editor Characters work automatically. Players can use them to create scripted behavior.


{"func":"blockControlCallLibrary","name":"tynker.topdown::block for","label":"block for {string:sec}"}

Block For

"Block For" makes an actor stop any damage coming from the direction the actor is facing.

Parameters:

Sec: this parameter determines how many seconds the actor will block for.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::block while key pressed","label":"block while key pressed"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"string","value":"100"},{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]}]}],"containers":[{"func":"blockMotionPointTowards","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::block for","label":"block for {string:sec}","values":[{"type":"string","value":"3"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::attack","label":"attack"}}}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow at enemies","label":"shoot arrow at enemies {string:range}"}

Shoot Arrow At Enemies

"Shoot Arrow At Enemies" makes an actor automatically shoot arrows at nearby enemies. The actor will pause any other movement code it has in order to attack.

Parameters:

Range: this parameter determines how far an enemy needs to be before attacking it.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball at enemies","label":"cast fireball at enemies {string:range}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::run attack enemies","label":"run attack enemies {string:range}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::shoot arrow at enemies","label":"shoot arrow at enemies {string:range}","values":[{"type":"string","value":"300"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball at enemies","label":"cast fireball at enemies {string:range}"}

Cast Fireball At Enemies

"Cast Fireball At Enemies" makes an actor automatically shoot fire balls at nearby enemies. The actor will pause any other movement code it has in order to attack.

Parameters:

Range: this parameter determines how far an enemy needs to be before attacking it.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow at enemies","label":"shoot arrow at enemies {string:range}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::run attack enemies","label":"run attack enemies {string:range}"}

Sample Code:
{"func":"registerFlagTrigger","hiddenInSandbox":true,"next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::cast fireball at enemies","label":"cast fireball at enemies {string:range}","values":[{"type":"string","value":"400"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::run attack enemies","label":"run attack enemies {string:range}"}

Run Attack Enemies

"Run Attack Enemies" makes an actor automatically run towards and attack nearby enemies. The actor will pause any other movement code it has in order to attack.

Parameters:

Range: this parameter determines how far an enemy needs to be before attacking it.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::shoot arrow at enemies","label":"shoot arrow at enemies {string:range}"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::cast fireball at enemies","label":"cast fireball at enemies {string:range}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlIfElse","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"string","value":"300"},{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]}]}],"containers":[{"func":"blockMotionPointTowards","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::jump attack","label":"jump attack {string:distance}","values":[{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]}]}},{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::run attack enemies","label":"run attack enemies {string:range}","values":[{"type":"string","value":"200"}]}],"containerLabels":[{"type":"wrapper","func":"nop","values":[],"labelText":"else {button:add}"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::start following","label":"start following {string:actor}"}

Start Following

"Start Following" makes the current actor automatically start another actor.

Parameters:

Actor: set this parameter to the name of the actor to be followed.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::stop following","label":"stop following"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::start following","label":"start following {string:actor}","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"}],"next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"string","value":"1"},{"type":"wrapper","func":"valueVarPropGet","values":[{"type":"string","value":"health"},{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"}]}]}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::stop following","label":"stop following"}}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::stop following","label":"stop following"}

Stop Following

"Stop Following" will make the current actor stop following another actor.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::start following","label":"start following {string:actor}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::start following","label":"start following {string:actor}","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"}],"next":{"func":"blockControlWaitUntil","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"string","value":"1"},{"type":"wrapper","func":"valueVarPropGet","values":[{"type":"string","value":"health"},{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"}]}]}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::stop following","label":"stop following"}}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::move","label":"move {string:speed}"}

Move

"Move" will make an actor automatically start moving in the direction the actor is facing.

Parameters:

Speed: this parameter determines how fast the actor will move.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::move distance","label":"move distance {string:distance} {string:speed}"}

Sample Code:
{"func":"registerTrigger","values":[{"type":"wrapper","func":"valueSensingMouseDown"}],"next":{"func":"blockControlWhile","values":[{"type":"wrapper","func":"valueSensingMouseDown"}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::move","label":"move {string:speed}","values":[{"type":"string","value":"5"}],"next":{"func":"blockMotionPointTowards","values":[{"type":"string","value":"mouse-pointer"}]}}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::move","label":"move {string:speed}","values":[{"type":"string","value":"0"}]}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::move distance","label":"move distance {string:distance} {string:speed}"}

Move Distance

"Move Distance" makes an actor move a fixed distance at a fixed speed in the direction that the actor is facing.

Parameters:

Distance: this parameter determines how far the actor will move.

Speed: this parameter determines how fast the actor will move.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::move","label":"move {string:speed}"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpGreater","values":[{"type":"wrapper","func":"valueSensingDistanceToSprite","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}]},{"type":"string","value":"300"}]}],"containers":[{"func":"blockMotionPointDirection","values":[{"type":"string","value":"90"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::move distance","label":"move distance {string:distance} {string:speed}","values":[{"type":"string","value":"200"},{"type":"string","value":"5"}],"next":{"func":"blockMotionPointDirection","values":[{"type":"string","value":-90}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::move distance","label":"move distance {string:distance} {string:speed}","values":[{"type":"string","value":"200"},{"type":"string","value":"5"}]}}}}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::send damage","label":"send damage {string:actor} {string:damage}"}

Send Damage

"Send Damage" makes one actor send damage to another. The "actor" parameter determines who is receiving the damage, and the "damage" parameter determines how much damage is done.

Parameters:

Actor: this parameter is set to the name of actor who is receiving the damage.

Damage: thisparameter determines how much damage is done.

Sample Code:
{"func":"registerTrigger","values":[{"type":"wrapper","func":"valueSensingTouchingSprite","values":[{"type":"string","value":"any"}]}],"next":{"func":"blockAnimationAnimate","values":[{"type":"string","value":"Spike-Trap-"},{"type":"number","value":7},{"type":"number","value":1},{"type":"string","value":""}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::send damage","label":"send damage {string:actor} {string:damage}","values":[{"type":"wrapper","func":"valueSensingTouchedActorName"},{"type":"string","value":"1"}]}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::change score by","label":"change score by {string:amount}"}

Change Score By

"Change Score By" makes an actor change the game score.

Parameters:

Amount: this parameter determines how much to change the score by.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::change health by","label":"change health by {string:amount}"}

Sample Code:
{"func":"registerSpriteCollision","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::change score by","label":"change score by {string:amount}","values":[{"type":"string","value":"5"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::change health by","label":"change health by {string:amount}"}

Change Health By

"Change Health By" changes the health of the last touched actor.

Parameters:

Amount: this parameter determines how much to change the health by.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::change score by","label":"change score by {string:amount}"}

Sample Code:
{"func":"registerSpriteCollision","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::change health by","label":"change health by {string:amount}","values":[{"type":"string","value":"2"}]}} Add to my Backpack



Top Down Basic Blocks

What are Top Down Basic Blocks?

This is a category of top down blocks that change the properties for level editor characters.


{"func":"blockControlCallLibrary","name":"tynker.topdown::become bad guy","label":"become bad guy"}

Become Bad Guy

"Become Bad Guy" makes an actor become a part of the bad guy team. Bad guys will only attack good guys.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::become good guy","label":"become good guy"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set properties","label":"set properties {string:max hp} {string:atk} {string:critical} {string:speed}","values":[{"type":"string","value":"10"},{"type":"string","value":"2"},{"type":"string","value":"0"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::become bad guy","label":"become bad guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::setup and run character","label":"setup and run character"}}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::become good guy","label":"become good guy"}

Become Good Guy

"Become Good Guy" makes an actor become a part of the good guy team. Good guys will only attack bad guys.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::become bad guy","label":"become bad guy"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::closest ally","label":"closest ally"} ,     {"func":"blockControlCallLibrary","name":"tynker.topdown::closest enemy","label":"closest enemy"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set properties","label":"set properties {string:max hp} {string:atk} {string:critical} {string:speed}","values":[{"type":"string","value":"5"},{"type":"string","value":"1"},{"type":"string","value":"0"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set camera to me","label":"set camera to me","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::become good guy","label":"become good guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::setup and run character","label":"setup and run character"}}}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::set camera to me","label":"set camera to me"}

Set Camera To Me

"Set Camera To Me" will make the level camera follow an actor. It will also make health bar widget display the health of the actor that the camera is following.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set properties","label":"set properties {string:max health} {string:attack} {string:critical} {string:speed}","values":[{"type":"string","value":"max health"},{"type":"string","value":"attack"},{"type":"string","value":"critical"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set properties","label":"set properties {string:max hp} {string:atk} {string:critical} {string:speed}","values":[{"type":"string","value":"5"},{"type":"string","value":"1"},{"type":"string","value":"0"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set camera to me","label":"set camera to me","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::become good guy","label":"become good guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::setup and run character","label":"setup and run character"}}}}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set properties","label":"set properties {string:max health} {string:attack} {string:critical} {string:speed}","values":[{"type":"string","value":"max health"},{"type":"string","value":"attack"},{"type":"string","value":"critical"},{"type":"string","value":"speed"}]}

Set Properties

The "Set Properties" block changes the core properties of the Top Down characters.

Parameters:

Max Health: this parameter changes the maximum amount of health that the actor can have.

Attack: this parameter determines how much attack power the actor has.

Critical: this parameter determines how much extra damage the actor does when attacking an enemy from behind. For example, entering 120 in the "Critical" field will make an actor deal 120% of the normal damage when attacking from behind.

Speed: this parameter determines how fast an actor moves by default.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::set camera to me","label":"set camera to me"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set properties","label":"set properties {string:max hp} {string:atk} {string:critical} {string:speed}","values":[{"type":"string","value":"10"},{"type":"string","value":"2"},{"type":"string","value":"0"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::become bad guy","label":"become bad guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::setup and run character","label":"setup and run character"}}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::setup and run character","label":"setup and run character"}

Setup And Run Character

"Setup And Run Character" is needed to make level editor characters work correctly. It allows them to animate and react to events. It will run for as long as the character has health and at least 1 life.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::setup and run collectible","label":"setup and run collectible"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::set properties","label":"set properties {string:max hp} {string:atk} {string:critical} {string:speed}","values":[{"type":"string","value":"10"},{"type":"string","value":"2"},{"type":"string","value":"0"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::become bad guy","label":"become bad guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::setup and run character","label":"setup and run character"}}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::setup and run collectible","label":"setup and run collectible"}

Setup And Run Collectible

"Setup And Run Collectible" is needed to make level collectible actors work correctly. It allows them to animate and react to events. It will run until the actor is collected.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.topdown::setup and run character","label":"setup and run character"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::setup and run collectible","label":"setup and run collectible"}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.topdown::become my tiny avatar","label":"become my tiny avatar"}

Become My Tiny Avatar

"Become My Tiny Avatar" makes the actor become the avatar of the player. It the player’s avatar is not a tiny character, the block will set the actor to a default tiny character. Using this block will let people play as their own tiny avatars when you share your game.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.platformer::become my avatar","label":"become my avatar"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.topdown::become my tiny avatar","label":"become my tiny avatar"}} Add to my Backpack