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
Create Event:
execute code: count=200;//set a timing counter alarm[0]=room_speed;//set spawn alarm
Alarm Event for alarm 0:
execute code: instance_create(random(room_width),0,obj_barrel);//spawn a barrel alarm[0]=count;// rest alarm with count value count-=5;//decrease count if count<5 count=5;//keep at 5
Step Event:
execute code: //movement if (keyboard_check(vk_left)) {x-=5;} if (keyboard_check(vk_right)) {x+=5;} if place_meeting(x,y,obj_barrel)// if collides with barrel { show_message("You Died"); game_restart(); }
Information about object: obj_barrelSprite: spr_barrel Solid: false Visible: true Depth: 0 Persistent: false Parent:Children: Mask: No Physics ObjectCreate Event:execute code: motion_set(270,3);//move down at speed 3Step Event:execute code: if y>room_height instance_destroy();//destroy when reached bottom of screen
No comments:
Post a Comment