There is a bunch of stuff you will need to do before you attempt to run this project. Basically they are all related to running the Stage3D api. If you can run it, you may skip the next section. If you haven’t set up your IDE to use Stage3D already, here is a brief list of things you need to do (I’ll assume you have Flash Builder, though Flash Develop will work just fine, with minor adjustments to the instructions that you can find about on google).
I will first explain something of the logic controlling the game. It is very important to point out that the logic itself has nothing to do with any of the frameworks I’ll use. The frameworks for the most part only influence the VIEW part of the logic: the actual rendering of textures on screen in place of all the rectangle objects the logic handles.
Now it’s time to bring the same game to the iPad, and once again I will use Cocos2D as a framework to manage OpenGL. If I have time later I may post a version of the same game but without Cocos2D; using instead classes from the now defunct CrashLanding sample project from Apple.
It’s been a while since my last post, as I’ve been busy with projects, including my first two iOS games. But I decided to take a day off and start working on a new tutorial on how to make the move from ActionScript to Objective-C. This time with an actual game.
To recreate the same application in Quartz 2D you will need Views. So here’s what you need to do. Create a new Project in XCode, pick View-Based Application and name it whatever you want. But let’s say you named it LineDrawing.
Cocos2D is a game framework that simplifies game development for iOS. Its main advantage is that it serves as an excellent in-between for you and OpenGL. And if you have ever coded in OpenGL, you know how great this bit of news is. Reading OpenGL code is akin to reading Chemical composition tables with your eyes crossed. Cocos2D also makes memory management easier, you will notice you use a lot less retains and autoreleases when coding with cocos2d. Some people are freaked out by this, I’m not one of them!
I will cover the creation of LinePath2D and PathPoint first, showing how to turn them from ActionScript to Objective-C and along the way I will cover all the main points and peculiarities of that language.
Now for 3D! If you’ve seen my 3D collision tutorials you will know at least one way of using the LinePath2D logic in 3D, and that is by simply changing the Y in every line path point to a Z value. And you’re done. But what if you want to use the PathAnimator in Away3D? Here’s how.