A couple weeks before the Flash Gaming Summit I found an interesting blog post from Colin Northway about managing texture memory in Starling applications. In this post he describes how he forces an error in ActionScript to receive an object's memory address which he then uses as a unique id. I thought this was a pretty cool trick and was discussing it with our engine developer at the office when we suddenly had a thought: if you can get the memory address of an object in ActionScript, what's to stop you from passing that address into native code and doing whatever you want with it? (more...)
Archive for the ‘ActionScript 3’ Category
If you aren't using Adobe's Scout profiling tool yet, you should be. Scout is a fantastic tool for debugging your code and finding performance bottlenecks. You can get basic data by simply running Scout and then launching Flash content. However, for more in-depth profiling you must enable advanced telemetry in your swf (the actionscript stack is only available for AS3-based projects). To assist with this, I've put together a Scout Survival Kit that contains all the tools necessary to get you up and running.
The pack includes the Scout set up executable, this FlashDevelop plugin, this Scout enabler program and a helpful html readme document describing how to use the plugin. All of these items can be downloaded individually elsewhere, but I figured it made sense to put them all in one place. Click the image below to download the kit!
Woohoo! I finally had time to sit down and update the Airxbc native extension for Windows! If you aren't familiar with the extension, it allows you to accept input via an Xbox 360 controller for your Adobe AIR games.
With this latest release, my major goal was to wrap up the controller definition in a real class. If you'll recall, the original version simply gave back a generic ActionScript object. The new version returns a com.rhuno.X360Gamepad object that wraps up a lot of the controller functionality nicely, exposes some helpful methods and contains some constants for controller buttons. New functionality includes the ability to check if a button was just released and also to get the trigger values as a percentage or as a value. Below is an example of how to use the new extension.
import com.rhuno.Airxbc; import com.rhuno.X360Gamepad; var ext:Airxbc = new Airxbc(); var gpad:X360Gamepad; // pollGamePad now returns an X360Gamepad object gpad = ext.pollGamePad(); // various ways of checking for button presses gpad.isXButtonDown(); gpad.isButtonDown(X360Gamepad.GAMEPAD_X); // ways of checking for button releases gpad.wasLeftShoulderReleased(); gpad.wasButtonReleased(X360Gamepad.GAMEPAD_LEFT_SHOULDER); // get trigger value var value:int = gpad.leftTrigger; // get trigger percentage (0 thru 1) var percent:Number = gpad.leftTriggerAsPercent; // NOTE: you still use the extension to set vibration ext.setVibration(30000, 30000);
You can download an updated example project and the new ANE below. Enjoy!
NOTE: This post is out of date, for latest on Airxbc, go here!
This class was officially added to the Citrus Engine on November 26, 2012.
After seeing Lee Brimelow's tutorial on the Citrus Engine, I was intrigued and decided to play around with it. The engine's platformer package is already great and has some very useful objects for game developers. I took a look at the code for the box2d Platform and MovingPlatform classes and extended the functionality to create a RevolvingPlatform class. (more...)
UPDATE December 30, 2012
This post is out of date. For information on the latest version of Airxbc, see this page.
Lately I've been working on a new native extension that makes it possible to control your Adobe AIR games using the Xbox 360 controller. I'm currently calling it Airxbc (Air Xbox controller - ha HA!) and this 0.5 release is pretty much just an alpha test to get something out there. It think its pretty cool and plan on putting more work into it in the relatively near future. If you're interested, check out the video and details below!
One of the most talked about features in the new Flash Player 11.4 beta is the new concurrency model which allows developers to spawn worker threads to handle intensive operations. While many people are singing the praises of multithreading, I can't help but to feel like this may not be such a great thing.
I've always had certain misgivings about multithreading. Without question, threading has become common practice for achieving performance gains through parallelism in programming. However, just because something becomes accepted practice does not necessarily mean that it's a good thing. If you want an exhaustive look into the topic, I recommend reading Edward A. Lee's report The Problem with Threads. The author is a distinguished professor and former chair of Berkeley's Electrical Engineering and Computer Sciences department. (more...)
A few friends and I have been working on a game together for the last few weeks. Everything was going well at first, but then we ran into a major snag: bullets were colliding with the ground when they clearly shouldn't have been. We are using Flixel and FlxWeapon from the Flixel Power Tools and we would see the issue pop up only on uneven terrain. If we changed our map to a basic, flat piece then everything worked as expected. However, introducing varying height platforms in the map would cause the issue. The image below demonstrates the problem.
Both Flash Player 11.4 and the AIR 3.4 SDK are available now from the Adobe Labs site. The update brings some pretty big features to the Flash platform including multithreading and better support for iOS development.
I'm not a big proponent of threading and concurrency in programming, but the iOS additions sound pretty nice. You can now deploy your applications to your iOS device without going through iTunes and you can receive push notifications and utilize iOS SDK 5.1 features.