Wednesday, June 2, 2021

【GAMEMAKER】homeing missle shots

 Information about object: objPlayer

Sprite: sprPlayer
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
set variable FireTimer to 0
set variable chase to 0
if the player does say yes to the question: Have plasma balls Chase alien?
      set variable chase to 1
Step Event:
set variable FireTimer relative to -1
Keyboard Event for <Space> Key:
if expression FireTimer<0 is true
      if expression chase=1 is true
            COMMENT: Create instance of Chasing plasma ball
            create instance of object objPlasmaBall2 at relative position (0,sprite_height/2)
      else
            COMMENT: Create instance on non-chasing plasma ball
            create instance of object objPlasmaBall1 at relative position (0,sprite_height/2)
      set variable FireTimer to 5

Information about object: objAlien
Sprite: sprAlienRight
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
start moving in directions 000001000 with speed set to 8
Collision Event with object objAlienControl1:
reverse horizontal direction
set the sprite to sprAlienLeft with scale factor 1
Collision Event with object objAlienControl2:
reverse horizontal direction
set the sprite to sprAlienRight with scale factor 1

Information about object: objPlasmaBall1
Sprite: sprPlasmaBall
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
start moving in the direction of position (objAlien.x+(objAlien.sprite_width/2),objAlien.y+(objAlien.sprite_height/2)) with speed 12
Collision Event with object objAlien:
destroy the instance
Information about object: objPlasmaBall2
Sprite: sprPlasmaBall
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
start moving in the direction of position (objAlien.x+(objAlien.sprite_width/2),objAlien.y+(objAlien.sprite_height/2)) with speed 12
Step Event:
start moving in the direction of position (objAlien.x+(objAlien.sprite_width/2),objAlien.y+(objAlien.sprite_height/2)) with speed 12
Collision Event with object objAlien:
destroy the instance

Information about object: objAlienControl1
Sprite: sprAlienControl
Solid: false
Visible: false
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object

Information about object: objAlienControl2
Sprite: sprAlienControl
Solid: false
Visible: false
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object

No comments:

Post a Comment

[New post] All or Nothing

...