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

ol-games uses ol-ext

Utilities

Gameloop
(map.gameloop.html)

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

game, gameloop

Frame rate control
(map.framerate.html)

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

game, animation, framerate

Hexagon map
(map.hexmap.html)

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!
(map.sprite.html)

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
(map.sprite.destination.html)

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

game, animation, sprite, move, destination

Sprite path
(map.sprite.path.html)

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

game, animation, sprite, move, path

Sprite collision
(map.sprite.collision.html)

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!
(map.explode.html)

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

game, animation, audio, explosion

Sound/music

Audio on a map
(map.audio.html)

Usefull class to handle audio API.

game, audio, media, sound

Full games