# The Blocks Library of ChoiCo

### Block Category

> #### Initialize

> #### Conditions

> #### Variables

> #### Maths

> #### Game Actions

> #### Map Actions

> #### Game Flow

## Category: Initialize

Block:

Description: All the initial settings of the game must​ be placed under this block

Modifications: -

Availiabe in tab (s): Initial Settings

Block:

Description: Sets the initial value of a game attribute (i.e. FieldA) to a number (i.e. 0)

Modifications: Click on the name of the field to appear a dropdown menu with the available fields to select from. Click on the number box to change the number

Availiabe in tab (s): Initial Settings

## Category: Conditions

Block:

Description: A conditional statement block. It needs a condition block to be connected at the top and some blocks to be included inside. If the statement of the condition is true, then the blocks it includes will be executed.

Modifications: -

Availiabe in tab (s): Game play rules, End rules

Examples of use: "If the attribute FieldA is greater than 3 then apear a pop up with the message "Attention!"

Block:

ATTENTION: ​To use this block you have to click on the settings icon of an if block and create the if else block like below!

Description: A conditional statement block. It needs a statement to be connected at the top and some blocks to be included inside. If the statement is true, then the first group of blocks will be executed else the second group of blocks will be executed.

Modifications: -

Availiabe in tab (s): Game play rules, End rules

Example of use: If the attribute fieldA is lower than 50 pop up a window with the message 'Attention' else play the sound 'beep'

Block:

ATTENTION: ​To use this block you have to click on the settings icon of an if block and create the if else if block like below!

Description: A conditional statement block. It needs a statement to be connected at the top and some blocks to be included inside. If the statement is true, then the first group of blocks will be executed else if the second condition is true then the second group of blocks will be executed.

Modifications: -

Availiabe in tab (s): Game play rules, End rules

Example of use:

If the attribute fieldA is lower than 50 then pop up a window with the message 'Attention' else if the Attribute FieldA is greater than 100 thenplay the sound 'beep'

Block:

ATTENTION: ​This is an input block This block must be connected as input to other blocks in order to work. This block represents a mathematical condition. It DOES NOT set the value of FieldA to a number!

Description: A condition block that can be used as input for the if blocks . The block describes a mathematical condition (inequality) and it returns true if the condition is true or false if it is false. It is a complex block that consists of three parts: the pink block which is the first part of the condition (FieldA), the operator (=,<,> etc) and the second part of the condition which is by default a number. The 2 parts of the condition can be removed and be replaced by other same type blocks.

Modifications:

Availiabe in tab (s): Game play rules, End rules

Example of use: See the example of if block

Block:

ATTENTION: ​This is an input block This block must be connected as input to other blocks in order to work. This block represents a mathematical condition. It DOES NOT set the value of FieldA to a number!

Description: A logical operation block that can be used as input for the if blocks. The block contains 2 mathematical condition blocks and a logical operator (and, or). The and block will return true only if both of its two inputs are also true. The or block will return true if either of its two inputs are true.

Modifications:

Availiabe in tab (s): Game play rules, End rules

Example of use:

Block:

ATTENTION: ​This is an input condition block This block must be connected as input to other blocks in order to work.

Description: A logical operation block that can be used as input for the if blocks . The block checks if the currently selected point is the one that is written on the right part. If it is it returns true. If it is not it returns false.

Modifications: Click the name of the point to select another one from a dropdown menu

Availiabe in tab (s): Game play rules, End rules

Example of use: If the player selects the point House then play the sound "doorbell".

## Category: Variables

Block:

ATTENTION: ​This is an input variable block This block must be connected as input to other blocks in order to work.

Description: : This block returns the current value of a game’s attribute (i.e. FieldA)

Modifications: Click on the name of the attribute to select an attribute from the list of the game attributes.

Availiabe in tab (s): Game play rules, End rules

Example of use: Look the conditional blocks (if-else).

Block:

ATTENTION: ​This is an input variable block This block must be connected as input to other blocks in order to work.

Description: : This block returns the number of the current turn of the player. I.e. after the first selection of the player it returns the number 1, after the second the number 2 etc.

Modifications: none.

Availiabe in tab (s): Game play rules, End rules

Example of use: If the player is on his/hers 10th turn pop up the message "You are half way to the end"

## Category: Maths

Block:

ATTENTION: ​This is an input variable block This block must be connected as input to other blocks in order to work.

Description: : A number block. It returns the number it has.

Modifications: Click inside the box to change the value of the number.

Availiabe in tab (s): Game play rules, End rules

Block:

ATTENTION: ​This is an input variable block This block must be connected as input to other blocks in order to work.

Description: : A mathematical operation block. This block makes an operation between two parts and returns the result as output. The available operators are + (sum), - (subtraction) , ÷(division), x (multiplication), ^ (power).

Modifications: Click on the operator symbol to select one of the available operators. Drag and drop the desired blocks in the empty spaces to create the operation (usually number blocks or attributes)

Availiabe in tab (s): Game play rules, End rules

Examples of use:

If the sum of the attributes "Wood" and "Iron" is greater than 50 then alert the message "You have gathered a lot of material"

Block:

ATTENTION: ​This is an input variable block This block must be connected as input to other blocks in order to work.

Description: : A mathematical function block. Returns the result of the selected mathematical function for the block that takes as input. The input block can be a number block or a field block The available functions square root, absolut, negative (-), ln, log10, e^, 10^.

Modifications: Click on the function to select one of the available functions. Drag and drop the input block to the right side

Availiabe in tab (s): Game play rules, End rules

Examples of use:

Returns the square root of the attribute "Wood"

## Category: Game Actions

Block:

Description: : This block prints its input to the log window of the game. It can print any input block in the form of plain text (the value of a variable, the result of a mathematical operation or a text)

Modifications: None

Availiabe in tab (s): Game play rules, End rules

Examples of use:

a) b)c)

a) Prints the text “Very good” b) Prints the current value of variable Money c) Prints the result of the operation “Money + 5”

Block:

ATTENTION: ​This is an input variable block This block must be connected as input to other blocks in order to work.

Description: : This block returns the text it has written in it. You can type a text in the green box

Modifications: Click in the box to type any text.

Availiabe in tab (s): Game play rules, End rules

Examples of use:

a)

a) Prints the text “Very good”

Block:

Description: : This block merges two (or more) different inpupts into one text output which then is printed to the console.

Modifications: To create more availiable inputs click on the blue button and drug one more 'item' block as it is shown below:

Availiabe in tab (s): Game play rules, End rules

Examples of use:

a) b)

a) Prints a text that contains the text “Your Money is” followed by the current value of the variable Money. For example if the current value of the variable Money is 100 the above block will print to the game log “Your Money is 100”

b) A more complicated example with 4 inputs. In the case that moves counter is 8 and fieldB is 100 this block will print to the game log the text: "Your Money in move: 8 is: 100"

Block:

Description: : Shows a pop up window that contains the given text message.

Modifications: Click in the box to type any text

Availiabe in tab (s): Game play rules, End rules

Examples of use:

Shows a pop up window with the text "Be careful!"

Block:

Description: : Plays the selected sound

Modifications: Click in the box to select a sound from the dropdown menu

Availiabe in tab (s): Game play rules, End rules

Block:

Description: : Shows a player with a video from youtube. The video url must be written in the green box

Modifications: Click in the box to paste the video url

Availiabe in tab (s): Game play rules, End rules

Examples of use:

## Category: Map Controls

Block:

Description: : Sets the bakcground of the current layer to the image given by the url

Modifications: Click in the box to paste the image url

Attention: It need the url of the image file (right click-> copy image url)

Availiabe in tab (s): Game play rules, End rules

Examples of use:

Block:

Description: : Sets as temporary bakcground of the current layer the image given by the url for the number of seconds. After the number of seconds the previous background returns.

Modifications: Click in the brown box to paste the image url. Click in the blue box to set the number of seconds

Attention: It need the url of the image file (right click-> copy image url)

Availiabe in tab (s): Game play rules, End rules

Examples of use:

Sets the background of the current layer to the image of the given url for 5 seconds.

Block:

Description: : Changes the active layer to the selected one

Modifications: Click in the brown box to select a layer from the dropdown menu

Availiabe in tab (s): Game play rules, End rules

Block:

Description: : Makes the selected point (item) visible on the scene

Modifications: Click in the brown box to select a point (item) from the dropdown menu

Availiabe in tab (s): Game play rules, End rules

Block:

Description: : Makes the selected point (item) invisible.

Modifications: Click in the brown box to select a point (item) from the dropdown menu

Availiabe in tab (s): Game play rules, End rules

Block:

Description: : Makes all the points (items) of the active layer visible

Modifications: None

Availiabe in tab (s): Game play rules, End rules

Block:

Description: : Makes all the points (items) of the active layer invisible

Modifications: None

Availiabe in tab (s): Game play rules, End rules

## Category: Game Flow

Block:

Description: : Ends the game. A red popup with the text "Game Over" appears on screen.

Modifications: None

Availiabe in tab (s): End rules