Skip to content

Blockly

SittingFox edited this page Feb 17, 2015 · 19 revisions

Blockly

CodeSpells makes use of Google's block-based coding language called Blockly. The blocks represent pieces of Javascript.

Example Blockly spell.

Control

Main page: Control Blocks

These blocks manage the flow of control in a spell.

On Create What happens at the point of the orb's creation.
On Activate What happens when the activate button is hit.
Call Function Call a function with a delay before the call.
Repeat Function Repeat a function with a delay between calls.
Destroy Orb Destroys the orb.

Orb Movement

Main page: Orb Movement Blocks

Movement of the orb is controlled here, from the orb's speed to whether or not the orb should orbit around the player.

Orb Properties

Main page: Orb Properties Blocks

The blocks here mostly fetch data on the orb.

Orb Powers

Main page: Orb Powers Blocks

Elemental orb power blocks are located here.

OnHit

Main page: OnHit Blocks

These blocks deal with the orb colliding with other objects.

Communication

Main page: Communication Blocks

Certain interactions between orbs can be done with these blocks, allowing communication between spells.

Logic

Main page: Logic Blocks

Blocks that are used for if conditions and boolean values are of this type.

Loops

Main page: Loops Blocks

These blocks allow for creating loops of repeating code.

Math

Main page: Math Blocks

Various number and math options, from random numbers to pi, are possible with these blocks.

Debug

Main page: Debug Blocks

These blocks allow for writing Javascript code into your spells by hand.

Variables

Main page: Variables Blocks

The blocks here are for creating and using variables within a spell.

Functions

Main page: Functions Blocks

With these blocks, you can create separate functions.

Clone this wiki locally