Sprite: spr_player
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
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_1Sprite: spr_enemy_1
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_enemy_parent
Children:
Mask: No Physics ObjectDestroy Event:execute code: instance_create(x,y,obj_enemy_1);//create new enemyStep Event:execute code: if y>room_height instance_destroy();//destroy if outside roomInformation about object: obj_enemy_2Sprite: spr_enemy_2
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_enemy_parent
Children:
Mask: No Physics ObjectDestroy Event:execute code: instance_create(x,y,obj_enemy_2);//create new instanceStep 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 bulletInformation about object: obj_enemy_bulletSprite: spr_enemy_bullet
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask: No Physics ObjectCreate Event:execute code: motion_set(270,6);//set direction and speedInformation about object: obj_player_bulletSprite: spr_player_bullet
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask: No Physics ObjectCreate Event:execute code: motion_set(90,3);//set direction and speedCollision Event with object obj_enemy_parent:execute code: score+=10;//increase score with (other) instance_destroy();//destroy otherInformation about object: obj_enemy_parentSprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
ChildrenMask:
obj_enemy_1
obj_enemy_2 No Physics ObjectCreate 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:
Post a Comment