Tag Archives: multiplayer

Week 2 Game: Shaderball

This week I wanted to make something with a minimalist look. I totally failed at that. This is Shaderball:

2

It’s a 2 player air hockey type game; you push your balls to the opponent’s side. You have 10 balls you can fire into the goal to get a higher score than your opponent. Player 1 has the ability to pull all balls towards the centre of the two players. Player 2 has the ability to slow down time. Only one ability can be used at any time. The number of balls left for each player is represented by the black part of the circle in the player.

Play here: https://dl.dropboxusercontent.com/u/32538545/Shaderball/WebBuild.html only 50kb!

Here’s a short gameplay video:

Controls

With Xbox 360 controller(s):

  • Left thumbstick – move player 1 (left side)
  • Right thumbstick – move player 2 (right side)
  • Left bumper – player 1 release ball
  • Right bumper – player 2 release ball
  • Left trigger – player 1 ability –  pull balls towards centre
  • Right trigger – player 2 ability – slow down time

With Keyboard:

  • WASD – move player 1
  • Arrow Keys – move player 2
  • Left ctrl –  player 1 release ball
  • Right ctrl – player 2 release ball
  • Left shift/ F – player 1 ability –  pull balls towards centre
  • Right shift/ Comma – player 2 ability – slow down time

The game is called Shaderball because the shaders’ code comprises about twice as much as the gameplay code. There are 2 main shaders, one for the board and players, and one for the balls, sides and number of balls left. The only other things are particles and text. With lots sine and cos functions modulated by 3D simplex noise (all factoring in time), the shaders are near the maximum number of arithmetic instructions. I used a variety of these shaders for reference: https://www.shadertoy.com. Hopefully it will work in your web browser (if you have a decent GPU)!

I did most of the gameplay in one hour, which just shows how nice Unity is! I took lots of coding shortcuts this time, which didn’t have any repercussions. I should definitely spend less time on visuals and more on gameplay next week!

1