Skip to content

Instantly share code, notes, and snippets.

@freem
freem / gameplay_out-extra.lua
Created September 8, 2011 04:49
how to get Extra Stage animations working (StepMania 5 rev. aa15a65bb901 and later)
local t = Def.ActorFrame {
Def.Quad{
InitCommand=cmd(FullScreen;diffuse,color("0,0,0,0"););
OnCommand=cmd(sleep,0.5;linear,1.5;diffusealpha,1);
};
-- Cleared
Def.ActorFrame {
Name="ClearedFrame";
Condition=GAMESTATE:GetPlayMode() ~= PLAY_MODE_BATTLE and GAMESTATE:GetPlayMode() ~= PLAY_MODE_RAVE;
@shakesoda
shakesoda / steps.rs
Created December 8, 2011 02:53
RS format spec (WIP)
--
This format is designed to be very easy to parse, flexible and deterministic. A
section may only be defined once. If multiple are defined using the same
identifier then only the first will be parsed.
Sections are marked by lines beginning with -- <identifier>. Blank identifiers
or ones that aren't searched for will be completely ignored and may contain
anything. Spaces, Tabs, and Newlines (LF, CRLF) are ignored.
Note: the version tag is _required_ to guarantee compatibility - if you don't
#define FORMAT(str) \
{ \
va_list va; \
char staticbuf[1024]; \
char *buf = staticbuf; \
va_start(va, in); \
unsigned int need = vsnprintf(buf, sizeof(staticbuf), in, va) + 1; \
if (need > sizeof(staticbuf)) \
{ \
/* staticbuf wasn't large enough, malloc large enough */ \
@paulirish
paulirish / rAF.js
Last active June 11, 2024 14:29
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@dradtke
dradtke / Makefile
Created April 25, 2012 22:35
Hello World example for Allegro.
CC := gcc
CFLAGS := -g -Wall
LIBS := -lallegro
SOURCES := $(shell find src/ -type f -name "*.c")
OBJECTS := $(SOURCES:.c=.o)
TARGET := game
all: $(SOURCES) $(TARGET)
$(TARGET): $(OBJECTS)
@dradtke
dradtke / Makefile
Created September 25, 2012 21:38
Example Makefile for building and running a self-contained game
CC := clang
TARGET := game
AL_CFLAGS := -Ilib/allegro/include
AL_LDFLAGS := -Llib/allegro/lib
GLIB_CFLAGS := -Ilib/glib -Ilib/glib/glib
GLIB_LDFLAGS := -Llib/glib/glib/.libs
CFLAGS := -g -Wall $(AL_CFLAGS) $(GLIB_CFLAGS)
LDFLAGS := $(AL_LDFLAGS) $(GLIB_LDFLAGS)
@dradtke
dradtke / main.c
Created September 25, 2012 21:47
#include <allegro5/allegro.h>
#include <glib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
uint32_t al_version = al_get_allegro_version();
int al_major_version = al_version >> 24;
int al_minor_version = (al_version >> 16) & 255;
int al_revision = (al_version >> 8) & 255;
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@L-four
L-four / extsubs.py
Created October 16, 2012 11:27
Basic script for extracting SSA/ASS subs from mkv(matroska) and converting them to webvtt
#!/usr/bin/env python3
import sys
import os
import re
import subprocess
def get_files_subs(file):
file = file.rstrip('\n')
qfile = quote(file)
@TomK32
TomK32 / control_maps.lua
Created November 12, 2012 16:56
control maps in LÖVE2D
-- small improvement from http://tannerrogalsky.com/blog/2012/04/06/control-maps-in-love2d/
-- this version has a cleaner control_map by calling m
class "GameController" {
moveUp = function(self)
end,
control_map = {
keyboard = {
on_press = {