Exploring Flixel

March 7th, 2011 § 4 comments § permalink

exploring flixel
Flixel is a free, open source 2D game engine built in ActionScript 3, from Adam Atomic, creator of Canabalt and other games. I became especially curious about Flixel ever since the iOS version of Canabalt went open source at the end of 2010. Both the Flash and iOS versions of Canabalt use Flixel. I understand that the iOS port of Flixel is still early, and from what I can tell, documentation for the iOS port is essentially nonexistent as of yet.

Regardless, here is my plan:

  1. Learn Flixel and create a game
  2. Port it to iOS [EDIT: that is, port my game to iOS, using the Flixel iOS port that is in the Canabalt source]
  3. ???
  4. PROFIT!!!

…all while blogging about the experience, of course. At least, that’s the idea — no promises that I’ll actually get very far! If I get really ambitious I might even write a tutorial at some point.

First experiences

Getting started with Flixel was pretty easy, thanks to the “Hello, World” tutorials available on the Flash Game Dojo wiki (which appears to be the main documentation hub for Flixel). After that I wasn’t sure where to go next, since the documentation is a bit scattered and disorganized. I did find some great info on the Github project page and wiki, which oddly is not linked to from the Flixel home page (as I said, a bit scattered). Perhaps Flash Game Dojo is where all the action is supposed to be now? I’m not really sure.

What I’m finding most helpful right now are the very simple example games, complete with source code, provided by Adam Atomic, which are a great help to see how the framework expects things to be set up. The FlxTeroids source code is instructive, as well as EZPlatformer (which has a nice tutorial with it).

Despite the disorganization, there is a lot of good information out there, including the very active forums (which I’ve not yet explored).

A question of units

One bit of info I couldn’t find was what units the FlxObject class uses for velocity and acceleration. I did a quick experiment, and it turns out that velocity is in pixels per second, and acceleration is in pixels per second per second — all very sensible, but it wasn’t explicitly stated anywhere I could find. Similarly, the angle and angularVelocity members are in degrees (not radians) and degrees per second.

What’s next?

This has been a bit of a rambling blog post (I, too, am a bit scattered!). Next I decide on what kind of game to make (something very simple) and start making it! Along the way I will share what I’ve learned.

Stay tuned…!

An iOS dev comic

February 21st, 2011 § 8 comments § permalink


It’s a black art… if you can even get it to work.

Descriptive text in iPhone settings bundles

February 14th, 2011 § 1 comment § permalink

Back in the iPhone OS 3.x days, I would stare longingly at the Settings bundles in Apple’s built-in iPhone apps:

If an app wanted explanatory text in the Settings app, you pretty much had to make do with Titles and Group titles. Ugly.

It turns out that in iOS 4.0 and higher, Apple allowed for third-party apps to have descriptive text too. And I only found out about this last week (I noticed its use in the Ladidude app).

The longer descriptive text is called “Footer text” in Apple’s nomenclature, and can be attached to any Group. To add your own, do the following:

  1. Open your Settings.bundle Root.plist in Xcode
  2. Go to the group you want footer text attached to.
  3. Add a new Item to the Group and edit the key to be “FooterText” (you’ll have to type “FooterText” in manually):
  4. The set the value to whatever text you want to show up. If you need to insert linefeeds, type option-Enter.
  5. Now you can visit your app’s settings in the Settings app. It should look something like this:

If your app is compatible with iPhone OS 3.x as well, not to worry: the extra FooterText key is simply ignored on pre-iOS4 devices.

Simplifying wireless iPhone app distribution with PHP

February 7th, 2011 § 6 comments § permalink

iOS 4.0 came with the ability to distribute your ad hoc apps over the air, which is very convenient for testers. More details are available on Apple’s website. Unfortunately, doing this manually can be a bit of a hassle, partly because the everything in the XML manifest requires absolute URLs.

I’ve created a PHP script that makes this task somewhat easier.

Requirements:
A web server that runs PHP 5 with the following extensions:

  • ZIP
  • either MBString or Iconv
  • either BC or GMP or phpseclib

Installation/usage:

  1. Download and unzip the files into a new directory on your web server.
  2. Create a directory for each app you want to deploy (the directory cannot have any spaces in its name!).
  3. In this directory, put:
    • the .IPA file of your app, built using Xcode’s “Build & Archive” command (no spaces in the filename)
    • the .mobileprovision file (again, no spaces in the filename)
    • a 512×512 PNG file named iTunesArtwork.png (case-sensitive)
    • a 72×72 PNG file named Icon.png (case-sensitive)

    The directory structure should look like this:
    Directory layout for wireless app distribution PHP script

  4. Now visit the web page that corresponds to the directory where you unzipped the files. You should see something like this:

    with one entry for each directory.
  5. Visit the same page on an iOS device running iOS 4.0 or higher. You should be able to install the app simply by tapping on the corresponding “app” link. You shouldn’t need to install the provisioning profile separately, but if you do, it can also be installed via the web site by tapping on the “provisioning profile” link.

That’s it. I admit the code is a bit of a mess, as it was hacked together relatively quickly. I haven’t been able to get it working when there are spaces in the names of the files or directories. Perhaps someone else can fix that :)

This code uses the very useful CFPropertyList PHP library by Rodney Rehm to parse the Info.plist file that’s in the IPA, to extract all the info required by the XML manifest. That’s how the magic happens.

Download the files here.

Generating certificates for push notifications? Don’t use Chrome!

November 3rd, 2010 § 0 comments § permalink

Thank you again Stack Overflow, for telling me why the Apple Push Notification service SSL Certificate Assistant (on the iOS Provisioning Portal) kept rejecting my certificate signing request.

It turns out that for whatever reason, if you try uploading your certificate signing request using Chrome, it will fail with an error (Chrome bug? site bug?). So: use Safari (or Firefox, apparently, based on the comments)!

Plague: 1; bunnyhero: 0

October 25th, 2010 § 0 comments § permalink

So after almost 3 weeks I’m finally feeling close to normal. Whiskey tango foxtrot! Plague from hell.

That means there’s no way I could get anything approved for the app store before October ends. I suppose, in theory, I could get something ready to at least submit by then, but that means completing a whole game in a week’s time. It’s possible, but to be honest I’m not sure if I’m up to it.

October challenge week 1: ha! :(

October 8th, 2010 § 0 comments § permalink

I’m off to a terrible start, unfortunately :( This month started off very busy, with little time for me to work on the challenge, and now I’ve been struck down with some kind of plague that makes it very difficult to concentrate on anything for any length of time.

All I’ve got so far are two rectangles on the screen. In theory, this will become a gameplay prototype. In practice… it’s two rectangles on the screen.

I sure hope I get better quick. Not going to give up just yet. In the meantime, I think I’ll just go and have a little lie down somewhere.

October Challenge

October 1st, 2010 § 0 comments § permalink


I have decided to try my hand at the October Challenge, AKA PoV’s Challenge. It’s a personal challenge to create and sell at least one copy of a game before the end of October.

I’ve been meaning to participate in one of these game-making challenges for a while (like Ludum Dare, or Toronto Game Jam), but never have, partly because those 2- or 3-day sprints are a little too easy to procrastinate about (blink and they’re over! and I am a master procrastinator), and partly because they seem a little too intensive for me in my advancing age (I like sleep!).

This one seems like something I could actually do and yet still be a kick-in-the-pants challenge. I like that PoV references NaNoWriMo in his post :)

Since I plan to make an iOS game, fulfilling the last part of the challenge (sell a copy) is partly at the mercy of Apple’s app review process, but I’m going to give it my best shot anyway. And of course I plan to blog about it all here.

Wish me [good] luck! And let me know if you’ll be participating too.

iOS4 multitasking: subtle UIViewController change

August 31st, 2010 § 0 comments § permalink

UIApplicationDelegate changed a lot with the introduction of multitasking in iOS4 (see Dr. Touch’s post and charts [although there are still some small omissions and inaccuracies there]).

But UIApplicationDelegate was not the only class affected. UIViewController‘s behaviour is slightly changed in the presence of multitasking: namely the view(Will|Did)Disappear: methods.

If your iOS4-built app is running on iPhone OS 3, or if UIApplicationExitsOnSuspend is set to true, then when the user presses the Home button, the frontmost view controller’s viewWillDisappear: and viewDidDisappear: methods will be called before the app exits. However, if UIApplicationExitsOnSuspend is false and you’re running on a multitasking-enabled device (iPhone 3GS or higher; iPod touch 3rd generation), viewWillDisappear: and viewDidDisappear: are not called as it enters the background.

That was a messy couple of sentences so here’s a chart!

UIApplication­Exits­On­Suspend? multitasking-capable device and OS? When Home button is pressed:
false true viewWill/DidDisappear: NOT called
false false viewWill/DidDisappear: IS called
true true viewWill/DidDisappear: IS called
true false viewWill/DidDisappear: IS called

It’s subtle, but it might make a difference to your code.

The Sparrow Framework

August 22nd, 2010 § 0 comments § permalink


When I first started iPhone programming last year, I decided I wanted to stay away from third-party frameworks at first, so I could learn as much of the native environment as possible. My first animation-based project used CALayers, but I later converted it to use OpenGL for better performance.

I am definitely not opposed to using third-party frameworks. When I’m not trying to wring the last bit of performance out of a device, I’d rather deal with higher-level abstractions than directly with OpenGL.

Cocos2D-iPhone is a very popular open source framework for 2D games and graphics applications. It seems very feature-rich, including things like visual effects, particle systems and even integrated physics engines!

But I was immediately drawn to the Sparrow Framework when I first heard about it. It, too, is an open source 2D graphics/game framework for iOS. It has far fewer features than Cocos2D (possibly a boon, depending on your outlook—less code to add to your app) but its main attraction (to me) is that it is modelled after the ActionScript 3 API. For someone like myself who has used Flash for many years, this is a definite plus.

When I was writing the Vampire simulator, I needed to make the vampire sparkle. I figured that this simple animation task would be well suited for my first exploration of the Sparrow framework.

Creating a new Sparrow app is very simple. Just duplicate the “scaffold” folder and rename the Xcode project within. You will have to do a one-time Xcode settings change: adding a SPARROW_SRC folder reference to point to where the Sparrow source files are on your hard drive.

The documentation that is available for Sparrow is minimal but very, very clearly written. Also, the source code is easy to follow. If you have any background with the ActionScript 3 class library, the learning curve is practically zero. I was shocked at how quickly I was making things happen with it.

Here’s a simple example from the vampire app. This snippet places the image “vampire.png” at the centre of the screen:

SPImage *image = [SPImage imageWithContentsOfFile:@"vampire.png"];
image.x = (self.width - image.width) / 2;
image.y = (self.height - image.height) / 2;
[self addChild:image];

Responding to events (touch events, or timing) will be familiar to you if you’ve used ActionScript (or JavaScript, for that matter), using the addEventListener method:

 [self addEventListener:@selector(onEnterFrame:) atObject:self forType:SP_EVENT_TYPE_ENTER_FRAME];

This will cause the onEnterFrame: method on self to be called on every frame of the animation.

Refugees from Flash should note: while Sparrow is modelled after the ActionScript 3 libraries, it is only a small, small subset of it. For example, it does not include any of drawing API (on the other hand, if you want to do any custom drawing, you can subclass SPDisplayObject and draw with OpenGL directly).

I definitely plan to use Sparrow for whatever my next game project might be. I’ll likely have more to say about it then. I’ll be interested to see how performance holds up if a lot of elements are flying around the screen.

Where Am I?

You are currently browsing the iPhone category at bunnyhero dev.

generic viagra india
cialis versus levitra
where to puchase cialis online
viagra urethral
cialis for sale
viagra cialis levitra buy viagra
natural viagra
half price viagra
levitra canada
cialis 10 mg
viagra dosing
cialis side effect
generic cialis soft from india
shelf life of viagra
cialis en ligne de pharmacie
levitra alcohol
formula for viagra
100 dollars cialis
levitra lawyers
viagra
apcalis levitra vs
order discount viagra
levitra young people
viagra vs levitra
viagra oral sex
cialis response
viagra side effect
ladies viagra
levitra users
best generic viagra prices
cheap cialis find
bought viagra fuerteventura
viagra candy
viagra side affects
cialis headache
avandia
effects of viagra on women
viagra next day shipment
viagra extacy ashanti
what is cialis soft
viagra logo
viagra works
over the counter viagra
diabetes and viagra
viagra ocular side effects
viagra wholesale
cialis no perscription
buying viagra in new zealand
cialis allergic lesions
pharmacy online viagra
viagra for sale online
viagra gel
cialis generic
viagra joke
viagra what to expect
directions for taking viagra
lowest cost for cialis 20mm tablets
purchasing viagra
cialis next day delivery
cialis prices
geniune cialis no prescription
viagra pay by e-check
side effects from viagra
levitra consumer information
cialises
viagra sideffects
viagra from usa
viagra uterine thickness
viagra blood pressure
cheapest viagra
cialis achalasia
cialis and levitra
generico viagra
cialis generic india
achat viagra
substitute for viagra
viagra pills cod
levitra sale
viagra availability at boots
cialis pill
viagra and women
buy viagra online in uk
what is the best herbal viagra
levitra medication
purchase cialis
health net viagra non-formulary cost
death by viagra
discount viagra online
roomid 71 cialis
viagra pic
on line prescriptions for cialis
cialis soft tab
viagra soft
viagra purchase
viagra discussion
viagra sheet off leg
what is better viagra or levitra
viagra s
viagra rx
viagra reviews
viagra women forum
viagra levitra cialis
cialis generic rx
viagra time
cialis lawyer ohio
order pfizer viagra with mastercard
drug impotence levitra
buy cialis online viagra
purchase generic viagra
viagra sildenafil citrate
cheap viagra new zealand
generic viagra overnight delivery
cialis australia
cialis overnight
gay men viagra vs cialis
prices cialis
money order viagra
lowest viagra prices
does viagra work for woman
viagra sildenafil
cialis and violent sex
is viagra for women
buy sublingual viagra online
buy viagra
on line viagra
cialis bph
levitra headache
where to buy viagra on line
20mg cialis
generic viagra
cialis super viagra
tadalafil generic cialis
viagra use of
viagra otc
purchase viagra
viagra dosage for women
viagra shelf life
canadian pharmacy viagra
viagra and cocaine
cialis murah klang
info on viagra
cialis dosage
pic viagra woman
discounted viagra
cheapest viagra prices
cheapest generic viagra
cialis user forum
wikipedia viagra
viagra sales uk
cialis viagra sampler
info on cialis
ship free viagra sample
buy cialis online uk
viagra or cealis
cialis women libido
searchstring cialis type all
buying cialis
cost levitra
cialis levitra viagra
viagra 6 free samples
ending viagra use
cialis no prescription
rosacea viagra
viagra adverse events
cialis drug information
viagra for under $2
buy cialis online now
advantages of viagra
c-ring viagra
male enhancement cialis
viagra rss feed
what is better levitra viagra cialis
viagra sample
cheapest price for viagra
headaches levitra
viagra for sale in the uk
viagra cialis levitra buy viagra
recreational viagra
viagra viagra
prescription for viagra
chineese viagra
cialis order form in uk
natural herbal viagra
cost of cialis
double dose of cialis
viagra versus cialis
canada cialis levitra
cialis softabs
can viagra be used by women
india generic cialis
buy viagra alternative
cialis erection problems
generic cialis from india
buying viagra buying viagra
bad side effects of viagra
levitra tabs
viagra inventor
buy cialis online
cheap viagra discount
buy viagra meds online
no prescription cialis
what is better viagra or levitra
que sabes del viagra
cialis canada
buying generic cialis
best buy viagra
online viagra store
natural viagra products
levitra vs cialis
women using viagra
generic viagra buy
buy cialis generic
women viagra
cialis without a prescription
videos viagra
viagra use and abuse
ingredients viagra
cialis cheap
us viagra
cialis vs levitra
what is levitra
side effects viagra
viagra women
what happens when you take viagra
cialis sample
overnight cialis
approval cialis fda
viagra no prescription
bayer and levitra
india cialis
new drug cialis
levitra website
side effects cialis
viagra and jokes
cialis vs levitra
lowest priced viagra in britain
generic viagra online
viagra generico
cialis or viagra
viagra for men
viagra vs cialis
viagra cialis levitra
viagra lawyer ohio
buy online viagra
uk pharmacies cheap viagra
german viagra substitutes
viagra boots
songs about viagra
levitra doses
levitra dose
natural substitute for viagra
cheapest generic levitra
generic levitra 32
women who take levitra
best price for generic viagra
cialis opposite effec
purchase cialis online
viagra online pharmacy
bayer levitra samples
heather viagra grow
cialis multiple attempts
buy viagra in amsterdam
viagra by mail
cialis levia and viagra
viagra uk 32
buy viagra on the internet
cheap cialis sale online
viagra pay pal
viagra discount store
genric viagra
cat 1 keyword viagra
order cialis uk
viagra cialis levitra
cialis overnight shipping
viagra usage
viagra free trials
viagra herbal substitute
negative effects of viagra
woman taking viagra
viagra ad
order cheap viagra
cialis new viagra
buy soma online
buy viagra online 35008
viagra alternative research
u 19835 cialis
cheapest price viagra
viagra free samples
viagra dosage
brand viagra without prescription
ebm diabetes viagra
liquid cialis
discount viagra canada
generic viagra from india
levitra for women
cialis alcohol
buy viagra in canada
women and viagra
cheapest place to buy viagra
40 grams of cialis
viagra info
cialis alternative
cialis naion
viagra experiences
no prescription order viagra online
make your own viagra
levitra vs viagra
pharmacy viagra
women who take viagra
lowest price generic viagra
cheapest place to buy viagra online
buy cialis by check
cialis new viagra
viagra soft tabs
levitra women
levitra pills
viagra and altace
viagra use
levitra vardenafil
buy viagra in mexico
generic viagra lowest prices
buy viagra in bangkok
viagra best way to use
best natural viagra
viagra retarded ejaculation
cialis mexico
generic low price viagra
buy viagra online without prescription
does levitra work
viagra cialis store
dosage of viagra
discount levitra online
viagra ads funny
cialis britain
viagra generique
cialis soft tab india
viagra faq
viagra from canada
levitra eye problems
cialis testimonial
viagra pennis enlargement
suppliers of viagra in uk
what is cialis
cialis trial pack $38
cialis pictures descriptions
cialis canada online pharmacy viagra
lowest prices for cialis
lowest prices viagra
cialis information
viagra australia
viagra india
uk cialis supplier
viagra natural
exercising after taking cialis
cheap viagra
cialis duration of effectiveness
cvs viagra
viagra on-line
cialis versus levitra
sample cialis
u id password cialis
generic for viagra
viagra not working
levitra medicine
natural cialis
cialis wholesale online
cialis samples
cialis viagra levitra
herbal viagra replacements
women use viagra
buy viagra online
viagra online no prescription
multiple acts viagra
viagra forum
viagra online asap
viagra in the water
generic viagra mexico
viagra cialis store
cialis interactions
generic brands of viagra online
soma
cialis pictures results
viagra without a prescription
viagra patent
viagra tiajuana
alchohol and cialis
cialis purchase
cialis and viagra together
overnight viagra
gernic viagra
cialis user reviews
levitra and marijana
viagra buy
viagra directions
rapid tabs viagra
viagra suppositories ivf
wild horses viva viagra
viagra beneficial side effects
canada cialis levitra
viagra cialis
cheap cialis
10 mg cialis
viagra for sale
viagra and jet lag
buy discount paxil
cialis oral
viagra side effects
get viagra over the counter
herbal viagra 32
viagra london
viagra and blood pressure
levitra men video
viagra online
womens viagra
sample of viagra
womens viagra
viagra professional
generic viagra cheap
efficacy levitra
viagra erection time
viagra stories
us pharmacy cialis
viagra cream
mexican viagra
discount generic viagra
viagra low cost
levitra side effects
hair growth with viagra
levitra cialis viagra
buy viagra usa
ed cialis
adverse side effects of viagra
side effects of cialis
viagra uk sales
uprima cialis viagra
apcalis vs viagra
viagra england
buy cheap viagra online uk
buy viagra in uk
guaranteed cheapest viagra
low cost viagra
levitra prescribing
cost of viagra
cialis drug prescription
cialis soft tab description
viagra supplier
viagra pictures
cialis viagra levitra
viagra prices
20mg levitra