Skip to content

Instantly share code, notes, and snippets.

@iaman
iaman / color_utils.js
Created April 15, 2019 21:52
An importable library for dealing with HEX/RGB colors and getting contrast info
const VALID_HEX_CHARS = {
"0": true,
"1": true,
"2": true,
"3": true,
"4": true,
"5": true,
"6": true,
"7": true,
"8": true,
2T-DS
4-LOM
Rel Acoi
Shahan Alama
Amanaman
Amzartho
Keeth Anak
Odon Anak
Mol Arcasite
Arcuse
@iaman
iaman / LogitechPOS.xml
Created April 5, 2014 00:36
Another Towerfall: Ascension controller config, this time for some corded Logitech controller I've been carrying around for about a decade... I guess it's technically a corded Logitech RumblePad 2 controller?
<gamepad>
<name>Logitech POS</name>
<id>c218046d-0000-0000-0000-504944564944</id>
<jump>
<button id="1"/>
</jump>
<shoot>
<button id="0"/>
<button id="2"/>
@iaman
iaman / ANNE.xml
Created April 5, 2014 00:26
A Towerfall:Ascension controller configuration file for the A.N.N.E SNES-style USB controller
<gamepad>
<name>A.N.N.E Controller</name>
<id>00110079-0000-0000-0000-504944564944</id>
<jump>
<button id="2"/>
</jump>
<shoot>
<button id="1"/>
<button id="3"/>
@iaman
iaman / POI draw
Last active December 20, 2015 09:39
Hacking out some basic POI-based AI pathfinding in GML (Game Maker Language). I've literally never studied or read up on AI before, this is just a stab in the dark that seems to work.
if (self.inFocus) {
// OMG SENPAI'S LOOKING RIGHT AT ME
draw_sprite(focusedSprite, 0, round(self.x), round(self.y));
}
else if (self.investigated) {
// SENPAI COME BACK PLZ
draw_sprite(investigatedSprite, 0, round(self.x), round(self.y));
}
else if (self.inSight) {
// Senpai noticed me!!!!111!11!1!!!1!1 !