Platformer Library

Platformer Control Blocks

What are Platformer Control Blocks?

This is a category of Platformer 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.platformer::already jumping?","label":"already jumping?"}

Already Jumping?

"Already Jumping?" returns "true" or "false" depending on whether an actor is already in the air. Use it with conditional statements to know if an actor is already jumping.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::double jump","label":"double jump {string:height}","values":[{"type":"string","value":"height"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::jump","label":"jump {string:height}","values":[{"type":"string","value":"height"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockControlIfElse","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.platformer::already jumping?","label":"already jumping?"}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::double jump","label":"double jump {string:height}","values":[{"type":"string","value":"-20"}]},{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::jump","label":"jump {string:height}","values":[{"type":"string","value":"-15"}]}],"containerLabels":[{"type":"wrapper","func":"nop","values":[],"labelText":"else {button:add}"}]}} Add to my Backpack


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

Attack

"Attack" makes an actor perform a close-range attack in the direction that the actor is facing. This block works best when used with a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.platformer::block","label":"block"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::shoot","label":"shoot"} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::slam","label":"slam {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"a"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::attack","label":"attack"}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.platformer::block","label":"block"}

Block

"Block" makes an actor perform a close-range blocking motion in the direction that the actor is facing. This block works best when used with a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.platformer::block","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::shoot","label":"shoot"} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::slam","label":"slam {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"b"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::attack","label":"block"}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::double jump","label":"double jump {string:height}","values":[{"type":"string","value":"height"}]}

Double Jump

"Double Jump" makes an actor perform an alternate type of jump. The block will work best when attached to a key-pressed event.

Parameters:

Height: set this value to how high the character will jump - use negative number (negative gravity) to go up and positive number (positive gravity) to go down.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.platformer::already jumping?","label":"already jumping?"} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::jump","label":"jump {string:height}","values":[{"type":"string","value":"height"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockControlIfElse","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.platformer::already jumping?","label":"already jumping?"}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::double jump","label":"double jump {string:height}","values":[{"type":"string","value":"-20"}]},{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::jump","label":"jump {string:height}","values":[{"type":"string","value":"-15"}]}],"containerLabels":[{"type":"wrapper","func":"nop","values":[],"labelText":"else {button:add}"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down","label":"fly down {string:speed}","values":[{"type":"string","value":"speed"}]}

Fly Down

"Fly Down" makes an actor fly downwards while a key is pressed.

Parameters:

Speed: this value determines how fast the character will fly.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up","label":"fly up {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right","label":"fly right {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left","label":"fly left {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up","label":"fly up {string:speed}","values":[{"type":"string","value":"10"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right","label":"fly right {string:speed}","values":[{"type":"string","value":"speed"}]}

Fly Right

"Fly Right" makes an actor fly to the right while a key is pressed.

Parameters:

Speed: this value determines how fast the character will fly.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down","label":"fly down {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up","label":"fly up {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left","label":"fly left {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"right arrow"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right","label":"fly right {string:speed}","values":[{"type":"string","value":"10"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left","label":"fly left {string:speed}","values":[{"type":"string","value":"speed"}]}

Fly Left

"Fly Left" makes an actor fly to the left while a key is pressed.

Parameters:

Speed: this value determines how fast the character will fly.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down","label":"fly down {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up","label":"fly up {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right","label":"fly right {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"left arrow"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left","label":"fly left {string:speed}","values":[{"type":"string","value":"10"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up","label":"fly up {string:speed}","values":[{"type":"string","value":"speed"}]}

Fly Up

"Fly Up" makes an actor fly up while a key is pressed.

Parameters:

Speed: this value determines how fast the character will fly.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down","label":"fly down {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right","label":"fly right {string:speed}","values":[{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left","label":"fly left {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"down arrow"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down","label":"fly down {string:speed}","values":[{"type":"string","value":"10"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::jump","label":"jump {string:height}","values":[{"type":"string","value":"height"}]}

Jump

"Jump" will make an actor jump up or down. The block will work best when attached to a key-pressed event.

Parameters:

Height: set this value to how high the character will jump - use negative number (negative gravity) to go up and positive number (positive gravity) to go down.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.platformer::already jumping?","label":"already jumping?"} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::double jump","label":"double jump {string:height}","values":[{"type":"string","value":"height"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"up arrow"}],"next":{"func":"blockControlIfElse","values":[{"type":"wrapper","func":"valueControlCallLibrary","name":"tynker.platformer::already jumping?","label":"already jumping?"}],"containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::double jump","label":"double jump {string:height}","values":[{"type":"string","value":"-20"}]},{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::jump","label":"jump {string:height}","values":[{"type":"string","value":"-15"}]}],"containerLabels":[{"type":"wrapper","func":"nop","values":[],"labelText":"else {button:add}"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.platformer::shoot","label":"shoot"}

Shoot

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

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.platformer::block","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::block","label":"block"} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::slam","label":"slam {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"s"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::shoot","label":"shoot"}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::slam","label":"slam {string:speed}","values":[{"type":"string","value":"speed"}]}

Slam

"Slam" makes an actor fly towards the ground and damage anyone that it lands on. The block will work best when attached to a key-pressed event.

Parameters:

None.

Related Blocks:
{"func":"blockControlCallLibrary","name":"tynker.platformer::block","label":"attack"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::block","label":"block"} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::shoot","label":"shoot"}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"down arrow"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::slam","label":"slam {string:speed}","values":[{"type":"string","value":"25"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk left","label":"walk left {string:speed}","values":[{"type":"string","value":"speed"}]}

Walk Left

The "Walk Left" block makes an actor walk left while a key is pressed.

Parameters:

Speed: this parameter determines how fast the character will walk.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk right","label":"walk right {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"left arrow"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk left","label":"walk left {string:speed}","values":[{"type":"string","value":"10"}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk right","label":"walk right {string:speed}","values":[{"type":"string","value":"speed"}]}

Walk Right

The "Walk Right" block makes an actor walk right while a key is pressed.

Parameters:

Speed: this parameter determines how fast the character will walk.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk left","label":"walk left {string:speed}","values":[{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerKeyTrigger","values":[{"type":"choice","value":"right arrow"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk right","label":"walk right {string:speed}","values":[{"type":"string","value":"10"}]}} Add to my Backpack



Platformer Automation Blocks

What are Platformer Automation Blocks?

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


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change health when collected","label":"change health when collected {string:amount}","values":[{"type":"string","value":"amount"}]}

Change Health When Collected

"Change Health When Collected" block makes an actor animate in place until a good guy touches it. The block will change the health of the actor who touches it. An actor using this code should also use the "Setup And Run Collectible" block.

Parameters:

Amount: set this value to how much health will be changed for the character.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change score when collected","label":"change score when collected {string:amount}","values":[{"type":"string","value":"amount"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::make invincible when collected","label":"make invincible when collected {string:time}","values":[{"type":"string","value":"time"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run collectible","label":"setup and run collectible","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change health when collected","label":"change health when collected {string:amount}","values":[{"type":"string","value":"1"}]}}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change score when collected","label":"change score when collected {string:amount}","values":[{"type":"string","value":"amount"}]}

Change Score When Collected

"Change Score When Collected" block makes an actor animate in place until a good guy touches it. An actor using this code should also use the "Setup And Run Collectible" block.

Parameters:

Amount:set this value determines how much score will be changed for the character.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change health when collected","label":"change health when collected {string:amount}","values":[{"type":"string","value":"amount"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::make invincible when collected","label":"make invincible when collected {string:time}","values":[{"type":"string","value":"time"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run collectible","label":"setup and run collectible","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change score when collected","label":"change score when collected {string:amount}","values":[{"type":"string","value":"100"}]}}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly attack enemies","label":"fly attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"range"},{"type":"string","value":"speed"}]}

Fly Attack Enemies

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

Parameters:

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

Speed: this value determines how fast the actor will fly towards the enemy.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::run attack enemies","label":"run attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"range"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::shoot at enemies","label":"shoot at enemies {string:range}","values":[{"type":"string","value":"range"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly attack enemies","label":"fly attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"500"},{"type":"string","value":"5"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down distance","label":"fly down distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Fly Down Distance

"Fly Down Distance" makes an actor fly down a fixed distance at a fixed speed.

Parameters:

How Far: this value determines how far the actor will fly.

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

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"time"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up distance","label":"fly up distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up distance","label":"fly up distance {string:how far} {string:speed}","values":[{"type":"string","value":"100"},{"type":"string","value":"3"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"3"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down distance","label":"fly down distance {string:how far} {string:speed}","values":[{"type":"string","value":"100"},{"type":"string","value":"3"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"3"}]}}}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"time"}]}

Fly In Place

"Fly In Place" makes an actor fly in place for a fixed amount of time.

Parameters:

Time: this value determines how long it will fly in place.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down distance","label":"fly down distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up distance","label":"fly up distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}]}}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Fly Left Distance

"Fly Left Distance" makes an actor fly left a fixed distance at a fixed speed.

Parameters:

How Far: this value determines how far the actor will fly.

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

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"time"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down distance","label":"fly down distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up distance","label":"fly up distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}]}}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Fly Right Distance

"Fly Right Distance" makes an actor fly right a fixed distance at a fixed speed.

Parameters:

How Far: this value determines how far the actor will fly.

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

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"time"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down distance","label":"fly down distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up distance","label":"fly up distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}]}}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up distance","label":"fly up distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Fly Up Distance

"Fly Up Distance" makes an actor fly up a fixed distance at a fixed speed.

Parameters:

How Far: this value determines how far the actor will fly.

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

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly in place","label":"fly in place {string:time}","values":[{"type":"string","value":"time"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down distance","label":"fly down distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly up distance","label":"fly up distance {string:how far} {string:speed}","values":[{"type":"string","value":"100"},{"type":"string","value":"3"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly right distance","label":"fly right distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"3"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly down distance","label":"fly down distance {string:how far} {string:speed}","values":[{"type":"string","value":"100"},{"type":"string","value":"3"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly left distance","label":"fly left distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"3"}]}}}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::make invincible when collected","label":"make invincible when collected {string:time}","values":[{"type":"string","value":"time"}]}

Make Invincible When Collected

"Make Invincible When Collected" block makes an actor animate in place until a good guy touches it. The block will make the actor who touches it invincible for a fixed amount of time. An actor using this code should also use the "Setup And Run Collectible" block.

Parameters:

Time: this value determines how long the actor will be invincible.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change health when collected","label":"change health when collected {string:amount}","values":[{"type":"string","value":"amount"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change score when collected","label":"change score when collected {string:amount}","values":[{"type":"string","value":"amount"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run collectible","label":"setup and run collectible","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::make invincible when collected","label":"make invincible when collected {string:time}","values":[{"type":"string","value":"10"}]}}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::run attack enemies","label":"run attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"range"},{"type":"string","value":"speed"}]}

Run Attack Enemies

This block 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 value determines how far an enemy needs to be before attacking it.

Speed: this value determines how fast the actor will run towards the enemy.

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly attack enemies","label":"fly attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"range"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::shoot at enemies","label":"shoot at enemies {string:range}","values":[{"type":"string","value":"range"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::run attack enemies","label":"run attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"500"},{"type":"string","value":"5"}]}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::shoot at enemies","label":"shoot at enemies {string:range}","values":[{"type":"string","value":"range"}]}

Shoot At Enemies

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

Parameters:

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

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::run attack enemies","label":"run attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"range"},{"type":"string","value":"speed"}]} ,     {"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::fly attack enemies","label":"fly attack enemies {string:range} {string:speed}","values":[{"type":"string","value":"range"},{"type":"string","value":"speed"}]}

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


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk left distance","label":"walk left distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Walk Left Distance

"Walk Left Distance" makes an actor walk left a fixed distance at a fixed speed.

Parameters:

How Far: this value determines how far the actor will walk.

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

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk right distance","label":"walk right distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk right distance","label":"walk right distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk left distance","label":"walk left distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}]}}]}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk right distance","label":"walk right distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Walk Right Distance

"Walk Right Distance" makes an actor walk right a fixed distance at a fixed speed.

Parameters:

How Far: this value determines how far the actor will walk.

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

Related Blocks:
{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk left distance","label":"walk left distance {string:how far} {string:speed}","values":[{"type":"string","value":"how far"},{"type":"string","value":"speed"}]}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlForever","containers":[{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk right distance","label":"walk right distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::walk left distance","label":"walk left distance {string:how far} {string:speed}","values":[{"type":"string","value":"300"},{"type":"string","value":"5"}]}}]}} Add to my Backpack



Platformer Basic Blocks

What are Platformer Basic Blocks?

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


{"func":"blockControlCallLibrary","name":"tynker.platformer::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.platformer::become good guy","label":"become good guy"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::become bad guy","label":"become bad guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run character","label":"setup and run character"}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.platformer::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. Only members of the good guy team can pick up collectibles like coins or health.

Parameters:

None.

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

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::become good guy","label":"become good guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::set camera to me","label":"set camera to me","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run character","label":"setup and run character"}}}} Add to my Backpack


{"func":"blockControlCallLibrary","name":"tynker.platformer::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":"blockLooksViewportCamera"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::become good guy","label":"become good guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::set camera to me","label":"set camera to me","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run character","label":"setup and run character"}}}} Add to my Backpack


{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::set properties","label":"set properties {string:lives} {string:max health} {string:max power} {string:health} {string:power}","values":[{"type":"string","value":"lives"},{"type":"string","value":"max health"},{"type":"string","value":"max power"},{"type":"string","value":"health"},{"type":"string","value":"power"}]}

Set Properties

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

Parameters:

Lives: this property determines how many times a character can die and respawn.

Max Health: this property determines how much health a character can have at a time.

Max Power: this determines how much power a character can have at a time.

Health: this property determines how much damage a character can take before it dies.

Power: this property determines how much damage an actor does when it attacks.

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

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::become good guy","label":"become good guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::set camera to me","label":"set camera to me","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::set properties","label":"set properties {string:_lives} {string:_max health} {string:_max power} {string:_health} {string:_power}","values":[{"type":"string","value":"1"},{"type":"string","value":"5"},{"type":"string","value":"1"},{"type":"string","value":"5"},{"type":"string","value":"1"}],"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run character","label":"setup and run character"}}}}} Add to my Backpack


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

Setup And Run Character

"Setup And Run Character" block 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","cat":"functions","name":"tynker.platformer::set properties","label":"set properties {string:lives} {string:max health} {string:max power} {string:health} {string:power}","values":[{"type":"string","value":"lives"},{"type":"string","value":"max health"},{"type":"string","value":"max power"},{"type":"string","value":"health"},{"type":"string","value":"power"}]} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::setup and run collectible","label":"setup and run collectible"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::become good guy","label":"become good guy","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::set camera to me","label":"set camera to me","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run character","label":"setup and run character"}}}} Add to my Backpack


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

Setup And Run Collectible

"Setup And Run Collectible" block 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","cat":"functions","name":"tynker.platformer::set properties","label":"set properties {string:lives} {string:max health} {string:max power} {string:health} {string:power}","values":[{"type":"string","value":"lives"},{"type":"string","value":"max health"},{"type":"string","value":"max power"},{"type":"string","value":"health"},{"type":"string","value":"power"}]} ,     {"func":"blockControlCallLibrary","name":"tynker.platformer::setup and run character","label":"setup and run character"}

Sample Code:
{"func":"registerFlagTrigger","hiddenInSandbox":false,"next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::setup and run collectible","label":"setup and run collectible","next":{"func":"blockControlCallLibrary","cat":"functions","name":"tynker.platformer::change health when collected","label":"change health when collected {string:amount}","values":[{"type":"string","value":"1"}]}}} Add to my Backpack


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

Become My Avatar

"Become My Avatar" block makes the actor become the avatar of the player. Using this block will let people play as their own avatars when you share your game.

Parameters:

None.

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

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