Add project code

This commit is contained in:
Andrew Trieu
2025-04-20 15:57:23 +03:00
committed by Andrew Trieu
commit 3fbd0e4977
612 changed files with 11196 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
x_shake = 0;
x_shake_dir = 0;
x_shake_dir_spd = 45;
x_shake_amt = 0;
x_shake_amt_spd = 1/4;
y_shake = 0;
y_shake = 0;
y_shake_dir = 0;
y_shake_dir_spd = 45;
y_shake_amt = 0;
y_shake_amt_spd = 1/4;
audio_play_sound(background_music, 0, true);

View File

@@ -0,0 +1,35 @@
var _cam_width = camera_get_view_width(view_camera[0]);
var _cam_height = camera_get_view_height(view_camera[0]);
if instance_exists(o_player) {
x = o_player.x - _cam_width / 2;
y = o_player.center_y - _cam_height / 2;
}
#region
if x_shake_amt > 0 {
x_shake_dir += x_shake_dir_spd;
x_shake_amt -= x_shake_amt_spd;
} else {
x_shake_amt = 0;
x_shake_dir = 0;
}
x_shake = dsin(x_shake_dir) * x_shake_amt;
if y_shake_amt > 0 {
y_shake_dir += y_shake_dir_spd;
y_shake_amt -= y_shake_amt_spd;
} else {
y_shake_amt = 0;
y_shake_dir = 0;
}
y_shake = dsin(y_shake_dir) * y_shake_amt;
#endregion
x += x_shake;
y += y_shake;
x = clamp(x, 0, room_width - _cam_width);
y = clamp(y, 0, room_height - _cam_height);
camera_set_view_pos(view_camera[0], x, y);

36
objects/o_camera/o_camera.yy generated Normal file
View File

@@ -0,0 +1,36 @@
{
"$GMObject":"",
"%Name":"o_camera",
"eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":2,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
],
"managed":true,
"name":"o_camera",
"overriddenProperties":[],
"parent":{
"name":"Controllers",
"path":"folders/Controllers.yy",
},
"parentObjectId":null,
"persistent":true,
"physicsAngularDamping":0.1,
"physicsDensity":0.5,
"physicsFriction":0.2,
"physicsGroup":1,
"physicsKinematic":false,
"physicsLinearDamping":0.1,
"physicsObject":false,
"physicsRestitution":0.1,
"physicsSensor":false,
"physicsShape":1,
"physicsShapePoints":[],
"physicsStartAwake":true,
"properties":[],
"resourceType":"GMObject",
"resourceVersion":"2.0",
"solid":false,
"spriteId":null,
"spriteMaskId":null,
"visible":true,
}