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 | |
{ | |
/** | |
* ObjectPool Class | |
* @author Julian | |
*/ | |
public class ObjectPool | |
{ | |
private var _list:Array; | |
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 | |
{ | |
public final class ObjectPool | |
{ | |
private var MAX_VALUE:uint; | |
private var GROWTH_VALUE:uint; | |
private var TYPE:Class; | |
private var counter:uint; | |
private var pool:Array; |
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 | |
{ | |
/** Returns a 4 elements vector containing four different integers ranging from 1 to max, in random order. */ | |
public function pick4RandomNumbers(max:uint):Vector.<uint> | |
{ | |
// Create and populate a Vector to get 'max' different numbers from | |
var numberContainer:Vector.<uint> = new Vector.<uint>(); | |
for (var i:uint = 1; i <= max; i++) | |
{ | |
numberContainer.push(i); |
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 | |
{ | |
/** Returns a random integer ranging from 1 to max, excluding numberToAvoid. */ | |
public function pickRandomNumberExcept(numberToAvoid:uint, max:uint):uint | |
{ | |
// Create and populate a Vector to pick the numbers from, excluding numberToAvoid. | |
var numberContainer:Vector.<uint> = new Vector.<uint>(); | |
for (var i:uint = 1; i <= max; i++) | |
{ | |
if (i != numberToAvoid) |
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 | |
{ | |
/** Returns a random integer within the specified range (included) */ | |
public function getRandomNumber(min:Number, max:Number):int | |
{ | |
return Math.floor(Math.random() * (max + 1 - min)) + min; | |
} | |
} |
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 starling.extensions { | |
import flash.events.Event; | |
import flash.media.Sound; | |
import flash.media.SoundChannel; | |
import flash.media.SoundTransform; | |
import flash.utils.Dictionary; | |
import starling.core.Starling; | |
public class SoundManager { |
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 navigation.screens | |
{ | |
import constants.Colors; | |
import constants.Constants; | |
import constants.Fonts; | |
import constants.Navigation; | |
import constants.Text; | |
import flash.geom.Point; | |
import flash.geom.Rectangle; | |
import flash.utils.getTimer; |
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 gameboard | |
{ | |
import starling.display.Sprite; | |
import starling.extensions.PDParticleSystem; | |
import starling.textures.Texture; | |
public class ParticleFXs extends Sprite | |
{ | |
// Embed configuration XML | |
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 com.adobe.ane.gameCenter.GameCenterAuthenticationEvent; | |
import com.adobe.ane.gameCenter.GameCenterController; | |
private var gcController:GameCenterController; | |
private function initializeGameCenter():void | |
{ | |
if (GameCenterController.isSupported) | |
{ | |
trace ("gamecenter is supported"); |
OlderNewer