Skip to content

Instantly share code, notes, and snippets.

View eevee's full-sized avatar
🦊

Eevee eevee

🦊
View GitHub Profile
@eevee
eevee / 3dfloors-notes.md
Created September 21, 2016 00:25
notes on remaining work on 3d floors
  • 3d floors
    • somewhat critical problem: ordering 3d floors by height means that the selection changes if you mousewheel the height above/below another floor
      • maybe i should get rid of the duplicated extra_floor_t struct and instead give each sector just a list of the control sectors, then identify by those instead of index?
      • could still stay sorted, even
      • it IS possible to have the same control sector mapped to two 3d floors, though. but is that ever useful??
      • i really wish i had faux flat/wall objects
        • i REALLY WISH i could just pass around sector pointers and bail if they're bogus??
    • can't highlight or select an inner flat of a 3d floor
    • mousewheel to change a regular ceiling height is super slow in my dump3 map; i think the full mapspecials thing is too expensive
  • may need to do actual incremental updates in this branch, right now! OH NO
@eevee
eevee / scope.lua
Created August 29, 2016 17:33
Lua scope is weird man
-- This works: "bar()" references a global by default, and the next block sets
-- a global variable.
function foo()
bar()
end
function bar()
print("bar")
end
-- This DOESN'T work: "bar()" references a global because Lua hasn't seen
@eevee
eevee / pokemon.yaml
Last active August 13, 2016 02:02
first iteration of ww-red/pokemon.yaml
%TAG !dex! tag:veekun.com,2005:pokedex/
--- !!omap
- bulbasaur: !dex!pokemon
name:
de: BISASAM
en: BULBASAUR
es: BULBASAUR
fr: BULBIZARRE
it: BULBASAUR
types:
0xc2 0xa0 0xc2 0xac, 0xc2 0xae 0xc2 0xbf, 0xc3 0x80 0xc3 0xbf, 0xe2 0x86 0x90 0xe2 0x87 0xbf, 0xe2 0x98 0x80 0xe2 0x9b 0xbf, 0xe2 0x9c 0x80 0xe2 0x9e 0xbf, 0xe3 0x80 0x81 0xe3 0x80 0x9c, 0xe3 0x81 0x81 0xe3 0x82 0x94, 0xe3 0x82 0xa1 0xe3 0x83 0xbe
@eevee
eevee / decorate-thoughts.lua
Created June 20, 2016 23:04
some thoughts on augmenting zdoom's DECORATE with lua
ZombieMan = define_actor{
name = "ZombieMan",
health = 20,
radius = 20,
height = 56,
speed = 8,
-- Why is this an integer out of 256 instead of just a float chance?
pain_chance = 0.78125,
monster, -- TODO These property bundles are really weird
floorclip = true,
@eevee
eevee / extract-music.py
Created May 31, 2016 06:49
Python script to reconstitute music from a PICO-8 cartridge
# script to extract music from a pico-8
# requires exporting sounds from the pico-8 first!
# run as: python extract-music.py mygame.p8 sound%d.wav music%d.wav
# by eevee, do what you like with this code
from __future__ import print_function
import argparse
import struct
import wave
@eevee
eevee / perlin.py
Last active March 2, 2024 08:48
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
Lua 5.3.2 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> mt = {__index = function(t, k) print("[" .. k .. "]") end}
> x = 3
> debug.setmetatable(x, mt)
3
> x.hello
[hello]
nil
@eevee
eevee / 1-computer-talk.bas
Created April 6, 2016 16:25
VTech PreComputer 1000 example programs
10 B$="PRE-COMPUTER"
20 PRINT "I AM "; B$
30 INPUT "WHAT IS YOUR NAME"; N$
40 PRINT "HELLO "; N$
50 INPUT "HOW OLD ARE YOU"; A
60 PRINT "SO "; N$; " YOU ARE"
70 PRINTA; "YEARS OLD"
80 PRINT "I HOPE" : PRINT "WE HAVE FUN!!"
90 END
@eevee
eevee / change.bas
Last active April 5, 2016 21:55
I was a dick
DECLARE SUB Change (C AS INTEGER, D AS INTEGER, R AS INTEGER)
DECLARE FUNCTION Round$ (N!, D AS INTEGER)
DIM SHARED A AS SINGLE, A2 AS INTEGER
SCREEN 12
DO
CLS
COLOR 15
PRINT "How much did you spend ($0 - 100)? ";
COLOR 14: INPUT "", A
DO WHILE A < 0 OR A > 100