Next Generation Snowman Racing Simulator

Posted by (twitter: @Cool_Mo_D521)
December 7th, 2014 10:14 am

I told myself that this time, I’d make some posts on the LD site while I was working.

Then I decided I needed net code.

On the plus side, I’ve got drop in / drop out multiplayer working, which is seriously cool.

In my as-of-yet-unnamed snowman racing simulator, players compete to be the first snowman to reach the end of a rocky, snow-covered path. Players join by visiting a URL on their phone, and move left and right by tapping the corresponding half of their phone screen.

The game looks like this right now:

2014-12-07-120319_5760x1080_scrot

And here’s a video.

How does this fit the theme, you might ask? Well, despite every player holding a phone, the entire game is on a single screen, that everyone looks at. Like a big TV or something. The phone screen just displays this:

2014-12-07-120814_800x541_scrot

Things you might find interesting:

  • I’m using webRTC for inter-device communication. This means the latency should be very low. I’m using PeerJS as a signaling server. PeerJS is extremely cool, by the way.
  • When generating a level, I use an A* search to ensure that the level is beatable. Interestingly, browsers are fast enough today that I can do hundreds of A* searches in the process of making a level, so I actually do itĀ every time a new object is placed.
  • Game sounds are played from the phone that the user is controlling the game with. This way, it’s easy to tell who the sound is for, and the TV isn’t just emitting a mess of footsteps.
  • I’m using the WebAudio API. Which is weird. I wanted to just use <audio> tags, but I couldn’t get chrome on android to actually play the sounds until I tapped on them. Ugh.
  • I’m usingĀ @davidshimjs‘s qrcodejs to generate the join code.
  • Google drive can’t play .aac audio. My phone can only record .aac audio.

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]