Skip to content

mnbond/vectrex-bloxorz-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vectrex game Bloxorz

A JavaScript implementation of Bloxorz game for a vector display-based home video game console Vectrex. View demo here: codepen.io.

Screenshots

Instructions

  1. Add JavaScript code containing class Vectrex in an HTML document:

    <script src="js/vectrex.js" type="text/javascript"></script>
  2. Add HTML element for the game in body section:

    <div id="vectrex-container"></div>
  3. Сreate an instance of class Vectrex after the DOMContentLoaded event:

    document.addEventListener("DOMContentLoaded", () => {
        vectrex = new Vectrex("vectrex-container", 30);
    });

    Class Vectrex constructor parameters:

    • containerId — ID of HTML element for the game;
    • cellSizePx — size of cell in pixels, default 10 pixels.

Adding new levels

To add new levels modify this method of class Vectrex:

class Vectrex {
    ...
    setDefaultProperties() {
        ...
        this.settings = {
            ...
            levels: [
                {
                    cells: [],
                    cellStartPosition: [],
                    cellFinishPosition: []
                }

Releases

No releases published

Packages

No packages published