Skip to content

Instantly share code, notes, and snippets.

View eevee's full-sized avatar
🦊

Eevee eevee

🦊
View GitHub Profile
@eevee
eevee / gist:8e667314eb935d8faef999ead9fc7f3f
Created May 30, 2017 20:05
lowercase texture names in doom 2
brick1 - 1 uses, total area 1024 ≈ 0.25 tiles
brown1 - 1 uses, total area 4608 ≈ 1.125 tiles
brownhug - 4 uses, total area 10702.049 ≈ 2.612805 tiles
compblue - 2 uses, total area 2035.1354 ≈ 0.49685922 tiles
door1 - 2 uses, total area 9216 ≈ 2.25 tiles
door1 - 2 uses, total area 9216 ≈ 2.25 tiles
doorblu - 2 uses, total area 3072 ≈ 0.75 tiles
doorstop - 19 uses, total area 2176 ≈ 0.53125 tiles
doorstop - 2 uses, total area 0 ≈ 0 tiles
doorstop - 20 uses, total area 0 ≈ 0 tiles
@eevee
eevee / gist:59012b2a3d4dcdb40b5247ecdc2cfb34
Created May 23, 2017 13:50
tileset potluck contributors
@__mote
@aBinaryTernary
@ach_crvens
@amymist
@BarryBenson2007
@bulbasort
@BushytailSkwirl
@doniamae
@eevee
@eltoraz
@eevee
eevee / potluck.js
Created May 12, 2017 02:06
initial crack at potluck with pixi, because someone asked
window.Potluck = {};
let _index_to_coords = function(index, columns) {
return [index % columns, Math.floor(index / columns)];
};
Potluck.begin = function() {
let renderer = PIXI.autoDetectRenderer(800, 600);
document.body.appendChild(renderer.view);
@eevee
eevee / famicube64-canon-order.pal
Last active May 6, 2017 08:00
Famicube 64 palette
JASC-PAL
0100
65
0 0 0
0 23 125
2 74 202
0 132 255
91 168 255
152 220 255
155 160 239
@eevee
eevee / pico8jstocart.py
Created March 23, 2017 12:14
Python script to convert exported JavaScript back into a PICO-8 cartridge
import os.path
import re
import sys
# LZ-ish decompression scheme borrowed from picolove:
# https://github.com/gamax92/picolove/blob/master/cart.lua
compression_map = b"\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"
def decompress(code):
lua = bytearray()
@eevee
eevee / collision.lua
Created March 19, 2017 07:41
tile-based pico8 collision i wrote in like an hour or two
platscene = {
xaccel = 0.5,
xmax = 2,
gravity = 0.5,
ymax = 16,
}
function platscene:switch()
self.mapbbox = {0, 0, 16, 16}
self.playerbbox = {
0, 0,
@eevee
eevee / busted.rs
Created March 14, 2017 03:12
weird-ass rust problem
enum IResult<I, O, E = u32> {
Done(I, O),
Error(E),
}
fn foo(input: &[u8]) {
if let IResult::Done(i, o) = IResult::Done(input, input) {}
}
@eevee
eevee / untitled.md
Created December 15, 2016 20:29
Find the nearest/furthest actor from a source in ZDoom DECORATE

I needed a monster to set the nearest corpse as its target, but the same idea could be adapted to anything else easily enough.

  1. Clear the source's target. Set some user var on the source, user_closest_target, to a null-ish value like -1.

  2. Use A_RadiusGive from the source to give a dummy inventory item to every candidate actor.

  3. From the inventory item, call an ACS script.

  4. In the ACS script (where the candidate is the activator), check the distance from the candidate to the source via GetActorX, GetActorY, and VectorLength. If that distance is closer than user_closest_target (or user_closest_target is -1, meaning this is the first candidate checked), update user_closest_target and set the source's target to this candidate.

@eevee
eevee / twitterbugs.md
Last active December 15, 2016 00:45
Twitter bugs and inconsistencies and general weirdness

Twitter bugs and inconsistencies and general weirdness

Derived in part from my attempt at a comprehensive list of the rules, which is probably out of date by now: https://eev.ee/blog/2016/02/20/twitters-missing-manual/

Tweets and replies

  • Poll options on web Twitter do not render emoji with Twemoji. They're left as plain text.

  • On web Twitter, typing several capital letters in a row tends to bring up a user suggestion dropdown. I guess the idea is that a word starting with a capital letter is likely to be a name, but the behavior seems erratic and unpredictable. It has never once been useful to me — if I want to mention someone, the first thing I type is @.

@eevee
eevee / value.py
Created November 11, 2016 22:28
intercepting attribute assignment
class InterceptableAttribute:
def __init__(self, name, *twiddles):
self.twiddles = twiddles
# NOTE: this call and the 'name' arg will no longer be necessary in
# Python 3.6
self.__set_name__(None, name)
def __set_name__(self, owner, name):
self.name = name