Thursday, May 13, 2021

【GAMEMAKER】Explosion

 Information about object: object0

Sprite: sprite0
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
set variable CreateTime to current_time
set variable timer to 5
Step Event:
execute code:

if ((current_time - CreateTime) > 5000) {
  instance_destroy();
}
set variable timer to -1

Information about object: object1
Sprite: sprite1
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
set variable CreateTime to current_time
Step Event:
execute code:

if ((current_time - CreateTime) > 5 * 1000) {
  for (i=1; i<32; i+=3) {
    for (j=1; j<32; j+=3) {
      obj=instance_create(object1.x+i,object1.y+j,object0);
      obj.direction=random(360);
      obj.speed=8;
    }
  }
  instance_destroy();
}

No comments:

Post a Comment