Blockly

Getting Started

PixelPAD Blockly is a drag-and-drop way to create any games! Before you get started with this, you might want to try out our BrambleBerry Tales puzzles in the Tutorials section!

To create a new project, navigate to the My Apps section and select Create New App. You can provide a name and image, and under App Engine select blockly-playground.

To get started with PixelPAD Blockly, you should make sure you have a Game Start Block! Everything in PixelPAD Blockly works through objects. Every object you see in the game, has to be created. Take a look at these examples and try to recreate them!


Example 1

Example 1


Example 2

Example 2




Blocks 

Most of PixelPAD blockly blocks are described over here. Some specific blocks, like logic, loops, text and more can be found on the Blockly wiki page.

Game 


Game Start

You can put other blocks inside the Game Start Block, either in the start space or the update space. Any block that you put in start will run one time when you first press Play. Any block that you put in update will run after you press Play and will run again really fast, 30 times per second!


Reload Game

You can reload your game with this block. This can be useful to restart a game after a player either wins or looses. All Global variables will stay the same when you reload.


Show Text

You can show text anywhere in the game screen. Make sure to put this block inside an update section, or else you will not see the text!


Collision Check

You can use this block to detect if this object is colliding with another object of a certain type. You can also use it to access that object, and for example destroy it. Take a look at the example below. If this object collides with an Asteroid, it removes the Asteroid from the game.

Collision Example


Objects


Object

You can put other blocks inside the Object Block, either in the start space or the update space. Any block that you put in start will run one time when this object is created. Any block that you put in update will keep running while the object exists, 30 times per second!

When you create an object, you should change 'default' to the type of that object. For example 'Ship' or 'Obstacle'.


Create_Object
This creates an object of a certain type. Make sure the change 'default' to the type of that object. For example 'Ship' or 'Obstacle'. You can create many objects of the same type, and they will all have the same behaviour.
 
Destroy
This is used to remove an object from the game. Remember that when you destroy an object, it will be gone forever!

Myself
This block links to an object itself. You can use it together with the Destroy block to destroy the object itself.

Input


Key Pressed

You can use this together with an if-block from the Logic category. Then you can make something happen, if a key is pressed. You can select which key you want to check for and then from these three options:

was pressed: Was the key just pressed?

is pressed: Is the key currently held down?

was released: Was the key just released?


Mouse Pressed

Very similar to the key press, this will detect if your mouse button was pressed. The left mouse button is the same as touch on a tablet or mobile device!


Mouse Pos

You can get the position of the mouse in your screen. For this we use (left and right) and (up and down).


Mouse Over

You can use this together with an if-block from the Logic category. That way, you can detect if the mouse is currently over this object. 


Variables

Variables are used to store information. Think of them like a box, with a name on it. The information you store is inside that box. I can then look at that information, and change it. For example, if I would like to store the score of a player, I would create a variable called 'score'. First I set the score to 0, but every time a player gets a point, I add one point to the score. You can store anything you want in a variable, like numbers, text and more.


Create Var

You can create a new variable with this button. Simply type the name of the variable, and it will allow you to use it to store information.


Set Var

You can set a variable, which means you change it to the value you want.


Change Var

You can also simply change the variable, which means we take the original value, and add the new value to it. For example if we change the score of 16 by 1, it will become 17. This can only be used for numbers!


The Var

Besides setting the variable name, we can select a variable type of three options. The first option, the, means that this variable exists in only once in the entire game. That makes sense when storing score, since there is only one score in your game.


My Var

The second option, my, means that the variable is part of that object. This makes sense if you have multiple characters in your game, and they all have their own health. Of course if one character loses health, the other character should not be affected.


Local Var

The last option, _ , is a very specific one. It is only used in loops, like the one in the example below. Here, the variable 'i' is not part of the object, but only part of the loop. 

Local Var Example


Movement


Move Forward

This makes your object move forward by a number of steps. If your object is rotated, it will automatically move in the right direction. If you want to move backward, you can just put a negative number here.


Set Pos

You can set the position of the object in your screen. For this we use (left and right) and (up and down).


Set Angle

You can rotate the object to an angle, between 0 and 360 degrees.


Set Scale

You can set the scale of the object. By default this is 1.


 

Sprites


Set Sprite

You can change the sprite of your object with these simple blocks. You can select a sprite from the different categories, but you can not upload your own sprites.