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
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
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.
Chopper Command: Adding the Baddies
what's life without enemies
Back to the game in Lua, finally. And now we’re ready to add the enemies into the game. For this, I had to create a few more types, like Rectangle and Point. I still haven’t created the GameTile class so for the sake of testing, I’m dumping all the new objects into the main view.
The Magic Math Puzzle
Here’s an interesting puzzle. I saw this a long time ago in one of my favorite crime novels, Death from a Top Hat by Clayton Rawson. In the book the detective, who is a magician, tries to explain how magic tricks work by using this math problem.