Skip to content

Instantly share code, notes, and snippets.

@videlais
videlais / visibility.js
Created December 27, 2013 15:47
Complete Visibility.js
/**
* A Visibility object using the Page Visibility API with fallback to
* the the 'focus' and 'blur' events.
*
* The result of visibilityState() returns one of the possible following strings:
* "visible" : is visible to the user
* "hidden" : is not visible to the user
* "prerender" : (Limited support) is not visible to the user, but has been loaded in memory
* "unloaded" : (Limited support) the page itself is currently being unloaded from memory
*
@videlais
videlais / vibrate.js
Created December 26, 2013 07:16
Vibrate.js
/**
* A Vibrate object for detecting and using the window.navigator.vibrate
* function.
*
* Code borrows from David Walsh's work
* http://davidwalsh.name/vibration-api
*
* @property {boolean} supported If vibrate is supported in the current context
*/
@videlais
videlais / PlayState.as
Created November 6, 2013 05:32
ActionScript 3 Multi-camera HUD example
package
{
import org.flixel.*;
public class PlayState extends FlxState
{
private var hud:FlxGroup;
private var world:FlxTilemap;
private var player:PlayerSprite;
//
@videlais
videlais / MapGroup.as
Last active December 26, 2015 23:39
ActionScript 3 Example 8 MapGroup Version 2
package
{
/**
* ...
* @author Dan Cox
*/
import org.flixel.*;
public class MapGroup extends FlxGroup
@videlais
videlais / AreaGroup.as
Created October 30, 2013 12:51
ActionScript 3 Example 8 AreaGroup Version 2
package
{
/**
* ...
* @author Dan Cox
*/
import org.flixel.*;
import org.flixel.system.FlxTile;
@videlais
videlais / Assets.as
Created October 30, 2013 03:30
ActionScript 3 Example 8 Assets Version 2
package
{
/**
* ...
* @author Dan Cox
*/
public class Assets
{
[Embed(source="data/houseTiles.png")]
public static var houseTilesPng:Class;
@videlais
videlais / MapGroup.as
Created October 30, 2013 02:45
ActionScript 3 Example 8 MapGroup Version 1
package
{
/**
* ...
* @author Dan Cox
*/
import org.flixel.*;
import org.flixel.system.FlxTile;
@videlais
videlais / AreaGroup.as
Created October 30, 2013 02:41
ActionScript 3 Example 8 AreaGroup Version 1
package
{
/**
* ...
* @author Dan Cox
*/
import org.flixel.*;
public class AreaGroup extends FlxGroup
@videlais
videlais / Assets.as
Created October 30, 2013 02:23
ActionScript 3 Example 8 Assets Version 1
package
{
/**
* ...
* @author Dan Cox
*/
public class Assets
{
[Embed(source="data/houseTiles.png")]
public static var houseTilesPng:Class;
@videlais
videlais / Level.as
Created October 26, 2013 04:44
Autorunner Level Example
package
{
/**
* ...
* @author Dan Cox
*/
import org.flixel.*;
public class Level extends FlxGroup