Chopper Command in Cocos2d-x: Sprites

adding our first images

Let’s add a background to the game. If you remember from the previous versions of the game, the background is formed with three sprites: the bg proper and two mountain sprites which are duplicated so we can scroll them.


Chopper Command in Cocos2d-x: Lua

taking it to cocos2d-x 3.2

For the Cocos2d-x version of the game, I’ll use their new IDE, called Code. It supports projects using either the JavaScript or the Lua bindings to the framework. And you can use the IDE to create new bindings, something I’ll show in a later tutorial.


Chopper Command: Creating the Bullet


Let’s add the player bullet and with this the final piece of the puzzle so to speak: drawing primitives with Löve. After this I’ll move to Cocos2d-x and their new IDE and Lua development flow, which is freakin’ awesome.


Chopper Command: Adding the Player

and keyboard

Now we add the player sprite to the screen and listen to key events to move the player about. I’ll use löve’s api for the key events. But first, let’s add the player class


Chopper Command: Adding the Bombs

da bomb!

Time to give the baddies some teeth. I had to change a few things to support the bombs. I made the bomb class hold the reference to two objects, which are points basically, rendered to screen with the same skin.