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.
Chopper Command: Sprites with Löve
the hard way
In the book Löve for Lua Game Programming I mentioned in my previous post the author shows examples of using external libraries with Löve to control various things, such as animations. The Löve website has a long list of these libraries and they certainly make life easier. But as I wanted to port most of the code to other frameworks, I decided to do things the hard way. So here’s how I created the sprites for the game in Lua.