• Save
Slides360 Flex2010 Oz Michaeli
Upcoming SlideShare
Loading in...5
×
 

Slides360 Flex2010 Oz Michaeli

on

  • 1,177 views

Flash to iPhone: Use What You Already Know About Flash to Make Kick Ass Objective-C and OpenGL Apps

Flash to iPhone: Use What You Already Know About Flash to Make Kick Ass Objective-C and OpenGL Apps

Statistics

Views

Total Views
1,177
Views on SlideShare
1,088
Embed Views
89

Actions

Likes
1
Downloads
1
Comments
0

2 Embeds 89

http://spiralstormgames.com 58
http://notizen.video-flash.de 31

Accessibility

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Slides360 Flex2010 Oz Michaeli Slides360 Flex2010 Oz Michaeli Presentation Transcript

  • FLASH TO IPHONE Use what you already know about Flash to make kick-ass Objective-C and OpenGL apps Oz Michaeli Co-Founder, Spiralstorm Games
  • Oz Michaeli @oztune spiralstormgames.com Blog: spiralstormgames.com/blog New York City
  • •Started with Flash 5 •Made too many websites •Was fascinated by game development
  • THE FISIX ENGINE
  • Freedom Run Flyloop
  • ... BUT WHO ARE YOU?
  • GENERAL OVERVIEW • Overview of available technologies • Getting started with iPhone dev • Hands-on demo • Building a simple app • Extracting assets from Flash • Real life app demo
  • WHAT YOU CAN EXPECT TO LEARN • What it takes to make an iPhone app •A little Objective-C • How to get started with the Pixelwave framework • Ultimate goal: • Being able to make high-performance native iPhone apps with an API familiar to Flash developers
  • IPHONE FOR FLASH DEVELOPERS What are my options?
  • OPTION A The hard-core way
  • OPTION B The automatic way
  • OPTION C A hybrid way
  • PIXELWAVE •A mix between ActionScript 3.0 and Objective-C • Native iPhone development • Allows for high performance applications • Low-level optimizations possible
  • WHY MAKE PIXELWAVE? • Pixelwave started as a product of need • Needed a clean API, but fast performance • We love the Flash API • Been using Flash for prototyping • Decided to re-create core classes in Objective-C
  • WHY OBJECTIVE-C • It’s native to the iPhone • It has the lowest overhead • While being clean and Object-Oriented • Allows for low level control when needed • It’s really not as bad as it seems initially :)
  • DESIGN GOALS • Familiar interface • Small memory foot-print • OpenGL Performance • Extendibility
  • DESIGN GOALS • Familiar Interface • Small memory foot-print • OpenGL Performance • Extendibility
  • FAMILIAR INTERFACE • Based completely on the Flash API • Recreates the core functionality in Objective-C • Same class names, function names • Ex: (PXSprite, PXGraphics, PXEventDispatcher, etc...) • Adds specialized functionality for the iPhone
  • DESIGN GOALS • Clean Interface, based on the Flash API • Small memory foot-print • OpenGL Performance • Extendibility
  • SMALL MEMORY FOOTPRINT • Memory limited on the iPhone • Saved memory can be used to improve your app • More media • Bigger levels • More caching
  • DESIGN GOALS • Clean Interface, based on the Flash API • Small memory foot-print • OpenGL Performance • Extendibility
  • OPENGL PERFORMANCE • This is an important one • Lots of Invisible optimizations • User tweakable options •C core, Object Oriented Interface
  • DESIGN GOALS • Clean Interface, based on the Flash API • Small memory foot-print • OpenGL performance • Extendible design
  • EXTENDIBILITY • We can’t possibly think of everything • Sometimes you have to add custom behaviors • Custom C interface for interacting with OpenGL • Provides a layer of abstraction • More invisible optimizations
  • MAIN FEATURES • Super optimized OpenGL rendering. • Clean API, AS3 based • Simple event dispatching model • Handles native iPhone features • Native vector drawing. • TextFields with native or custom fonts. • One line texture loading, • Sound playback • Very easy to extend • Plays nice with Cocoa Touch
  • PXDisplayObject PXTexture PXInteractiveObject PXShape PXDisplayObjectContainer PXSprite PXStage PXGraphics PKAnimationClip
  • OBJECTIVE-C PRIMER
  • OBJECTIVE-C FOR FLASH DEVS • Shares many core concepts with ActionScript 3.0 • Object Oriented • No dynamic typing • Built on top of C • Some wacky syntax for method calls • No Garbage Collector
  • DECLARING VARIABLES ActionScript 3.0: var i:int; var button:Button; Objective-C: int i; Button* button;
  • INVOKING A METHOD ActionScript 3.0: mc.addChildAt(childMC, 3); Objective-C: [mc addChild:childMC at:3];
  • READS LIKE A SENTENCE Objective-C: [object gotoFrame:10 atTime:30.0 withAnimation:@”Jog”];
  • DECLARING METHODS ActionScript 3.0: public function reverseArray(arr:Array):Array{...} public static function whiteNoise():void{...} Objective-C: - (NSArray *)reverseArray: (NSArray *)arr{...} + (void) whiteNoise{...}
  • INSTANTIATING AN OBJECT ActionScript 3.0: person = new Person(“Jimbo”); Objective-C: person = [[Person alloc] initWithName: @”Jimbo”]];
  • MEMORY MANAGEMENT • Applies only to Heap allocation (ie the new command in AS) • If you made it, you delete it • Messages starting with alloc, and new, copy indicate ownership • Forevery owning method call, a [object release]; call must be made
  • MORE INFO • http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/ MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994-BAJHFBGH • http://memo.tv/memory_management_with_objective_c_cocoa_iphone • http://www.johncmurphy.com/product.aspx?pid=349
  • GETTING STARTED What do I need?
  • HELLO WORLD
  • DEMO: AS3 VS OBJ-C
  • ? EXPORTING FLASH ASSETS
  • CONVERTING VECTOR ART Looks like another demo...
  • WORKING WITH ANIMATIONS •A great OpenGL optimization is to use the smallest amount of textures possible • Enter the Texture Atlas • New tool to convert MovieClips directly to a texture atlas
  • MOVIECLIP EXPORTER
  • MIXING IT UP • Best solution is probably a hybrid one • Automatic conversion can only go so far • Some manual input needed for optimization • We’re looking forward to seeing where the community can take these tools
  • PUTTING IT ALL TOGETHER How we’re using Pixelwave
  • DEMO TIME!
  • WHAT’S NEXT? • Pixelwave will enter beta phase soon • Will be open source, completely free to use • Other platforms • We can’t wait to find out
  • THANK YOU! • Coming to 360|iDev? See you there. • spiralstormgames.com/blog • @oztune