Inspiration

Coding is fun, video games are fun, so a coding video game seems like a very good idea. Not only is it entertaining, it's also useful. For example, using video games can motivate kids and beginner programmers, and "guide" them into writing useful programs.

I think this game is particularly useful because you need to read code fast. You need to look at the S-Expression and, as it's falling towards the ground, find out a) what it'll evaluate to, and b) how to make it evaluate to something better.

What it does

This is a simple game. You can rotate and fire a cannon in the center of the screen - via the mouse (mac) or your fingers (iOS). The cannon fires emojis - sometimes food (pizza, donuts, burritos, and sushi), sometimes bombs.

Immediately when the game starts, LISP expressions fall from the sky. These expressions also contain emojis - food and bombs. If you shoot one of the emojis, you can replace it. For example, there could be an expression (+ x 'bomb'), and you have a 'pizza' in your cannon. If you shoot the 'pizza' and it hits the 'bomb', it'll replace the bomb, so the expression will be (+ x 'pizza').

Once an expression hits the ground, it evaluates. Every expression evaluates to either a single emoji, a list of emojis, or a list of lists of emojis. Depending on which emojis come out of the expression, different things will happen. Food emojis will add points - donuts add 10 points, pizza adds 15, burritos add 25, and sushi adds 45 points. But bombs will make you lose the game - as soon as an expression reaches the ground which evaluates to a bomb, LISP blocks stop falling and your score is final.

So the object of the game is to modify the Expressions, by changing their emojis, so they don't evaluate to bombs, and instead evaluate to a lot of food. This isn't as simple as it sounds. Emojis can be compared (emojis giving more points are "greater"). They can be multiplied. They can be applied to functions. Over time, the falling LISP expressions get more complicated, and they start to fall in larger groups, so you have very limited time to decipher them.

How I built it

I used Swift and SpriteKit. I made it cross-platform, so it works on iOS and mac.

Challenges I ran into

Coming up with the idea was probably one of the hardest parts. There are a lot of coding games out there, and I needed to make one which was unique and simple. Time, being tired...

The game is more complicated than it might seem - I had to make a LISP parser and interpreter, as just a part of the game.

Accomplishments that I'm proud of

I got it done - it works, and it's even kind of fun.

What I learned

I learned more about programming language interpreters and game design.

What's next for LISP Defenders

More complicated, cool LISP expressions. More power-ups, more complicated expressions.

Built With

Share this project:
×

Updates