Skip to content

Instantly share code, notes, and snippets.

@steverichey
steverichey / FlixelProceduralLevelGenAttempt
Last active December 14, 2015 02:39
Very very basic ActionScript code to procedurally generate a Flixel level as an array of ones and zeroes. My first attempt at this sort of thing, turned out much better than expected.
var data:Array = new Array();
var xPosition:uint = 0;
var yPosition:uint = 0;
// Set x and y boundaries
var xHeight:uint = 40;
var yHeight:uint = 30;
@steverichey
steverichey / gist:5100082
Created March 6, 2013 15:28
A copy of the Defaults.XML file.
<?xml version="1.0" encoding="utf-8" ?>
<data>
<display>
<time x="468" y="1" /> <!-- defaults: 474, -1 -->
<splash x="69" y="94" /> <!-- defaults: 69, 94 -->
<about x="4" y="26" okayx="361" okayy="191" /> <!-- defaults: 4, 26, 361, 191 -->
<instructions x="20" y="27" okayx="180" okayy="269" /> <!-- defaults: 20, 27, 180, 269 -->
<setendscore x="75" y="45" okayx="122" okayy="67" cancelx="46" cancely="71" /> <!-- defaults: 75, 45, 122, 67, 46, 71 -->
<scorewarning x="-42" y="13" okayx="248" okayy="29" /> <!-- defaults: -42, 13, 248, 29 -->
<scoreinput x="154" y="28" width="35" height="30" restrict="1234567890" maxchars="3" /> <!-- defaults: 154, 28, 35, 30, 1234567890, 3 -->
@steverichey
steverichey / DontMovePreloader
Created December 18, 2013 18:23
Custom Preloader for HaxeFlixel, used in Don't Move
package;
import flash.Lib;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flixel.system.FlxPreloader;
import flash.events.Event;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
@steverichey
steverichey / Fullscreen FlxGame
Created December 18, 2013 18:53
The FlxGame class from my update to Gama11's MinimalistTD, demonstrating fullscreen resize code.
package;
import flash.events.Event;
import flash.Lib;
import flixel.FlxG;
import flixel.FlxGame;
import flixel.FlxCamera;
class GameClass extends FlxGame
{
@steverichey
steverichey / Splat.hx
Last active August 29, 2015 13:57
Dissolving pixels per frame.
package;
import flash.display.BitmapData;
import flash.geom.Point;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.util.FlxColor;
import flixel.util.FlxColorUtil;
import flixel.util.FlxRandom;
import openfl.Assets;
@steverichey
steverichey / RenderTilemapToSprite
Last active August 29, 2015 14:01
Drawing a FlxTilemap to a FlxSprite
import flixel.FlxCamera;
import flixel.FlxSprite;
import flixel.tile.FlxTilemap;
class Util
{
static public function renderTileMapToSprite(Tiles:FlxTilemap, Sprite:FlxSprite):Void
{
var tempCam:FlxCamera = new FlxCamera(0, 0, Std.int(Tiles.width), Std.int(Tiles.height));
Sprite.makeGraphic(Std.int(Tiles.width), Std.int(Tiles.height), 0);
@steverichey
steverichey / Don't Move Preloader
Created June 12, 2014 12:51
The preloader for Don't Move, uses HaxeFlixel 4.0.0-dev
package states;
import flash.Lib;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flixel.system.FlxBasePreloader;
class Preloader extends FlxBasePreloader
{
private var _progressBar:Bitmap;
@steverichey
steverichey / Localization Strings
Created August 7, 2014 19:23
Localization strings for Don't Move
Here's a list of the strings in the game (SPOILERS kinda):
A game by
Powered by
Press left or right to start
Release left and right
to start
to erase
Touch left or right side to start
Release both sides
Here's a list of the strings in the game (SPOILERS kinda):
A game by: Et spil af
Powered by: Kører på
Press left or right to start: Tryk venstre eller højre for at starte
Release left and right: Slip venstre og højre
to start: for at starte
to erase: for at slette
Touch left or right side to start: Tryk venstre eller højre side for at starte
Release both sides: Slip begge sider
@steverichey
steverichey / pw.sh
Last active May 15, 2018 09:28
Generates a random string of a specified length.
#!/bin/sh
set -e
if [ "$#" -lt 0 ]; then
echo "Usage: pw 16 [lim]"
exit 1
fi
if [ "$#" -gt 2 ]; then