From AS to cocos2d-Action

I used to be an ActionScript developer. Last year I started working with Objective-C, and this year I got into cocos2d. I’ve had some insights during the learning process, so I’m looking back and sharing them, as a report and reference for more fellow developers who want to move from Flash development to cocos2d. Learning cocos2d has been a pleasant process, because switching from Starling feels incredibly convenient—like back when I moved from PureMVC to Robotlegs, that feeling of meeting too late. This article records a short summary of what I learned about Action in cocos2d. Actions in cocos2d are similar to motion tweens in Flash, but they’re more powerful. In Flash, everything you can do with motion tweens, including position, rotation, scale, color, and opacity, can also be done with Actions in Cocos2D. But in Flash development, relying only on changes in position, rotation, scale, color, and opacity isn’t enough to make an interesting game—these are just animations. More comprehensive actions are what make various values change, and they come in two types: instantaneous changes and changes over time. In Flash, I generally use GTween to control changes to various values. Here’s an example: say you’re making the resource amount display text in StarCraft. When you spend or gather some resources, the resource amount text doesn’t change directly; it ticks over time. So I usually create a custom TextField, implement a pair of getter and setter, and use GTween to change their values, adding easing. Many effects can be achieved this way. You can even ease through texture swaps according to certain rules.

App Development

Food Match-3 Launched

A single-player iPad game I developed in my spare time. My wife loves match-3 games, so I started with a match-3, and since food is adorable, I went with a food theme. Development plus assembling ...

App Development