FFDec

FFDec is a decompiling tool for Flash SWF files. It  can view source code of ActionScript 1/2 or 3 parts, export it or edit (p-code editor for AS3). Texts or images can be edited or replaced. It’s also possible to export shapes, images, sounds or movies.

The tool is written in Java, which grants a multiple platforms nature. Some of FFDec features include: exporting scripts, images, shapes, movies, sounds; powerful decompilation method featuring deobfuscation; editing via assembler source (AS1/2 and AS3); clicking decompiled source highlights P-code associated instruction and vice-versa; saving modified actionscript back to the file; replacing images, editing text; displaying SWF resources (shapes, sprites, fonts, buttons…) (Windows only); built-in proxy server for editing SWF files which come through it.

version1.4.0_as3

Decompilers
Leave a comment

ANE-ImagePicker

ANE-ImagePicker is a native extension that allows you to display native UI to pick an image from the gallery or take a picture with the camera on iOS and Android. After the UI pick dialog is fired, the user can choose an image. When the user picks an image, a callback is invoked with the selected file data (a BitmapData and a ByteArray).

The extension has a set of advanced features, such as square cropping, custom positioning for the gallery image picker on iPad and custom overlay to avoid white screen when loosing Stage3D context.

Sample

// Take a picture with the camera
if (AirImagePicker.getInstance().isCameraAvailable())
{
    AirImagePicker.getInstance().displayCamera(function(image:BitmapData, data:ByteArray):void {
        // Do something with the BitmapData or the JPEG-encoded ByteArray
    });
}

// Pick an image from the gallery
if (AirImagePicker.getInstance().isImagePickerAvailable())
{
    AirImagePicker.getInstance().displayImagePicker(function(image:BitmapData, data:ByteArray):void {
        // Do something with the BitmapData or the JPEG-encoded ByteArray
    });
}
Air Native Extension, Android, iOS
1 Comment

baseoneaslib

baseoneaslib is a lib with a simple A-Star implementation. The path finding algorithm works within a graph defined by the developer and guided by two classes: TileGraph and TileNode. Every node in grid must be configured to indicate if it’s walkable or not.

Even though the lib provides its own implementation of a graph, which is a tile-based grid, it’s possible to use your own implementation using the Graph interface. The graph doesn’t have to be a tile-based grid, which allows a high level of customization for your own needs.

Sample

var myGraph:TileGraph = new TileGraph(50,30);
for (var x:int=0; x<50; x++) {
  for (var y:int=0; y<30; y++) {
    myGraph.setWalkable(x,y, /* walkable? */);
  }
}
var astar:AStar = new AStar(myGraph);
var start:int = myGraph.getTileIndex(12, 4);
var goal:int = myGraph.getTileIndex(33, 23);
var path:Vector. = astar.solve(start, goal);
var usablePath:Vector. = myGraph.getNodes(path);
Path Finding
Leave a comment

1GAM journey update

I want to report my progress about 1GAM. Since we are in May the 1GAM journey has reached the 1/3 mark. First of all I want to say I never thought I could make four games in four months. Huge kudos to McFunnkypants for inspiring us all! It’s been an outstanding ride so far :)

Back in January I was on vacation so there was plenty of time to make games and write devlogs. Since then my free time is running a bit short, so I skipped all devlogs/posts and focused on making the games. Below is a list of my games so far, with some comments.

January: Blacksmith Dash

Blacksmith Dash

I had plenty of time to write about the game while making it during January, so you can check the devlogs here. Blacksmith Dash is one of my favorite games so far and I’m  planning to work on it in the future.

Following McFunnkypants wisdom advice I’ve cut several features to make the game fit into the one month deadline. I will implement all those missing features and release an offline PC version of the game. I will work on a Windows 8 version too.

February: Squared Puzzle

squaredpuzzle_features_1024_500After my January success I was very motivated and ready to create a AAA game (ha!), but life knocked my door and I was swamped by work (not the game related sort of work).

February is like a boss for 1GAM, because it has only 28 days (2 days make a hell of a difference when you work with one game a month). When the end of the month approached, I had no game, so I executed my plan B: mini puzzle game. Using a few days (including part of the grace period), I came up with a jigsaw game. Not what I was expecting, but it did the trick.

March: Spell Cracking

spellcracking_features_1024_500

My work load was manageable by the time so I decided to work on a platform game for March (see MAC, my April’s entry). Things went really well until the middle of the month, when my free time became sparse again.

Once more I would not be able to finish the game, so I executed plan B again: another mini puzzle game. During the last week of March and a few days of the grace period, I’ve made Spell Cracking. Even though I had no time to polish it, I was able to add some effects and nice SFX. The game end up being better than I expected.

April: MAC madly angry cat

screenshot_0

When April started I decided to resume working on my platform game. Flixel is really great to create platform games, so I could progress with a strong pace. By the end of the month, I had a game with collectible items, three different enemies, ammo and lives.

I’ve spent a few days looking for SFX and music. By the end of the month, MAC was playable and ready to be published. This is the very first freely available Flash online game I’ve made as an indie gamedev, so I’m really proud of the result!

I will definitely work on MAC again in the future. I have so many plans for this game I will need a lot of time to make them all come true, but it’s worth it. I want to create a Contra III ”remake”, with lots of levels, weapons and enemies. It will probably be converted into an offline PC game too (I heard Steam’s Greenlight needs another zombie game).

AS3 Game Gears Blog ,
Leave a comment

Code Orchestra

Code Orchestra is an IDE to develop flash, mobile and web applications quickly and easily
with Flash, AIR and HTML5. The IDE can translate ActionScript3 into JavaScript and make apps work out of the box, allowing Debug, JS Preview, jQuery and D3 in AS3 projects.

One of its killer features is COLT (Code Orchestra Live Coding) a way of writing and monitoring the program, when updated code and images are delivered to the running application, and no data is lost – the application preserves its state. Compilation is done  using a fast incremental process (~200 ms) and  apps that are already on devices don’t need to be reinstalled after compilation; the app is installed automatically just as a livecoding session starts.

COLT supports software development for iOS and Android and an app in a live session mode is network-available. As a result code/assets updates are delivered even if the app has been launched on another computer somewhere in the office (several computers and devices at a time).

COLT is a tool with no particular IDE, so you can download it separately and use it with your IDE of choice.

IDE
2 Comments

1GAM Developers Spotlight #3

This is 1GAM Developers Spotlight #3 presenting some games made during March. I know it’s a bit late to post about games made in March because we are in May already, but I’ve been really busy (including my own 1GAM work! :D ).

In case you miss the previous developer spotlights, you can check #1 and #2. Below are the reviewed games, all sent as March entries for 1GAM.

Insane Spacewalk, by P. Barberz

insane_spacewalk
This is really an insane spacewalk! You control an astronaut using a jet-pack to fly along the way. You must press the space key to thrust. At the beginning it’s easy to fly around because there is plenty of room available.

As you progress things start to become a bit claustrophobic. You must pay attention to the sharp edges (at the top and bottom of the screen) and carefully fly through the often narrow passages. When I thought everything was under control, I was surprised by an “inverse gravity” ray. Suddenly the astronaut was upside down, pretty cool! :) The game is polished and has nice retro graphics, sfx and music. It was made using Flixel.

Spin, by Alex Midgley

spin

This is a Zuma like game but with several cool and clever additions. If I had to classify Spin into a category that would be a “rotating match-3 breakout pong stuff” :D Seriously! Alex did a great job combining those mechanics. You control a movable platform at the bottom of the screen, using the mouse to aim and toss the balls.

Every time three balls of the same color get in contact you score. The balls you toss will bounce on the screen, so you can aim at any side of the “blob”. In order to make things harder the mass of balls keeps rotating and multiplying over time. Spin is fun and hard to stop playing after you start.

Blackguard, by MrBeastDesign and SirJson

blackguard

Blackguard is a tactic game with a mystery atmosphere. You must open the treasure boxes inside the rooms, but you cannot be caught by the guards. A guard monitors a specific area of the screen (a cone) and he looks at different spots every few seconds (pretty much like in Commandos).

Sometimes you can avoid being spotted by the guards and can progress through the room, but at some point it’s impossible to walk unnoticed. When it happens you can make some noise, so the guards will be alarmed and will check the source of that sound. That’s when you find a way thorough and progress :) . Blackguard has nice graphics and is a great option for players that enjoy tactics.

The game was not made using Flash, it was made using SFML.

 

AS3 Game Gears Blog
3 Comments

Flox

Flox is a backend solution that offers analytics, log & error introspection, leaderboard & highscores, player support and data storage.

Flox brings a useful set of analytics right out-of-the-box, including custom events. The log and error system collects the log files of game installations, allowing developers to analyze those logs within the Flox web interface. The player system is designed to integrate seamlessly with almost any platform (e.g. facebook, GameCenter, Twitter, Kongregate and many others). It allows players to play as guests or authenticated using a gamer-safe email login mechanism.

The entity system allows the application to store, load and query for the data saved in the player’s names (useful for achievements, preferences, scores, etc). The storage has an owner and permission system that makes it easy to share data between players.  The leaderboard and highscore system allows players to compete against each other on as many global leaderboard as desired. It’s possible to submit and retrieve player’s highscores to and from the Flox backend.

Sample

//Analytics: e.g. which level your players reach
Flox.logEvent("LevelStarted", { Level: 12 });

//Submit log entries
Flox.logInfo("Player {0} lost a life.", player);
Flox.logWarning("Something fishy is going on!");
Flox.logError(error);

//login, access and logout a player
Player.loginWithKey("myForeignKeyWhichMayVeryWellBeFromFacebook", onComplete);
var currentPlayer:Player = Player.current;
Player.logout();

//Entities e.g. create a new savegame
var savegame:Savegame = new Savegame();
savegame.inGameProgress = 0.1;
savegame.saveQueued();

//1st param is the leaderboards ID, 2nd is the score, 3rd is the current players name
Flox.postScore("default", 999, "Johnny");
Backend
1 Comment

Adverts

Adverts is a native extension  to monetize applications by displaying advertisements. It provides a cross-platform Admob integration for iOS and Android, allowing developers to show/hide adverts according to specified position or auto-alignment options.

It is also possible to manually refresh the advert, which will make the advert update with a new ad request.

Sample

Adverts.init( YOUR_DEV_KEY );
Adverts.service.addEventListener( AdvertEvent.RECEIVED_AD, adverts_receivedAdHandler, false, 0, true );
Adverts.service.initialisePlatform( AdvertPlatform.PLATFORM_ADMOB, YOUR_ACCOUNT_ID );

// Showing an Ad
var position:AdvertPosition = new AdvertPosition();
position.verticalAlign   = AdvertPosition.ALIGN_BOTTOM;
position.horizontalAlign = AdvertPosition.ALIGN_CENTER;
Adverts.service.showAdvert( position );

// Hiding
Adverts.service.hideAdvert();

// Refreshing/Updating an Ad
Adverts.service.refresh();
Air Native Extension, Android, iOS
1 Comment

IOSSystemUtils

IOSSystemUtils is a native extension to control brightness, torch and badge on iOS. The extension allows an application to set the brightness of screen, enable or disable the iPhone Torch and set app bagde count.

The extension works on the simulator too, but it’s only able to set the brightness of the screen.

Sample

var iosutils:IOSSystemUtils = new IOSSystemUtils( );
iosutils.setBrightnes( brightnes /* From 0 to 1 */);
iosutils.setTorchEnabled( true/false );
iosutils.setBadgeNumber( count /*uint badge count*/ );
Air Native Extension, iOS
4 Comments

QuadtreeSprite

QuadtreeSprite is a Starling extensions which enables efficient handling of large number of children DisplayObjects. It is useful when the game needs a container of objects which are usually not visible on the screen at the same time, such as large 2D world map.

The extension allows the addition and removal of objects in the same and usual Starling way, however the container must be updated every time one of its children change position or size. It’s possible to iterate through the currently visible objects or all of which the container holds.

Sample

// Define the world bounds, if objects is outside them it will always be displayed
var worldBounds:Rectangle = new Rectangle(...);
var container:QuadtreeSprite = new QuadtreeSprite(worldBounds);
// Adding/Removing children: same as in Starling:
container.addChild(new Quad(...));
container.removeChild(...);
var object:Quad = ...;
container.addChild(object);
object.x = 10;
container.updateChild(object);
// Change visible elements
container.visibleViewport = new Rectangle(...);
// visible objects
for (var i:int = 0; i < container.numChildren; ++i) {
    var object:DisplayObject = container.getChildAt(i);
}
// all objects
for (var i:int = 0; i < container.dynamicNumChildren; ++i) {
    var object:DisplayObject = container.dynamicGetChildAt(i);
}
Misc
Leave a comment

Logi

Logi is a HUD/Console logging library built on top of Feathers.  It allows the application to display the trace on the screen as an overlay. There are two modes of display: console (can be shown/hidden and looks like a regular command line prompt) and HUD (when the console is hidden, traces appear for a limited time on the screen).

Some of its features include customization (fonts, display settings), the ability to parse the console input so you can register a function (that can be called from the console) and fixed displays (a place on the screen to display a key-value pair).

Sample

var settings:ConsoleSettings = new ConsoleSettings();
// Disable HUD display:
settings.hudEnabled = false;
var logConsole:Console = new Console(settings);
this.stage.addChild(logConsole);
logConsole.isShown = true;
log("Just like the good old trace...", 4, 8, 15, 16, 23, 42 );
Debug
Leave a comment

SoundAS

SoundAS is a modern lightweight Sound Manager. It was created to simplifying playback of audio files, with a focus on easily transitioning from one to another, and differentiating between SoundFX and Music Loops. It provides a strongly typed, performant SoundManager, with a clean and focused API.

Among other features, the library has a clean API, easy memory management, chaining as SoundAS.play("music").fadeTo(0) and a built-in tweening system (with no dependancies). It’s also possible to manage the loading process of audio files.

Sample

// Loading

//Load sound from an external file
SoundAS.loadSound("assets/Click.mp3", "click");
//Inject an already loaded Sound instance
SoundAS.addSound(clickSound, "click");

//Play sound.
//allowMultiple: Allow multiple overlapping sound instances.
//allowInterrupt: If this sound is currently playing, start it over.
SoundAS.play("click", volume, startTime, loops, allowMultiple, allowInterrupt);

//Shortcut for typical game fx (no looping, allows for multiple instances)
SoundAS.playFx("click");

//Shortcut for typical game music (loops forever, no multiple instances)
SoundAS.playLoop("click");

//Toggle Mute 
SoundAS.mute = !SoundAS.mute;

//Fade Out
SoundAS.getSound("click").fadeTo(0);

//Mute one sound
SoundsAS.getSound("click").mute = true;

//Fade from .3 to .7 over 3 seconds
SoundAS.getSound("click").fadeFrom(.3, .7, 3000);

//Manage a SoundInstance directly
var sound:SoundInstance = SoundAS.getSound("click");
sound.play(volume);
sound.position = 500; //Set position of sound in milliseconds
sound.volume = .5; 
sound.fadeTo(0);
Sound
5 Comments

AS3 Virtual Keyboard

AS3 Virtual Keyboard is a library to display in-app virtual keyboard for user input. The virtual keyboard is similar to the one available on the Android/iOS platform, emerging from the bottom of the screen.

Some of it features include auto resize, auto align and dynamic key configuration. This lib is useful to allow user input on touch enabled games.

Sample

package  {
  import flash.display.Sprite;
  import flash.events.MouseEvent;
  import flash.text.TextField;
  import flash.text.TextFormat;
  import nid.ui.controls.VirtualKeyBoard;

  /**
   * ...
   * @author Nidin P Vinayakan
   */
  public class Main extends Sprite {		
    public function Main() {
      VirtualKeyBoard.getInstance().init(this);

      var txt:TextField = new TextField();
      txt.width = 300;
      txt.height = 100;
      txt.background = true;
      txt.backgroundColor = 0xCCCCCC;
      txt.defaultTextFormat = new TextFormat("Arial", 25, 0x000000,true,null,null,null,null,"center");
      txt.text = "PRESS HERE"
      addChild(txt);
      txt.x = 175;
      txt.y = 10;

      txt.addEventListener(MouseEvent.CLICK, toggleKeyboard);			
    }

    private function toggleKeyboard(e:MouseEvent):void {
      VirtualKeyBoard.getInstance().target = { field:e.currentTarget, fieldName:"Test" };
    }		
  }
}
Input
Leave a comment

ANEZipFile

ANEZipFile is a native extension to zip/unzip files on iOS. It uses a slightly modified version of SSZipArchive Obj-C and is able to perform several actions, such as listing the archive content. Some operations can be executed asynchronously for improved performance.

Some of its features:

  • Unzip Files Asynchronously
  • Unzip password protected files
  • Unzip single file from zip to ByteArray ( Sync/Async )
  • List Files inside zip
  • Determine if zip is password protected
  • Zip contents of a directory from FileSystem Asynchronously
  • Zip group of Files from Filesystem Asynchronously
  • Append files from FileSystem to zip ( Sync/Async )
  • Append ByteArray Data to a file inside zip ( Sync/Async )

Sample

public function listDirToZip(folder : File) : Array
public function extractFile(zipfile : File, fileName : String, password : String = "") : ByteArray
public function extractFileAsync(zipfile : File, fileName : String, password : String = "") : void
public function getZipContents(zipfile : File) : Array
public function isPasswordProtected(zipfile : File) : Boolean
public function unzip(zipfile : File, destination : File, overwrite : Boolean = false, password : String = "") : void
public function zipDirectory(outputZip : File, sourceDirectory : File) : void
public function zipFiles(outputZip : File, sourceFiles : Array, destinationFiles : Array = null) : void
public function addFile(file : File, destination : String = "") : Boolean
public function addFileAsync(file : File, destination : String = "") : void
public function close() : Boolean
public function open(zipfile : File, fileMode : uint = 0) : Boolean
public function writeBytes(bytes : ByteArray, fileName : String) : Boolean
public function writeBytesAsync(bytes : ByteArray, fileName : String) : void
Air Native Extension, iOS
2 Comments

Actionscript Source Obfuscator

Actionscript Source Obfuscator is a tool to obfuscate files by renaming packages, classes, methods and variables before compiling them. It works in the command line or in GUI mode, which can be used to avoid the obfuscation of individual classes, packages, or variables.

The more .AS files it has the more it can obfuscate, as it works with references. If the project uses a library (with source code), it’s recommended to include those .as files to get better a obfuscation. It’s also possible to give every field a unique name, which can have its length parametrized.

Sample

// GUI mode
java -jar Obfuscator.jar 
// Command line mode
java -cp Obfuscator.jar main.Obfuscate
Obfuscation
8 Comments