Game stuff for Openlayers (ol), powered by HTML5, canvas, javascript and Openlayers.

ol-games uses ol-ext

Utilities

Gameloop

The ol.Grame implement a game loop based on the postcompose event of a map.

game, gameloop

Frame rate control

The ol.control.Framerate is a control that show graphically the current framerate.

game, animation, framerate

Hexagon map

ol.source.HexMap is an image source that render an hexagonal grid on a map. The ol.Hexgrid object has function to convert from coordinate to hex or calculate lines beetween hexagons.

map, hexmap, hexagon, grid, hexgrid

Sprite

Sprites!

ol.Sprite is a convenient class to handle features with a ol.style.sprite and usefull fuctions. It also can handle collisions beetween other sprites or a layer.

game, animation, sprite, collision

Sprite destination

ol.Sprite.setDestination() lets you move a sprite to a new destination along a straight line.

game, animation, sprite, move, destination

Sprite path

ol.Sprite.setPath() lets you move a sprite along a path.

game, animation, sprite, move, path

Sprite collision

Use the ol.Collision or the ol.Game.collide() function to detect pixel collisions beetween sprites or with an ol.Offscreen.

game, collision, sprite, pixel

Animation

Explosions!

An ol.feature.Animation to make explosions on the map.

game, animation, audio, explosion

Sound/music

Audio on a map

Usefull class to handle audio API.

game, audio, media, sound

Full games