SAM2WOW / StonkGame

An Example Game for and Example Framework

Home Page:https://rndmcnlly.github.io/StonkGame/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example Game for an Example Framework

This code sample shows how to develop an extremely simple game framework in the style of Phaser. It implements a terrible stock trading simulator on of an engine usable like this:

class Example extends Engine.Scene {
    setup() {
        this.engine.setTitle('Example Title');
        this.engine.addAction('bleep');
        this.numBleeps = 0;
    }

    update(time) {
        this.show(numBleeps);
    }

    handleAction(action) {
        if(actions == 'bleep') {
            this.numBleeps++;
        }

        if(this.numBleeps > 10) {
            // restart
            this.engine.gotoScene(Example);
        }
    }
}

let game = Engine.Game(Example);

About

An Example Game for and Example Framework

https://rndmcnlly.github.io/StonkGame/


Languages

Language:JavaScript 89.9%Language:HTML 10.1%