Skip to content

Instantly share code, notes, and snippets.

@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 / AndroidManifest-Common
Created January 28, 2015 21:56
Just some AndroidManifest values. I forget these a lot I guess.
<!-- Camera -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<!-- GPS -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
@steverichey
steverichey / execfix
Created April 29, 2015 16:05
Fix for OSX Yosemite "can't be opened" bug
#!/bin/sh
# Fixes "*.app can't be opened" errors
# Run `chmod +x` on this file and then
# move it to /usr/bin/ to make it GLOBAL
if [ $# -eq 0 ]
then
echo "No arguments supplied! Expected a path to a .app file"
elif [ -z "$1" ]
@steverichey
steverichey / icns.sh
Created August 25, 2015 02:46
A shell script to convert a single image of arbitrary size to an ICNS file in OS X.
#!/bin/sh
# exit on error
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: icns myicon.png"
exit 0
fi
@steverichey
steverichey / install.sh
Last active October 27, 2015 17:48
Shell script to install HaxeFlixel and dependencies on a Wercker instance
#!/bin/bash
# Install script for application setup on Wercker boxes
# Exit script on error
set -e
echo "Updating apt-get"
# Without updating, apt-get won't find curl
apt-get update
@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;