Evil clutches

Evil Clutches

Tratto da: GAME LEARNING > RESOURCES – Evil Clutches.zip
Autore: Jake Habgood, coautore del libro ufficiale.

 

Una semplice introduzione a GameMaker tramite un esempio di sparatutto (Wikipedia:Sparatutto).

  • Il capo dei demoni (a destra) lancia draghetti e demoni contro la draghessa (a sinistra).
  • La draghessa
    • salva i sui draghetti toccandoli: +5 life
    • colpisce i demoni indiavolati con delle palle di fuoco: +100 score
    • se colpisce il draghetto: -500 life
    • se tocca il demone: -25 score

Evil Clutches

I personaggi del gioco sono

  • la draghessa (a sinistra)
  • i draghetti (da destra verso sinistra)
  • il capo dei demoni (a destra)
  • i demoni (da destra verso sinistra)

Inoltre ci sono alcuni accessori

  • l’immagine dello sfondo, la barra della salute e il punteggio
  • la musica di sottofondo e i suoni per gli eventi
  • un oggetto controllore (non è strettamente necessario: i suoi eventi possono essere trasferiti alla draghessa).
TIPO NOME FILE
Sprite spr_Dragon Dragon_strip6.png Dragon
spr_Hatchling Hatchling_strip2.png Hatchling
spr_Boss Dragon_strip8.png Boss
spr_Demon Demon_strip2.png Demon
spr_Fireball Fireball.png Fireball
Sound snd_Battle music.mid scegli…
snd_Hatchling_Eek hatchling.wav
snd_Demon_Eek demon.wav
Background back_game background.png vedi dopo
Object obj_Dragon spr_Dragon Dragon
obj_Hatchling spr_Hatchling Hatchling
obj_Boss spr_Boss Boss
obj_Demon spr_Demon Demon
obj_Fireball spr_Fireball Fireball
obj_controller <no sprite>
Room room_Cave

 

Dragonobj_Dragon

image <no key>

Vertical Speed Action Set the vertical speed to 0

image Intersect Boundary

Vertical Speed Action Set the vertical speed to 0

image press <Space>

image Create instance of object obj_Firewall at relative position (100,40)

image press <Up>

Vertical Speed Action Set the vertical speed to -16

image press <Down>

Vertical Speed Action Set the vertical speed to +16

La draghessa risponde ai comandi del giocatore

  • frecce su e giù: si muove in verticale.
  • barra spaziatrice: emette una palla di fuoco.

 

Bossobj_Boss

image Create

Vertical Speed Action Set the vertical speed to 8

Step Event Step

Test Chance With a chance of 1 out 50 do perform the next action

Start Block Start of a block
image Create instance of object obj_Demon at relative position (0,0)
End Block End of a block

Test Chance With a chance of 1 out 100 do perform the next action

Start Block Start of a block
image Create instance of object obj_Hatchling at relative position (0,0)
End Block End of a block

image Intersect Boundary

Reverse Vertical Reverse vertical direction

Il capo dei demoni si muove continuamente in verticale.
Di tanto in tanto lancia demoni e draghetti verso la draghessa.

Demonobj_Demon

image Create

action_move1.bmp Start moving in a direction (le tre frecce verso sinistra con speed=8)

Collision Event obj_Dragon

image Destroy the instance
image Set the health relative to -25
Play Sound Play sound snd_Hatchling_Eek; looping: false

Collision Event obj_Firewall

image Destroy the instance
image Destroy the other instance
image Set the score relative to 100
Play Sound Play sound snd_Demon_Eek; looping: false

image Intersect Boundary

Reverse Vertical Reverse vertical direction

image Outside room

image Destroy the instance

I demoni si muovono in diagonale verso sinistra.
Se colpiscono il dragone diminuisce la salute.
Se vengono colpiti dalle palle di fuoco scompaiono e aumenta il punteggio.

Hatchlingobj_Hatchling

image Create

Horizontal Speed Action Set the vertical speed to -8

Collision Event obj_Dragon

image Destroy the instance
image Set the health relative to +5

Collision Event obj_Fireball

image Destroy the instance
image Destroy the other instance
image Set the score relative to -500
Play Sound Play sound snd_Hatchling_Eek; looping: false

image Outside room

image Destroy the instance

I draghetti si muovono verso sinistra.
Se raggiungono la draghessa aumenta la salute.
Se vengono colpiti dalle palle di fuoco scompaiono e diminuisce il punteggio.

 

Fireballobj_Fireball

image Create

Horizontal Speed Action Set the horizontal speed to 32

image Outside room

image Destroy the instance

Le palle di fuoco si muovono verso destra.

obj_controller

image Game Sart

image Show the game info
image Set the score to 0
image Set the health to 100
Play Sound Play sound snd_Battle; looping: true

image No More Health

Play Sound Play sound snd_Hatchling_Eek; looping: false
Sleep Action Sleep 1000 milliseconds
Restart Game Restart the game

image Draw

Draw Health Draw the health bar with size (10,15,110,35) with …
Draw Score At position (150,20) draw the value of score with caption: Score:

Alla partenza del gioco viene aperta la finestra dell’help, si impostano punteggio e salute, inizia a suonare la musica di fondo.
Quando la salute si azzera si sente un suono, si aspetta per un secondo, riparte il gioco.
In alto vengono disegnati la salute (con un rettangolo) e il punteggio (con un’etichetta).

Se vuoi visualizzare il punteggio con caratteri di un certo stile allora

  • aggiungi una risorsa Font nella scheda corrispondente delle risorse e scegli: caratteri, dimensione, attributi, …
  • aggiungi nell’evento Draw le azioni Set Font e Set Color prima di Draw Score.

 

Il livello

Imposta l’immagine dello sfondo.

Background

Per realizzare l’unico livello posiziona le 3 istanze
  • la draghessa a sinistra
  • il capo dei demoni a destra
  • l’oggetto controllore in un punto qualsiasi..