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

Private Notes Update 1.1

- Fixed a bug where user edits were lost if the screen locked while editing a specific note - Fixed a bug where the unlock screen sometimes asked for the password multiple times - Fixed a bug where the creation time of new notes made on the web page displayed incorrectly in WiFi access mode - Fixed a bug where the IP address was sometimes obtained as (null) in WiFi mode

App Development

Private Notes released

My first personal app, Private Notes, is now live on the App Store. From the first version submission to approval, including one rejection along the way, it took 10 days in total. Private Notes is a password-protected memo app I built for my own needs at work and in daily life. Back when I was a kid, my teacher taught me what Chairman Mao once said: “A good memory is no match for a worn-out pen.” That line has stayed with me ever since, and over the years I’ve put it into practice — if it’s worth remembering, I write it down. Now we’re in the information age, and I’m a heavy user of electronic devices. Going out without my phone cuts my HP and my mood in half. My important information — website accounts, security questions — all lives in my phone’s notes app, carried with me everywhere. Even my bank card details, my phone number’s PUK code, the serial numbers and MAC addresses of all my devices — all of it depends on my phone to remember. But phones are easy for other people to grab and play with. With everything stored on the phone, private data is easy for others to see, so a lot of the time I don’t dare write it down at all…

App Development