Skip to content

Instantly share code, notes, and snippets.

@YellowAfterlife
YellowAfterlife / Main.hx
Created May 29, 2014 20:29
Generates typedef redirection files for openfl-bitfive
import haxe.io.Path;
import sys.FileSystem;
import sys.io.File;
class Main {
static function remap(from:String, to:String, pkg:String = "") {
for (file in FileSystem.readDirectory(from)) {
if (FileSystem.isDirectory('$from/$file')) {
if (!FileSystem.exists('$to/$file')) {
FileSystem.createDirectory('$to/$file');
@YellowAfterlife
YellowAfterlife / Swap.hx
Created June 4, 2014 12:23
Value swap macros for Haxe
class Main {
macro static function swap(a, b) {
return macro { var v = $a; $a = $b; $b = v; };
}
static function main() {
var i = 10, j = 15;
trace(i, j); // 10, 15
swap(i, j);
trace(i, j); // 15, 10
}
@YellowAfterlife
YellowAfterlife / export.js
Created June 16, 2014 05:37
Tululoo export.js file with support for canvas scaling.
/*********************************************
* Tululoo Game Maker //TULULOO_VERSION
*
* Creators
* Zoltan Percsich
* Vadim "YellowAfterlife" Dyachenko
*
* (c) SilentWorks 2011 - 2014
* All rights reserved.
* www.tululoo.com
@YellowAfterlife
YellowAfterlife / closure.js
Created July 20, 2014 14:38
Does Google Closure not like this for-loop macros?
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name default.js
// @formatting pretty_print
// ==/ClosureCompiler==
// Before Closure: 0, 1, 3
// After Closure: 0, 1, 3, 5, 6
// Bug
Stay within the confines of the giant beast's shadow to avoid its wrath
Only way to power-up is to die & be reborn as a more powerful creature but you have to keep finding secret 1-ups to kamikaze.
You are a piñata. find required amount hidden candy. inbetween levels, kids beat the shit out of you & the adults rebuild you.
A stealth game about a towering giant that wears the stealthiest footwear a giant can wear: skyscraper boots.
You are in a living, breathing dungeon where some doors have pulsing veins to be slit & other doors have grotesque hands to shake
Follow a trail of blood through a maze dungeon. defeat creatures. their blood splatter disorientates you.
Game title: alt-stab-delete.
You tire of your power. you decide to give 1 power-up to each of your friends. outcomes differ, depending what each friend gets.
Every enemy body part has an inventory of verbs to steal from, slowly providing each of your body parts with more freedom.
A game about finding your way out of small, enclosed spaces before your
@YellowAfterlife
YellowAfterlife / Program.cs
Created August 5, 2014 16:54
A test for clipboard manipulation in C#.
using System;
using System.IO;
using System.Windows.Forms;
// ^ In a console application project you'll need to add a reference to this first.
namespace CSCoTest {
class Program {
static MemoryStream stringToMemoryStream(string value) {
return new MemoryStream(System.Text.Encoding.UTF8.GetBytes(value));
}
/// draw_background_layer(index, x, y, bx, by, bw, bh)
/// draw_background_layer(index, x, y, view)
// Simulates built-in background drawing behaviour (for non-use-for-3d backgrounds).
var idx = argument[0], bi;
bi = background_index[idx]
if (bi == -1) return 0
if (!background_visible[idx]) return 0
if (!background_exists(bi)) return 0
var ox = argument[1], oy = argument[2],
rx, ry, rw, rh;
/// draw_background_layer(index, x, y, bx, by, bw, bh)
/// draw_background_layer(index, x, y, view)
// Simulates built-in background drawing behaviour (for use-for-3d backgrounds).
var idx = argument[0], bi;
bi = background_index[idx]
if (bi == -1) return 0
if (!background_visible[idx]) return 0
if (!background_exists(bi)) return 0
var ox = argument[1], oy = argument[2],
rx, ry, rw, rh;
/**
* Draws a "square" to given Graphics object.
* @param g Graphics object to draw in
* @param x X position of square (px)
* @param y Y position of square (px)
* @param z Size of square (px)
* @param a Top-left value (0..1)
* @param b Top-right value (0..1)
* @param c Bottom-left value (0..1)
* @param d Bottom-right value (0..1)
var i;
i := 0;
while (i < 10) begin
show_message("o rly");
i := i + 1;
end;