【GAMEMAKER】 1945 game remake




Information about object: obj_player
Sprite: spr_player
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Step Event:
execute code:


//movement
if (keyboard_check(vk_left))  {x-=5;} 
if (keyboard_check(vk_right))  {x+=5;}
if (keyboard_check_pressed(ord('Z')))//Fire Bullet
{
    instance_create(x,y,obj_player_bullet);//create a bullet
}
Collision Event with object obj_enemy_bullet:
execute code:

health-=1;//reduce health
with (other) instance_destroy();//destroy bullet
Draw GUI Event:
execute code:

draw_text(10,10,"Score"+string(score));//draw_score
draw_text(10,30,"Health"+string(health));//draw health

Information about object: obj_enemy_1
Sprite: spr_enemy_1
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_enemy_parent
Children:
Mask:
No Physics Object
Destroy Event:
execute code:

instance_create(x,y,obj_enemy_1);//create new enemy
Step Event:
execute code:

if y>room_height instance_destroy();//destroy if outside room

Information about object: obj_enemy_2
Sprite: spr_enemy_2
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_enemy_parent
Children:
Mask:
No Physics Object
Destroy Event:
execute code:

instance_create(x,y,obj_enemy_2);//create new instance
Step Event:
execute code:

if y>room_height instance_destroy();//destroy if outside room

diff=abs(x-obj_player.x);//get difference between self and plpayer x
if diff<5 instance_create(x,y,obj_enemy_bullet);//if less than 5 fire a bullet

Information about object: obj_enemy_bullet
Sprite: spr_enemy_bullet
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

motion_set(270,6);//set direction and speed
Information about object: obj_player_bullet
Sprite: spr_player_bullet
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

motion_set(90,3);//set direction and speed
Collision Event with object obj_enemy_parent:
execute code:

score+=10;//increase score
with (other) instance_destroy();//destroy other
Information about object: obj_enemy_parent
Sprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children
obj_enemy_1
obj_enemy_2
Mask:
No Physics Object
Create Event:
execute code:

x=random(room_width);//jump to random position
y=-50;//create just off top of screen
motion_set(270,2+random(3));//set direction and speed



















No comments:

When Bad People Make Good Art

I offer six guidelines on cancel culture ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏...

Contact Form

Name

Email *

Message *