Skip to main content

Posts

Showing posts with the label game

Teach a computer to play air hockey

I'm always looking for an excuse to build something fun... So it was only a matter of time before I got the idea to create a virtual air hockey game, and then train a neural network to play it. Check it out: https://github.com/wybiral/air-hockey The idea is pretty simple. First setup some basic physics for controlling the puck and paddles. Instead of writing a new physics engine I decided to go with matter.js (it's easy to use and supports everything I needed here). The neural network is a basic multilayer perceptron handled using synaptic.js (another great library that works well here). It's trained to recreate the actions of a human player given the position of the objects as inputs. I've also been using this mini-project to track my development process using releases so if you're curious how this was put together you can look at each step along the way here: https://github.com/wybiral/air-hockey/releases The next step will probably be to add export/impo...

Halloween Strategy Game

As a fun little side project to kick off the season I decided to write a Halloween themed strategy game (in the style of the tower defense genre). Appropriate for children (there is no gore or violence) although it may be a bit challenging for young ones. Click Here  to play! As the narrator explains... Monsters appear every Halloween night and take all of your candy. It's up to you to build spooky decorations to scare them off as they get progressively more difficult to frighten. It was written from scratch in Javascript leveraging HTML Canvas , jQuery , and UnderscroreJS . I took most of the images from google image search. If you own any of them and would either like credit or want them removed, contact me immediately! Happy Halloween!