Learn how to solve all the levels of the Google's Blockly Maze (introduction to loops and conditionals).

Google's Blockly Games is a series of educational games that teach programming. It is based on the Blockly library. All code is free and open source. The Bird Game is a deep-dive into conditionals. Control-flow is explored with increasingly complex conditions. The game engine and source is available as an open source project at Github here.

In this article we'll share with you the solution to all 10 levels available in the Bird Game of Blockly.

## Level #1

The respective JavaScript code of this level is:

``heading(45);``

## Level #2

The respective JavaScript code of this level is:

``````if (noWorm()) {
} else {
}``````

## Level #3

The respective JavaScript code of this level is:

``````if (noWorm()) {
} else {
}``````

## Level #4

The respective JavaScript code of this level is:

``````if (getX() < 80) {
} else {
}``````

## Level #5

The respective JavaScript code of this level is:

``````if (getY() > 20) {
} else {
}``````

## Level #6

The respective JavaScript code of this level is:

``````if (noWorm()) {
} else if (getY() < 80) {
} else {
}``````

## Level #7

The respective JavaScript code of this level is:

``````if (getY() > 50) {
} else if (noWorm()) {
} else {
}``````

## Level #8

The respective JavaScript code of this level is:

``````if (getY() < 40) {
} else if (noWorm()) {
} else if (getX() > 50 && getY() < 50) {
} else {
}``````

## Level #9

The respective JavaScript code of this level is:

``````if (noWorm() && getX() > 20) {
} else if (noWorm() && getY() > 20) {
} else if (getY() < 70 && getX() < 40) {
} else {
}``````

## Level #10

The respective JavaScript code of this level is:

``````if (noWorm() && getY() < 80 && getX() < 30) {
} else if (noWorm() && getX() < 80) {
} else if (noWorm() && getY() > 50) {
} else if (getY() < 80 && getX() > 20) {
} else if (getX() > 20) {