This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.BitmapData; | |
import flash.display.BlendMode; | |
import flash.display.Sprite; | |
import flash.filters.BitmapFilterQuality; | |
import flash.filters.BlurFilter; | |
import flash.filters.GlowFilter; | |
import flash.geom.ColorTransform; | |
import flash.geom.Point; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// below is my World class that I used to test the class | |
package | |
{ | |
import flash.geom.Point; | |
import net.flashpunk.FP; | |
import net.flashpunk.utils.Input; | |
import net.flashpunk.World; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IBug | |
{ | |
function suicide():void; | |
function destroy():void; | |
} | |
public class bombBug extends Entity implements IBug | |
public function destroy():void | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function CreateBackdropFromTilemap(source:Tilemap, repeatX:Boolean = true, repeatY:Boolean = true):Backdrop | |
{ | |
if (source == null) | |
{ | |
throw new Error("CreateBackdropFromTilemap Error: source Tilemap cannot be null"); | |
} | |
var bufferWidth:int = source.columns * source.tileWidth; | |
var bufferHeight:int = source.rows * source.tileHeight; | |
var buffer:BitmapData = new BitmapData(bufferWidth, bufferHeight, true, 0xFF000000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.geom.Point; | |
import net.flashpunk.Entity; | |
import net.flashpunk.graphics.Graphiclist; | |
import net.flashpunk.graphics.Image; | |
import net.flashpunk.Tween; | |
import net.flashpunk.Tweener; | |
import net.flashpunk.tweens.misc.Alarm; | |
import net.flashpunk.utils.Key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.events.Event; | |
import flash.events.KeyboardEvent; | |
import flash.net.FileFilter; | |
import flash.net.FileReference; | |
import flash.text.TextField; | |
import flash.text.TextFieldType; | |
import flash.text.TextFormat; | |
import flash.text.AntiAliasType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override public function update():void | |
{ | |
// move stars from the top of the screen to the bottom | |
for each(var star:Array in stars) | |
{ | |
// add speed to the star | |
star[2] += star[4]; | |
if (star[2] > FP.height) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.geom.Point; | |
import net.flashpunk.FP; | |
import net.flashpunk.Graphic; | |
import net.flashpunk.graphics.Image; | |
/** | |
* implements a simple starfield | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this example there are 3 classes: | |
Player | |
GateKey | |
Gate | |
// First give each key and gate a unique identifier such as | |
public var id:String; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.utils.*; | |
import net.flashpunk.*; | |
/** | |
* basic sound/music management class | |
* depends on GameData class for GameData.soundVolume and GameData.musicVolume | |
* @author Richard Marks | |
*/ | |
public class GameAudio |