Skip to content

Instantly share code, notes, and snippets.

View zachwlewis's full-sized avatar
💭
Shipping!

Zachary Lewis zachwlewis

💭
Shipping!
View GitHub Profile
@zachwlewis
zachwlewis / DungeonWorld.as
Created September 13, 2010 18:44 — forked from sjakaus/gist:577766
The proper way to add entites to a new World in FlashPunk.
package
{
import net.flashpunk.World;
import Master;
public class DungeonWorld extends World
{
public function DungeonWorld()
{
@zachwlewis
zachwlewis / IsometricIO.as
Created September 14, 2010 02:49
IsometricIO.as: Provides support for reading from and writing to XML objects for the IsometricGrid library.
package net.thegamestudio
{
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.net.FileFilter;
import flash.net.FileReference;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.utils.ByteArray;
//Master.as
package
{
public class Master
{
public static var levelData:Vector.<DungeonWorld>;
public static var currentLevel:uint = 0;
}
}
//=============================================================================
// [GLOBALS]
//=============================================================================
float4x4 World;
float4x4 Projection;
int ShaderIndex = 0;
float3 DiffuseColor;
struct VertexPositionColor
package
{
import flash.geom.Rectangle;
import net.flashpunk.Entity;
import net.flashpunk.FP;
import net.flashpunk.graphics.Image;
/**
* Describes an enemy.
* @author Zachary Weston Lewis
@zachwlewis
zachwlewis / GameWorld.as
Created December 8, 2010 21:54
Splitscreen Game World Rendering
package
{
import flash.display.BitmapData;
import flash.events.FocusEvent;
import flash.geom.Point;
import flash.geom.Rectangle;
import net.flashpunk.Entity;
import net.flashpunk.FP;
import net.flashpunk.graphics.Backdrop;
import net.flashpunk.graphics.Image;
@zachwlewis
zachwlewis / ButtonWorld.as
Created December 31, 2011 09:45
A FlashPunk World that shows how to make a simple button as well as Text manipulation and some fun tricks.
package
{
import flash.display.*;
import flash.geom.*;
import net.flashpunk.*;
import net.flashpunk.graphics.*;
import net.flashpunk.utils.*;
/**
@zachwlewis
zachwlewis / Main.as
Created February 8, 2012 19:17
An attempt to create a reusable, design-based Flash UI boilerplate.
/**
* @author Zachary Weston Lewis
*/
class Main extends MovieClip
{
public function Main(target:Object)
{
target.__proto__ = this.__proto__;
target.__constructor__ = PlayerHUD;
@zachwlewis
zachwlewis / EmitterWorld.as
Created April 4, 2012 16:24
Emitter Tutorial Game
package
{
import flash.display.BitmapData;
import flash.geom.Rectangle;
import net.flashpunk.FP;
import net.flashpunk.graphics.Emitter;
import net.flashpunk.graphics.Graphiclist;
import net.flashpunk.graphics.Image;
import net.flashpunk.graphics.Text;
import net.flashpunk.utils.Input;
@zachwlewis
zachwlewis / SpriteFlipWorld.as
Created April 9, 2012 19:50
Sprite Switching Example
package
{
import flash.display.*;
import net.flashpunk.*;
import net.flashpunk.graphics.*;
import net.flashpunk.utils.*;
/**
* A sample world to demonstrate swapping a sprite from the World on player input.
* @author Zachary Weston Lewis (http://zacharylew.is)