Step Event:
execute code:
//wrap around room
if x<-(sprite_width/2) x=(room_width+1)+(sprite_width/2);
if x>(room_width+1)+(sprite_width/2) x=-(sprite_width/2);
Information about object: obj_car_1
Sprite: spr_car_1
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
motion_set(180,2);
Information about object: obj_car_2
Sprite: spr_car_2
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
motion_set(0,2);
Information about object: obj_car_3
Sprite: spr_car_3
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
motion_set(0,2);
Information about object: obj_car_4
Sprite: spr_car_4
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
motion_set(180,2);
Information about object: obj_border
Sprite: spr_border
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Information about object: obj_waterSprite: spr_water
Solid: false
Visible: true
Depth:
20
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Information about object: obj_wood_leftSprite: spr_wood
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_wood_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
motion_set(180,3);
Information about object: obj_wood_right
Sprite: spr_wood
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_wood_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
motion_set(0,3);
Information about object: obj_wood_parent
Sprite:
Solid: false
Visible: true
Depth:
0
Persistent: false
Parent: obj_parent
Children
obj_wood_left
obj_wood_right
Mask:
No Physics Object
Information about object: obj_frogSprite: spr_frog
Solid: false
Visible: true
Depth:
-30
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(vk_up)) {y-=5;}
if (keyboard_check(vk_down)) {y+=5;}
//check if game won
if (place_meeting(x,y,obj_win) and not place_meeting(x,y,obj_croc))
{
show_message("You win");
game_restart();
}
//check if collision with croc
if (place_meeting(x,y,obj_croc))
{
show_message("You die");
game_restart();
}
//check if car collision, border, or water & not log
if (place_meeting(x,y,obj_car_1) or place_meeting(x,y,obj_car_2)
or place_meeting(x,y,obj_car_3) or place_meeting(x,y,obj_car_4)
or place_meeting(x,y,obj_border)) or (place_meeting(x,y,obj_water) and not place_meeting(x,y,obj_wood_parent))
{
show_message("You die");
game_restart();
}
//move left if collide with obj_wood_left
if (place_meeting(x,y,obj_wood_left))
{
x-=3;
}
//move right if collide with obj_wood_right
if (place_meeting(x,y,obj_wood_right))
{
x+=3;
}
Information about object: obj_win
Sprite: spr_win
Solid: false
Visible: true
Depth: 0
Persistent:
false
Parent:
Children:
Mask:
No Physics Object
Information about object: obj_crocSprite: spr_croc
Solid: false
Visible: true
Depth:
-25
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
alarm[0]=3*room_speed;
Alarm Event for alarm 0:
execute code:
x=choose(200,400,600);
alarm[0]=3*room_speed;
No comments:
Post a Comment