Sunday, 23 May 2021

【GAMEMAKER】Lives

 Information about object: objController

Sprite: sprController
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Other Event: Game Start:
set the number of lives to 3
Draw Event:
execute code:

for (i=1; i<=lives; i+=1) {
  draw_sprite(sprHeart,-1,450+(i*32),5);
}
Information about object: objAddLife
Sprite: sprAddLife
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Mouse Event for Left Button:
If lives are smaller than 4
      set the number of lives relative to 1
      execute code:

//So it doesnt add several for holding the button too long
io_clear();
else
      play sound sound0; looping: false
      execute code:

//So it doesnt take several for holding the button too long
io_clear();

Information about object: objTakeLife
Sprite: sprTakeLife
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Mouse Event for Left Button:
If lives are larger than 0
      set the number of lives relative to -1
      execute code:

//So it doesnt take several for holding the button too long
io_clear();
else
      play sound sound0; looping: false
      execute code:

//So it doesnt take several for holding the button too long
io_clear();

No comments:

Post a Comment

BREAKING: North Carolina automotive group acquires 7 Upstate dealerships

Breaking news from GSA Business Report Click here to view this message in a browser window. ...