Skip to content

Instantly share code, notes, and snippets.

View williammustaffa's full-sized avatar
🏆

William Lima williammustaffa

🏆
View GitHub Profile
function seconds_to_gamespeed(_seconds) {
return game_get_speed(gamespeed_fps) * _seconds;
}
/**
* new Timer(_bind, _callback)
* @param _bind scope of the callback, usually the
* @param _callback function to be executed
*
* Methods
@williammustaffa
williammustaffa / xorcrypt_buffer.gml
Created December 1, 2025 01:45
2-way encryption for buffers
#macro ENCRIPTION_KEY "your-encryption-key"
function xorcrypt_buffer(_buff) {
var _key = ENCRIPTION_KEY;
var _key_len = string_byte_length(_key);
var _size = buffer_get_size(_buff);
// Iterate through the buffer and XOR every byte
for (var i = 0; i < _size; i++) {
var _byte = buffer_peek(_buff, i, buffer_u8);