npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ol-games

v2.0.0

Published

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

Downloads

394

Readme

ol-games

One hand, many games use maps as playground and some are based on a map. On the other hand, OpenLayers is a high-performance, feature-packed library for creating interactive maps on the web.

This project aims to test and add game mechanisms within Openlayers (ol).

It is by no means a complete game or complete game engine but you should find some stuff to devleopp game on a map with Openlayers.

View live examples online!

Dependencies

This project uses Openlayers and ol-ext. Hexagnol grid concepts developped in the Red Blob Games.

Materials mainly comes from the FreeSound project and OpenGameArt.

Openlayers

OpenLayers makes it easy to put a dynamic map in any web page.

  • It can display map tiles, vector data and markers loaded from any source.
  • Leverages Canvas 2D, WebGL, and all the latest greatness from HTML5. Mobile support out of the box.
  • Implements animations mecanisms and the postcompose hook allows to intervene with the OpenLayers rendering process to draw onto the canvas context. A postcompose listener is called for every rendering frame and is the perfect place to implement animations.
    Just look at the Openlayers example page to see what's up.
  • Render objects over the map (vector features) with styling functionnalities.
  • Add interactions widgets to the map (controls, overlays) to interact with your maps.
  • Actually already uses a 2D spatial index R-Tree to perform spatial queries very efficiently.
  • Pixel-based hit-detection
  • Exposes an API for drawing geometries and features to the output canvas

ol-games

Here are some of the features I'm working on in this repository.

Hex map

A hexagonal map or hex map is a game board design commonly used in wargames of all scales. The map is subdivided into a hexagonal tiling, small regular hexagons of identical size.

For more information on Hexagnol grid, I recommend this fabulous Red Blob Games article.

Sprite

Sprite and Spritesheets have been used in games for a long time.

This include sprite animation and sprite collision detection.

Animations

Explosions

Explosions are an integral part of games. Not that all games need explosions, but they play an important role in the game dynamics.

Artificial intelligence

Pathfinding algorithms: A*

Audio

This is just a simple implementation of the HTML Audio to add sounds in a game.

Licence

ol-games is licenced under the French Opensource BSD compatible CeCILL-B FREE SOFTWARE LICENSE.
(c) 2017-2019 - Jean-Marc Viglino

Some resources (mapping services and API) used in this sofware may have a specific license.
You must check before use.

Full text license in English
Full text license in French

For convenience ol-games is also published under the BSD-3-Clause Licence.