Case study: Pixel City Skater, an iPhone game made with Flash

Do you remember Christian Östman and his Flash 3D game A Small Car?

He’s back with Pixel City Skater, a free (for a limited time) game for iPhone made with Flash and AS3.

As usual, he shares his experience with us:

Pixel City Skater is the first iPhone game we’ve made. We wanted to try and see if it was possible to use Flash and AS3 to create a game for iOS and get it to the market. Using Adobe Air 2.6 it’s possible to create an iOS Application from your AS3-projects. While Air 2.7 is just around the corner, adding Flex-support and increased performance we didn’t have access to a pre-release of it so 2.6 had to do. As we didn’t have alot of time for the project we needed a very simple game-idea that could be done in pretty much a day. After some quick testing we decided on a small one-button game with a skateboarder.

To make the game we used Flash Builder 4.5 and the Flixel frameweork. It seemed like a good idea as it uses blitting to draw everything on screen to a bitmapdata, making it very suitable for mobile devices. It also made it pretty easy to support the different resolutions for the iPhone4 and the older models.The way we do it is simple, the game is running at half the standard iPhone resolution, 120×240. All the graphics and bitmaps is designed for that size. When the game loads we do a check (using the Capabilites class) what resolution the device we’re running on has. If it’s 320*480 (iPhone 3GS) we tell Flixel to scale the game x2. If the resolution of the device is 640×960 (Iphone 4) the game is scaled x4. This is a technique often used in pixel-style games to make the pixels appear bigger.

When we first tried the game on an actual device it was running very slow. The problem seemed to be that we hadn’t set the rendering mode of the application to GPU in the application descriptor file. After that the game was running much smoother on the device. Even the blood-particles, with gravity and collision, when the skater died rendered with no problems (Adding more than a 100 particles at the same time seemed to slow it down though).

Adding sound and music to the game was the same as a normal AS3-project, and it worked perfectly on the first try.
We used Local Shared Object to save the gamestate and scores when the app was closed. I was a bit surprised to see that working without any problems.

We started working on the game on a thursday and it was finished on the next day (Friday (partying). We-we-we so excited). After that we sent the game to the App Store and it was approved about a week later.The game is available on the App Store and it’s currently free for about a week (until June 3) so if y

ou have an iOS-device you can try it out, with no charge: Get Pixel City Skater from the App Store for free for a limited time!

There’s alot of room for improvements in the game.
One thing would be to use special bitmaps for the iPhone4 Retina display, as scaling it 4x this way makes it loose some of it’s sharpness on the display. A big plus creating games using this way is that we could also release it for Android devices, the Playbook and a web-version with minimal changes.

Get the most popular Phaser 3 book

Through 202 pages, 32 source code examples and an Android Studio project you will learn how to build cross platform HTML5 games and create a complete game along the way.

Get the book

215 GAME PROTOTYPES EXPLAINED WITH SOURCE CODE
// 1+2=3
// 100 rounds
// 10000000
// 2 Cars
// 2048
// A Blocky Christmas
// A Jumping Block
// A Life of Logic
// Angry Birds
// Angry Birds Space
// Artillery
// Astro-PANIC!
// Avoider
// Back to Square One
// Ball Game
// Ball vs Ball
// Ball: Revamped
// Balloon Invasion
// BallPusher
// Ballz
// Bar Balance
// Bejeweled
// Biggification
// Block it
// Blockage
// Bloons
// Boids
// Bombuzal
// Boom Dots
// Bouncing Ball
// Bouncing Ball 2
// Bouncy Light
// BoxHead
// Breakout
// Bricks
// Bubble Chaos
// Bubbles 2
// Card Game
// Castle Ramble
// Chronotron
// Circle Chain
// Circle Path
// Circle Race
// Circular endless runner
// Cirplosion
// CLOCKS - The Game
// Color Hit
// Color Jump
// ColorFill
// Columns
// Concentration
// Crossy Road
// Crush the Castle
// Cube Jump
// CubesOut
// Dash N Blast
// Dashy Panda
// Deflection
// Diamond Digger Saga
// Don't touch the spikes
// Dots
// Down The Mountain
// Drag and Match
// Draw Game
// Drop Wizard
// DROP'd
// Dudeski
// Dungeon Raid
// Educational Game
// Elasticity
// Endless Runner
// Erase Box
// Eskiv
// Farm Heroes Saga
// Filler
// Flappy Bird
// Fling
// Flipping Legend
// Floaty Light
// Fuse Ballz
// GearTaker
// Gem Sweeper
// Globe
// Goat Rider
// Gold Miner
// Grindstone
// GuessNext
// Helicopter
// Hero Emblems
// Hero Slide
// Hexagonal Tiles
// HookPod
// Hop Hop Hop Underwater
// Horizontal Endless Runner
// Hundreds
// Hungry Hero
// Hurry it's Christmas
// InkTd
// Iromeku
// Jet Set Willy
// Jigsaw Game
// Knife Hit
// Knightfall
// Legends of Runeterra
// Lep's World
// Line Rider
// Lumines
// Magick
// MagOrMin
// Mass Attack
// Math Game
// Maze
// Meeblings
// Memdot
// Metro Siberia Underground
// Mike Dangers
// Mikey Hooks
// Nano War
// Nodes
// o:anquan
// One Button Game
// One Tap RPG
// Ononmin
// Pacco
// Perfect Square!
// Perfectionism
// Phyballs
// Pixel Purge
// PixelField
// Planet Revenge
// Plants Vs Zombies
// Platform
// Platform game
// Plus+Plus
// Pocket Snap
// Poker
// Pool
// Pop the Lock
// Pop to Save
// Poux
// Pudi
// Pumpkin Story
// Puppet Bird
// Pyramids of Ra
// qomp
// Quick Switch
// Racing
// Radical
// Rebuild Chile
// Renju
// Rise Above
// Risky Road
// Roguelike
// Roly Poly
// Run Around
// Rush Hour
// SameGame
// SamePhysics
// Save the Totem
// Security
// Serious Scramblers
// Shrink it
// Sling
// Slingy
// Snowflakes
// Sokoban
// Space Checkers
// Space is Key
// Spellfall
// Spinny Gun
// Splitter
// Spring Ninja
// Sproing
// Stabilize!
// Stack
// Stairs
// Stick Hero
// String Avoider
// Stringy
// Sudoku
// Super Mario Bros
// Surfingers
// Survival Horror
// Talesworth Adventure
// Tetris
// The Impossible Line
// The Moops - Combos of Joy
// The Next Arrow
// Threes
// Tic Tac Toe
// Timberman
// Tiny Wings
// Tipsy Tower
// Toony
// Totem Destroyer
// Tower Defense
// Trick Shot
// Tunnelball
// Turn
// Turnellio
// TwinSpin
// vvvvvv
// Warp Shift
// Way of an Idea
// Whack a Creep
// Wheel of Fortune
// Where's my Water
// Wish Upon a Star
// Word Game
// Wordle
// Worms
// Yanga
// Yeah Bunny
// Zhed
// zNumbers