Skip to content

Instantly share code, notes, and snippets.

View Sunjammer's full-sized avatar

Andreas Rønning Sunjammer

  • Trondheim, Norway
View GitHub Profile
@Sunjammer
Sunjammer / particles.js
Last active March 26, 2019 16:50
ECSArticle
function createParticle(px, py, vx, vy, lifespan) {
return {
type: "Particle",
x: px,
y: py,
vx,
vy,
age: 0,
lifespan,
@Sunjammer
Sunjammer / (Would Disney Own Gotham?).md
Last active April 11, 2018 03:28
Comics Explained Markov Mayhem
  • [Weekly Q&A] Secret Origin of The Weekly Pull Podcast [Convergence & Chewbacca vs The Return of The Weekly Pull Podcast Live - Episode 12 - The Death of The Weekly Pull Podcast w/ItsSuprEffective DC Rebirth: Supergirl Wrecks Superman Part 4 Deadpool Kills The Infinity War: Iron Man Logan vs The Infinity War: Part 3 - The Weekly Pull Podcast Live - 1 of The Marvel Comics: The Weekly Pull at 6pm EST DC Rebirth: The X-Men Get Spider-Man's Daughter Of The Marvel Comics: The Flash Rebirth Vol 1: Big Picture Marvel Civil War Hulk Vol 8: Fall of Bruce Banner's Guilt Hulk vs The Black Superhero: Part 5 - Episode 5 versions of The Flash Rebirth Vol 3: The Return Of The Weekly Pull Podcast Live Q&A Session] Galactus: World What is the Civil War - Death of.. (Marvel Legacy) The Weekly Pull Podcast Live - 2 Marvel Comics: The Red Hulk vs The Death Of.. (Batman: White Phoenix Force & The Return of The Return of The Weekly Pull Podcast - Part 1 Everything Right With Prep Time/Plot Armor Hunters Every Metahuman Hunt For T
@Sunjammer
Sunjammer / coldboot.md
Created December 1, 2017 20:14
coldboot.md

LD40

"Cold boot"

The world is fucked. You're the last defender, and you're in a shithole of a bunker, trapped like a rat under siege by murderous bugs. Thankfully you have a terminal interface into one of the last functioning automated factory units. Design, program and optimize your defenses.

Programmable tower defense

They come out at night. Mostly.

@Sunjammer
Sunjammer / Gizmos.ux
Created October 31, 2017 10:58
Fusetools Gizmos util classes
<Panel ux:Class="Gizmo.Gizmos">
<Text ux:Class="Gizmo.Text" HitTestMode="None" Color="Black" FontSize="12" />
<Circle ux:Class="Gizmo.Dot" StrokeColor="#0F0" Width="10" Height="10" SnapToPixels="true" HitTestMode="None" />
<Rectangle ux:Class="Gizmo.Rect" StrokeColor="#0F0" HitTestMode="None" />
<Gizmo.Rect ux:Class="Gizmo.Bounds" >
<StackPanel Alignment="TopLeft">
<Gizmo.Text Value="x:{= x(this)}" />
@Sunjammer
Sunjammer / tutorial.xml
Last active August 26, 2017 20:35
CroissantScript
<?xml version="1.0" encoding="utf-8" ?>
<data>
<level name="Let's fly a Croissant!">
<setup> <!-- Level pre-init, setting up background graphics in this case -->
<background>
<texture>assets/data/backgrounds/bg_space2.png</texture>
<blendmode>NORMAL</blendmode>
<distortion>10</distortion> <!-- a sine*sine vertex distortion effect measured in pixels -->
@Sunjammer
Sunjammer / Instruction.hx
Last active December 10, 2016 23:48
VM nonsense for LD
package vm;
enum Instruction
{
LDA(v:Value); //Load value into A
LDX(v:Value); //Load value into X
LDY(v:Value); //Load value into Y
STA(v:Value); //Store A at memory
STX(v:Value); //Store X at memory
STY(v:Value); //Store Y at memory
@Sunjammer
Sunjammer / a.hx
Created December 10, 2016 03:42
JS code generation bug?
//stack is an inline property performing array access
function popStack():Int
{
var v = memory[STACK_OFFSET + stack - 1];
stack--;
return v;
}
package;
import haxe.ds.Vector;
using StringTools;
using Std;
enum Value
{
Literal(v:Int);
Location(v:Int);
@Sunjammer
Sunjammer / Shortish.hx
Last active August 29, 2015 14:17
Shitty haxe short lambdas
package;
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Expr.Field;
import haxe.macro.Expr.FieldType;
import haxe.macro.Expr.Function;
import haxe.macro.MacroStringTools;
using StringTools;
/**
* ...
@Sunjammer
Sunjammer / Lissajous
Created March 2, 2015 15:05
Lissajous utils
public class Lissajous {
public static function lissajousKnot(t:Float, a:Int, b:Int, c:Int, ap:Float, bp:Float, cp:Float, out:{x:Float,y:Float,z:Float}) {
t *= 6.28;
out.x = Math.cos(a * t + ap);
out.y = Math.cos(b * t + bp);
out.z = Math.cos(c * t + cp);
}
public static function lissajousCurve(t:Float, a:Int, b:Int, out:{x:Float, y:Float}) {
t *= 6.28;