Quality control

October 13, 2010

I looked at all four hundred and forty-four posts from the past year, and the only worthwhile posts were the flixel tutorials. :)

Good thing I started over, huh?

I used to think a StarCraft player never really improved until he had at least 300 losses.

New blog

October 13, 2010

I decided to start a new blog over at blogger.

Blogger allows monetization and PayPal donations.

I would like to keep sb up, but with revised, clearer posts. It will be a filtered archive.

I feel like Neebs selling broom handles.

Flixel Xcode Template

September 12, 2010

I created a Flixel template for Xcode.

Here’s the zip file of the template. Unzip the folder to ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Other/, or wherever Xcode recognizes project templates.

Please refer to my newest tutorial to learn how to set up the Flex SDK and Flixel library.

There are a few ways to extend this. First, Xcode project files, which end in .xcodeproj, are actually bundles. You can confirm it by right-clicking and choosing “Show Package Contents.” If you consult the default Cocoa Application template in /Developer/Library/Xcode/Project Templates/, there is a way to specify different project templates, like Cocoa with Core Data, Cocoa with Spotlight Importer + Core Data, etc.

Enterprising individuals may be able to set up a Project Template that allows the user to specify, in a drop-down, the type of library to be used; i.e., FlashPunk, flixel, PushButton, and whether or not to include Box2D – essentially creating One Project Template to Rule Them All.

Build and Run does not work. I resort to the barbaric method of dragging a SWF into a blank Safari window. While this executes the SWF, there’s probably a better way. Perhaps something on the lines of open -a FlashPlayer.exe -output-file-flag file.swf as a New Custom Executable (see previous tutorial).

You’ll probably end up getting Flash Player 10 debug edition anyway, as Safari will not display trace() statements. There are AppleScript scripts on the Internet that will tail a log file to get around this. Currently, I live in trace() poverty and am a little proud of it, but I don’t develop in Flex much.

I hear Windows users have it real nice with FlashDevelop; something on the lines of code completion. It would be cool if Xcode could do this with ActionScript.

You can also generalize this template file to other build processes. Please see my notes (PDF).

Hope this helps, dear readers.

Update: The first zip file wouldn’t compile, but I’ve updated the MegaUpload link. I was getting the message, “Unable to resolve a class for factoryClass: Preloader.” I had to change [Frame(factoryClass="Preloader")] to [Frame(factoryClass="game.Preloader")] due to the directory structure. (Typical tutorials may place Preloader.as in the same directory as Main.as, versus game/Preloader.)

Update. I changed mxmlc Build Target settings. Previously, product name was $(PRODUCT_NAME), which is an empty string, so the SWF file was called “.swf,” which in Mac OS X is a hidden file, which is hilarious. Fixed now, and MegaUpload link updated.

Update. The previous template will not compile with Embed statements that use Flan’s CSV file. The fix is to include the flag -static-link-runtime-shared-libraries=true to mxmlc. I have updated the MegaUpload link.

Update 9-27-2010. Changed Product Name to “Sample Product 0.1″ to illustrate (1) use of spaces and (2) periods are okay. Also changed $(PROJECT_NAME) to $(PRODUCT_NAME) because Project Names usually have spaces; you’d have to escape them, etc. With this updated template, it should be good enough to build right from the get-go.

Follow

Get every new post delivered to your Inbox.