Code Blocks - Hawthorn-Games/ProjectScrapped GitHub Wiki

Gameplay

Code Blocks are the nodes that the player can use to reprogram the behaviour of Editable Objects. These are available in the player’s inventory, grouped into two different categories. 2. Flow of Control: This category of Code Blocks is used to control how and when the other Code Blocks will be called. This category will be formed by classic programming statements such as “Ifs”, “While” or “For”. 3. Actions: When the logic calls an “Action” Code Block, the Editable Objects will perform their own implementation of that action.

Code Block List

Flow Of Control

Name Energy Use Description Variables
For Loop - The player can insert other Code Blocks inside a For Loop to repeat them for the number of times specified in the For Loop itself Repeats
If/Else - The player can choose whether to run code inside an If block, depending on wethere the statement is true or false [Tag], [Direction], [Return]

If/Else specifics

When used on Golems, the If statement will check wether any object with a [Tag] is in the specified [Direction] relative to the Golem

image|500

[Tag]

  • Empty Space
  • Pushable Object
  • Hittable
  • Placeable
  • Color
    • Green
    • Blue
    • Red
  • Button

[Direction]

  • In Front
  • On the Left
  • On the Right
  • Behind
  • Below

[Condition]

  • True
  • False

Actions

Name Energy Use Description Variables
Wait - The object doesn't do anything for this call -
Move - The object moves in a straight line the specified direction Forward, Backward
Rotate - The object stands in place and rotate in the specified direction Left, Right
Push/Pull - Object Specific, see Golems Push, Pull
Grab/Release - Object Specific, see Golems -
Hit - Object Specific, see Golems -
Place - Object Specific, see Golems -
Change Color - Object Specific, see Golems -

Object Implementations

The table below shows what objects "accept" certain actions to be executed on them. Visit the object's pages to read about the specific implementations of such functions.

Object Grab Push/Pull Hit Place Change Color
Golems X X X
Pushable Blocks X X
Tree Stumps X
Log Transporters X X X X
Logs X X X
WheelBarrows X X X
⚠️ **GitHub.com Fallback** ⚠️