Skip to content

Instantly share code, notes, and snippets.

@attic-stuff
attic-stuff / poissondisc.gml
Last active April 12, 2025 21:06
generate an array of points using a blue noise distribution.
/**
* generates an array of blue noise points using poisson discs
* @param {real} width the width of the region of points
* @param {real} height the height of the region of points
* @param {real} radius the poisson disc radius, or space between each point
* @param {real} rejections the number of attempts made to generate a point before moving on
*/
function bluenoise(width, height, radius = 4, rejections = 30) constructor {
static sample = function(x, y) constructor {
@nkrapivin
nkrapivin / rerand.gml
Created October 4, 2022 14:38
RERand - 100% correct GML runtime RNG implementation.... in pure GML!
function rerand() constructor {
state = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
g_nRandSeed = 0;
g_RndIndex = 0;
s_nRandomPoly = $DA442D24;
RND_MAX = $FFFFFFFF;
s_nStateAndMask = RND_MAX;
InitRandom = function(/*uint*/ _seed) {
var uVar3 = _seed;
@Nielk1
Nielk1 / ExtendInput.DataTools.DualSense.TriggerEffectGenerator.cs
Last active October 25, 2025 15:27
Factories for all DualSense trigger effects
/*
* MIT License
*
* Copyright (c) 2021-2022 John "Nielk1" Klein
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is