O'Reilly logo

Learning iPhone Game Development with Cocos2D 3.0 by Kirill Muzykov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – adding the hunter

It is time to add the hunter back to the game. However, this time the birds will have fun. So, instead of shooting the birds, the hunter will be running around and dodging the stones that they throw at him.

There will be quite a lot of code to add, so here is a brief explanation of what we want to do. We want to create a new class for our hunter, as we cannot reuse the old Hunter class. Our new hunter class, PhysicsHunter, will have two animations: idle and running. We will control the hunter by touching the screen. When we touch the screen on the left-hand side, the hunter will run to the left, and when we touch the right-hand side of the screen, the hunter will run to the right. When we don't touch the screen, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required