Information about object: obj_husky
Sprite: spr_husky_down
Solid: false
Visible: true
Depth: -10
Persistent: true
Parent:
Children:
Mask:
Physics
Start Awake: true
Is Kinematic: false
Is Sensor: false
Density: 0.5
Restitution: 0.1
Group: 0
Linear Damping: 0.1
Angular Damping: 0.1
Friction: 0.2
Shape: Box
Points:
(4, 0)
(30, 0)
(30, 42)
(4, 42)
Create Event:
execute code:
//Set fix rotatir
phy_fixed_rotation = true;
spd = 10;
image_speed = 0;
Step Event:
execute code:
image_speed = 0;
//MOVE UP
if keyboard_check(ord('W')) {
phy_position_y -= spd ;
if place_meeting(x, y, obj_wall2)
y += 32 - (bbox_top & 31);
sprite_index = spr_husky_up;
image_speed = 0.2;
}
//MOVE LEFT
if keyboard_check(ord('A')) {
phy_position_x-= spd;
if place_meeting(x, y, obj_wall2)
x += 32 - (bbox_left & 31);
sprite_index = spr_husky_left;
image_speed = 0.2;
}
//MOVE DOWN
if keyboard_check(ord('S')) {
phy_position_y+= spd;
if place_meeting(x, y, obj_wall2)
y -= (bbox_bottom + 1) & 31;
sprite_index = spr_husky_down;
image_speed = 0.2;
}
//MOVE RIGHT
if keyboard_check(ord('D')) {
phy_position_x+= spd;
if place_meeting(x, y, obj_wall2)
x -= (bbox_right + 1) & 31;
sprite_index = spr_husky_right;
image_speed = 0.2;
}
//Stop animating
if !keyboard_check(ord('W')) and !keyboard_check(ord('A')) and !keyboard_check(ord('S')) and !keyboard_check(ord('D')) {
image_speed = 0;
image_index = 0;
}
Collision Event with object obj_wall2:
execute code:
//
Collision Event with object obj_warp:
execute code:
//go throught the door
if (room_exists(other.new_room)){
room_goto(other.new_room);
x = other.new_x;
y = other.new_y;
}
Collision Event with object obj_building:
execute code:
//
Other Event: Room Start:
execute code:
phy_fixed_rotation = true;
Draw GUI Event:
execute code:
draw_set_color(c_red);
draw_rectangle(bbox_left, bbox_top, bbox_right + 1, bbox_bottom + 1, false);
draw_self();