Skip to content

Instantly share code, notes, and snippets.

View camilacanhete's full-sized avatar

camilacanhete

View GitHub Profile
@camilacanhete
camilacanhete / PseudoRandom.ts
Created October 25, 2023 14:25
Pseudo random with seed
/**
* Generates a random number using a seed
* @author csantos
*/
export class PseudoRandom {
private state: number;
/**
* Creates a new Random instance with the specified seed
* @param seed - the seed for initializing the random number generator
@camilacanhete
camilacanhete / room.gml
Created June 9, 2018 21:55
GameMaker: Studio mobile display setup (keeping aspect ratio without black bars)
/* Paste this script inside your room creation code */
view_wview[0] = floor(global.viewWidth);
view_hview[0] = floor(global.viewHeight);
view_wport[0] = global.maxWidth;
view_hport[0] = global.maxHeight;
view_xview[0] = (global.idealWidth / 2) - (floor(global.viewWidth) / 2); //csantos: center-align view width
view_yview[0] = (global.idealHeight/ 2) - (floor(global.viewHeight)/ 2); //csantos: center-align view height
display_set_gui_size(view_wview[0], view_hview[0]);