Player 1: WASD to move and F to attack
Player 2: IJKL to move and ; to attack
Use the menu to control the animated GIF background
GIF CUBES is an experiment in WebGL, physical interactions, and game development. It is a 3D game, but movement is only allows in the two dimensions of your display; think Super Smash Brothers! There are two players. The goal is to increase your score by hitting your opponent so that he cannot return to the map. Every time one of the players travels so far away they cannot return, they are returned to their original starting position their opponent scores. In addition, for every time a player is hit by their opponent but does not die, each successive hit will send them flying further. The camera is programmed to automatically follow the two players.
Players are able to defy a bit of regular gravity because they can jump once in mid air and change their direction in the air. A player can also specify a downward movement to increase their fall speed. A player can jump up through a platform without restriction, and if a player lands on a platform, his jumps are reset back to the maximum of two. Downward movement while on a platform makes the player fall through it, so players are more easily able to move up and down between platforms. Try it!
Luckily shaders in WebGL use GLSL just like OpenGL. The are simply put in a script element in HTML and there are WebGL calls to compiler and use shader programs just like in OpenGL.
WebGL also has awful performance (at least for my old laptop video card). My game would run smoothly most of the time, but I was only rendering 5 cubes without textures or anything complicated effects and my CPU would lock to 100% utilization. I'm sure there are some workarounds for these performance issues and WebGL certainly isn't able to compete with OpenGL, but it is really cool that it's possible!
Canvas is an HTML5 element which allows drawing pixels and making an image. There was a neat tutorial highlighting the benefits of using multiple canvases if you're able to layer your game. The more canvases used, the less CPU time it takes to swap all the buffers around, but the more memory your web application will require.