Tratto da: GAME LEARNING > RESOURCES – Koalabr8.zip.
Sviluppato ulteriormente nel libro ufficiale.
Autore: Jake Habgood, coautore del libro ufficiale.
Impara a realizzare giochi di labirinto con un rompicapo ispirato (molto alla lontana) da Lemmings (Wikipedia:Lemmings).
Muovi in modo sicuro una squadra di koala attraverso un labirinto pericoloso, controllandoli tutti e otto allo stesso tempo!
Ogni livello è costituito da
- un labirinto di cespugli di eucalipto
- più uscite per i koala
- oggetti pericolosi: esplosivo, seghe circolari
- un commutatore per aprire dei varchi
- 8 koala da portare in salvo.
Se un koala tocca l’esplosivo o la sega circolare salta in aria e la missione di salvataggio è fallita.
Per comandare il gioco puoi usare
- le 4 frecce per muovere i koala
- il tasto R per ricominciare il livello
- il tasto F1 per leggere l’help.
La versione del tutorial contiene solo 3 livelli, ma puoi provare a realizzarne innumerevoli altri.
Livello 1
Le risorse utilizzate nel primo livello sono:
- l’eucalipto, l’uscita, il koala (4 direzioni), il koala morto, l’esplosivo
- la musica di sottofondo, due effetti audio
- l’immagine di sfondo.
Realizza le risorse elencate e poi aggiungi gli eventi e le azioni corrispondenti
| TIPO | NOME | FILE | |
|---|---|---|---|
| Sprite | spr_eucalyptus | eucalyptus.png | ![]() |
| spr_tnt | tnt.png | ![]() |
|
| spr_exit | exit.png | ![]() |
|
| spr_walk_up | walk_up_strip8.png | ![]() |
|
| spr_walk_left | walk_left_strip8.png | ![]() |
|
| spr_walk_down | walk_down_strip8.png | ![]() |
|
| spr_walk_right | walk_right_strip8.png | ![]() |
|
| spr_dead_koala | dead_koala.png | ![]() |
|
| Sound | snd_music | music.mid | |
| snd_bonza | bonza.wav | ||
| snd_explosion | explosion.wav | ||
| Background | back_game | background.png | … |
| Object | obj_wall | spr_eucalyptus | ![]() |
| obj_tnt | spr_tnt | ![]() |
|
| obj_exit | spr_exit | ![]() |
|
| obj_controller | <no sprite> | ||
| obj_koala | spr_walk_up | ![]() |
|
| obj_dead_koala | spr_dead_koala | ![]() |
|
| Room | room_1 | … | … |
obj_wall
- Solid
obj_tnt
obj_exit
Sono oggetti inanimati.
obj_controller
Step
If lives are equal to 8
Start of a block
Sleep 1000 milliseconds
Go to next room with transition effect Interlaced from top
End of a block
Game Start
Play sound snd_music; looping: true
Show the game info
Room Start
Set the number of lives to 0
Draw
Draw the lives at (0,0) with sprite spr_walk_up
press R-key
Restart the current room
obj_koala
- Solid
obj_koala
obj_wall
Start moving in direction (000010000) with speed set 0
obj_exit
Play sound snd_bonza; looping: false
Set the number of lives relative to 1
Destroy the instance
obj_tnt
Play sound snd_explosion; looping: false
Change into instance obj_dead_koala
<no key>
If object is aligned with grid with cells of 40 by 40 pixels
Start of block
Start moving in direction (no) with speed set 0
End of block
<Left>
For all obj_koala: If object is aligned with grid with cells of 40 by 40 pixels
Start of block
If relative position (-4,0) for Only solid objects
Start of block
Start moving in a direction (sx) with speed set to 4
End of block
Else
Start of block
Start moving in a direction (no) with speed set to 0
End of block
End of block
<Right>
<Up>
<Down>
Nella versione originale i koala si bloccano se il giocatore inverte bruscamente la direzione.
Ho eliminato il problema modificando gli eventi corrispondenti.
Adesso un koala si muove soltanto se tutti i koala sono allineati alla griglia.
obj_dead_koala
Create
Set the gravity to 2 in direction 270
Set speed to 15 and direction to 80
Outside Room
Destroy the instanceIl koala salta in aria e scompare in basso.
Il primo livello
Inserisci l’immagine dello sfondo.

Imposta
- Snap X: 40
- Snap Y: 40
Posiziona un’istanza di obj_controller in un punto qualsiasi e poi tutte le altre istanze…

Livello 2
Nel secondo livello compare una sega circolare che si muove in verticale.
Se il koala la tocca fa una brutta fine…
| TIPO | NOME | FILE | |
|---|---|---|---|
| Sprite | spr_vertical_saw | vertical_saw_strip2.png | |
| Sound | snd_saw | saw.wav | |
| Object | obj_vertical_saw | spr_vertical_saw | |
| Room | room_2 | … | … |
obj_vertical_saw
Create
Set the vertical speed to 4
obj_koala
Play sound snd_saw; looping: false
Change into instance into obj_dead_koala
obj_wall
Reverse vertical directionLa sega si muove verticalmente (quando tocca la siepe inverte la direzione).
Se tocca il koala si comporta come l’esplosivo.
Ecco il secondo livello

Livello 3
Nel terzo livello compaiono
- la sega circolare con movimento orizzontale
- i passaggi bloccati e l’interruttore.
Se l’interruttore viene toccato da un koala
- passa da spento ad acceso
- e le siepi, segnalate da un lucchetto chiuso, scompaiono aprendo dei passaggi.
| TIPO | NOME | FILE | |
|---|---|---|---|
| Sprite | spr_locked | locked.png | ![]() |
| spr_switch_off | switch_off.png | ![]() |
|
| spr_switch_on | switch_on.png | ![]() |
|
| spr_horizontal_saw | horizontal_saw_strip2.png | ![]() |
|
| Object | obj_locked | spr_locked | ![]() |
| obj_lever | spr_switch_off | ![]() |
|
| obj_horizontal_saw | spr_horizontal_saw | ![]() |
|
| Room | room_3 | … | … |
obj_lever
Oggetto inanimato
obj_koala
…
obj_locked_area
Start moving in direction (000010000) with speed set 0
obj_lever
For all obj_locked_area: destroy the instanceL’area bloccata è invalicabile.
L’interruttore cambia stato e distrugge tutte le aree bloccate.
obj_horizontal_saw
Create
Set the horizontal speed to 4
obj_koala
Play sound snd_saw; looping: false
Change into instance into obj_dead_koala
obj_wall
obj_locked_area
obj_lever
Reverse horizontal directionSi comporta come la sega verticale tranne che per il movimento orizzontale.
Ecco il terzo livello

Riepilogo
I personaggi del gioco sono: l’eucalipto, l’uscita, il koala, l’esplosivo, le due seghe, il passaggio bloccato, l’interruttore.
| TIPO | NOME | FILE | |
|---|---|---|---|
| Sprite | spr_walk_up | walk_up_strip8.png | ![]() |
| spr_walk_left | walk_left_strip8.png | ![]() |
|
| spr_walk_down | walk_down_strip8.png | ![]() |
|
| spr_walk_right | walk_right_strip8.png | ![]() |
|
| spr_dead_koala | dead_koala.png | ![]() |
|
| spr_eucalyptus | eucalyptus.png | ![]() |
|
| spr_exit | exit.png | ![]() |
|
| spr_locked | locked.png | ![]() |
|
| spr_switch_off | switch_off.png | ![]() |
|
| spr_switch_on | switch_on.png | ![]() |
|
| spr_tnt | tnt.png | ![]() |
|
| spr_vertical_saw | vertical_saw_strip2.png | ||
| spr_horizontal_saw | horizontal_saw_strip2.png | ![]() |
|
| Sound | snd_music | music.mid | |
| snd_bonza | bonza.wav | ||
| snd_explosion | explosion.wav | ||
| snd_saw | saw.wav | ||
| Background | back_game | background.png | … |
| Object | obj_koala | spr_walk_up | ![]() |
| obj_dead_koala | spr_dead_koala | ![]() |
|
| obj_wall | spr_eucalyptus | ![]() |
|
| obj_exit | spr_exit | ![]() |
|
| obj_locked | spr_locked | ![]() |
|
| obj_lever | spr_switch_off | ![]() |
|
| obj_tnt | spr_tnt | ![]() |
|
| obj_vertical_saw | spr_vertical_saw | ||
| obj_horizontal_saw | spr_horizontal_saw | ![]() |
|
| obj_controller | <no sprite> | ||
| Room | room_1 … |
… | … |
obj_wall
- Solid
obj_tnt
![]()
obj_exit
obj_lever
obj_controller
Step
If lives are equal to 8
Start of a block
Sleep 1000 milliseconds
Go to next room with transition effect Interlaced from top
End of a block
Game Start
Play sound snd_music; looping: true
Show the game info
Room Start
Set the number of lives to 0
Draw
Draw the lives at (0,0) with sprite spr_walk_up
press R-key
Restart the current room
obj_koala
- Solid
obj_koala
obj_wall
obj_locked_area
Start moving in direction (000010000) with speed set 0
obj_exit
Play sound snd_bonza; looping: false
Set the number of lives relative to 1
Destroy the instance
obj_tnt
Play sound snd_explosion; looping: false
Change into instance obj_dead_koala
obj_lever
For all obj_locked_area: destroy the instance
<no key>
If object is aligned with grid with cells of 40 by 40 pixels
Start of block
Start moving in direction (no) with speed set 0
End of block
<Left>
For all obj_koala: If object is aligned with grid with cells of 40 by 40 pixels
Start of block
If relative position (-4,0) for Only solid objects
Start of block
Start moving in a direction (sx) with speed set to 4
End of block
Else
Start of block
Start moving in a direction (no) with speed set to 0
End of block
End of block
<Right>
<Up>
<Down>
obj_dead_koala
Create
Set the gravity to 2 in direction 270
Set speed to 15 and direction to 80
Outside Room
Destroy the instance
obj_vertical_saw
Create
Set the vertical speed to 4
obj_koala
Play sound snd_saw; looping: false
Change into instance into obj_dead_koala
obj_wall
obj_locked_area
obj_lever
Reverse vertical direction
obj_horizontal_saw
Create
Set the horizontal speed to 4
obj_koala
Play sound snd_saw; looping: false
Change into instance into obj_dead_koala
obj_wall
obj_locked_area
obj_lever
Reverse horizontal direction
I livelli
Inserisci l’immagine dello sfondo

- imposta
- Snap X: 40
- Snap Y: 40
- posiziona un’istanza di obj_controller nell’angolo in alto a destra
- posiziona tutte le altre istanze
- lascia la prima riga libera per l’indicatore dei koala salvati.





