Skip to content

Instantly share code, notes, and snippets.

/// par_solid Create Event
z = 0;
height = 1;
width = 2;
length = 2;
// Assign a proper sprite texture
if (sprite_exists(spr_blockOther)) {
tex = sprite_get_texture(spr_blockOther, 0);
} else {
/// Collision Event with obj_player
if (!held_by_player && place_meeting(x, y, obj_player)) {
held_by_player = true;
trigger_active = true;
// Optionally move out of room
// x = y = z = -9999;
}
sensitivity = 0.1 //Mouse movement
max_spd = 2; //speed of character
acc = 0.1; //acelleration
fb_vel = 0; //forwards and backwards velocity
rl_vel = 0; //right and left
z_vel = 0;
jump_spd = 0;
depth = 0;
@itzliru
itzliru / [obj_GameController]Create_0.gml
Created September 10, 2025 05:06
obj_GameController
// ==============================
// Player-related globals
// ==============================
global.player_health = 100;
global.player_max_health = 100;
global.player_shield = 0;
global.player_speed = 4;
global.player_jump_strength = 8;
global.player_score = 0;
global.player_ammo = 30;
/// @description Insert description here
// You can write your code in this editor
global.paused = false;
// Feather disable all
// @ignore
function Drago3D_Internals() {
static Vertex = function(vbuff, x, y, z, nx, ny, nz, u, v, c, a) {
vertex_position_3d(vbuff, x, y, z);
vertex_normal(vbuff, nx, ny, nz);
vertex_colour(vbuff, c, a);
vertex_texcoord(vbuff, u, v);
};
@itzliru
itzliru / [obj_device_proto]Create_0.gml
Created September 10, 2025 04:57
obj_device_proto
/// @description Insert description here
// You can write your code in this editor
/// obj_device_proto Create Event
held = false; // Is it currently held by the player?
player_ref = noone; // Reference to the player holding it
z = 0; // Ground level by default
depth = 9999; // For sorting in 3D if needed
height = 1;
@itzliru
itzliru / [obj_builderController]Create_0.gml
Created September 10, 2025 04:54
obj_builderController
/// --- BuilderController Create Event (Drago3D safe) ---
// Debug and editing flags
global.debug_mode = false;
global.editing_block = false;
// Grid and cube defaults
global.grid_size = 64;
global.current_z = 0;
@itzliru
itzliru / [obj_audio_source]Create_0.gml
Last active September 10, 2025 04:51
obj_audio_source
/// Create Event of obj_audio_source
// Ensure we have a z variable for 3D positioning
z = 0; // or whatever default you want
// Play a looping sound at this world position
sound_id = audio_play_sound_at(snd_generator_hum, x, y, z, 50, 300, 1, true, 1);
// Register with the waveform device if it exists
if (instance_exists(obj_waveform_device)) {
@itzliru
itzliru / [obj_camera]Create_0.gml
Created September 10, 2025 04:40
My GameMaker Project : [Objects]
/// @description Set up 3D things
depth = 9999;
// Bad things happen if you turn off the depth buffer in 3D
gpu_set_ztestenable(true);
gpu_set_zwriteenable(true);
#region vertex format setup
// Vertex format: data must go into vertex buffers in the order defined by this
vertex_format_begin();