This file contains 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.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import flash.utils.*; | |
[SWF(width="500", height="500", frameRate="50")] | |
public class BitmapDrawComparison extends Sprite { | |
public var timeDisplay:TextField; |
This file contains 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.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import flash.utils.*; | |
[SWF(width="500", height="500", frameRate="50")] | |
public class BitmapDrawComparison extends Sprite { | |
public var timeDisplay:TextField; |
This file contains 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.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import flash.utils.*; | |
[SWF(width="500", height="500", frameRate="50")] | |
public class BitmapDrawComparison extends Sprite { | |
public var timeDisplay:TextField; |
This file contains 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
/** | |
* creates a single instance of each state and stores them in a dictionary of states. | |
*/ | |
// OH, HACKY! .... OR BRILLIANT? | |
protected function initializeStates():void { | |
allStates = new Dictionary( false ); | |
//This vector contains several state classes i want to instantiate. | |
var stateClasses:Vector.<Class> = new Vector.<Class> ([MainMenuState, CreditsState, GameplayState]); | |
for each ( var stateClass:Class in stateClasses) { |
This file contains 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.DisplayObject; | |
/** | |
* An interface to work around the lack of interface for display objects. | |
*/ | |
public interface IDisplayObject | |
{ | |
/** |
This file contains 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 org.as3lib.math | |
{ | |
/** | |
* Global function for returning a number within an upper and lower limit. | |
* | |
* @param value The number to limit | |
* @param lowLimit The lowest value that will be returned. | |
* @param highLimit The highest value that will be returned. | |
* @return value if lowLimit < value < highLimit, otherwise returns the lowLimit or highLimit. | |
*/ |
This file contains 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 utils.number { | |
/** | |
* Returns true if the two numbers are within "maxPercentDifferent" percent of each other. | |
* | |
* @example <listing version='3.0'> | |
* FuzzyMath.roughlyEqual(0.7, 0.69); // true | |
* FuzzyMath.roughlyEqual(0.7, 0.5); // false | |
* | |
* FuzzyMath.roughlyEqual(123456789, 123450000); // true |
This file contains 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
// randomly returns one of the three strings | |
var word:String = ["Alpha", "Bravo", "Charlie"] [int(Math.random() * 3)]; |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Grid!</title> | |
<!--[if IE]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<script> |
This file contains 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
import java.io.*; | |
/** | |
* @author Mims H. Wright - [email protected] | |
*/ | |
class montecarlo { | |
// To run, on command line type: | |
// javac montecarlo.java | |
// java montecarlo |