{ }codelper

Learn with tiles › 26

Adding the console

Add the console object to the scene and write text on the screen with the write tile.

1

Until now you put tiles on characters like Lara. From this chapter on, you use an object called the console. The console does not move. It is a screen that writes text and takes input. It is good for practising with numbers and text.

Let's add the console first. In the object drawer below, open Tools and tap Console. It goes into the scene (it works the same way on craykon.com).

When you add the console, a place for tiles opens. The tiles under the console's when started run in order from the top when you press ▶ Run.

Tap the Console: write line (value) tile in the drawer on the right (at the bottom on a phone). If you drag it instead, drop it inside "when started". When the tile is in place, press ▶ Run and see what comes out.

To do Add the console to the scene and place one write tile so that 0 appears.

Loading tiles…

2

The write tile writes the value in its slot on the screen. If you type text in the slot, that text appears.

Tap the slot of the tile and type Hello.

To do Make Hello appear on the screen.

Loading tiles…

3

In the console, tiles run in order from the top, just as they do for characters. If you change the order, the output order changes too.

Tiles that are not attached do not run. Drag the two tiles and attach them in the right order.

To do Make one, two, three appear in that order.

Loading tiles…

4

The slot of the write tile can also hold a number or a calculation.

When you tap the slot, a ▾ appears next to it. Tap ▾ and choose ( ) + ( ). The slot turns into a calculation tile.

To do Calculate 3 plus 4 so that 7 appears. You may not just type 7.

Loading tiles…

Next: Calculating →