Header for project Weltkriegsimulator

Example zCanvas game

The horribly titled "Weltkriegsimulator" (WKS) is a an hommage to Toaplan shoot 'em ups.

It's not exactly a full-on multi level gaming experience meant for entertainment purposes (though it does contain multiple levels, power ups, bosses and high scores).

Instead the game serves as a showcase of igorski's open source zCanvas gaming capabilities, able to update/render a massive amount of objects on each frame.

Open source for a purpose

While WKS might be mildly entertaining to those who enjoy the concept of the "Bullet Hell" game, the real exhibition is its source code.

WKS has been created using nothing but vanilla JavaScript, just to showcase the outline of a game (divided into model, controller- and rendering layers) and how the zCanvas rendering loop can be leveraged to handle the game loop.

You can obviously use zCanvas with a framework of choice.

Separating the concerns

The game is set up around a model containing all objects that can be interacted with, the Actors. Actors are generated through their respective factories.

The zCanvas render cycle is run at 60 fps. On each frame, the game simulation is updated. Actors that perform AI (e.g. enemy ships) update their movement, bullets follow their trajectory and the user input is handled.

The on-screen contents are generated by renderers, each Actor has a dedicated renderer able to visualize the current Actor state.

Open content

The graphic style of WKS is an amalgamation of public domain assets where all content, be it graphic sprites or sound effects, came solely from OpenGameArt.org.

All content was selected by going through the existing archives. All artists are credited on the respective "About / credits"-page in the game.

Music is streamed directly from SoundCloud. The song title and artist is displayed whenever a new tracks starts playing on game start.

Weltkriegsimulator in action

WKS can run directly in your browser and offers:

  • Offline support*
  • Full mobile support

*Note that an active internet connection is required in order to hear music and compete in the high scores