Skip to content

Soldy/levelrunnerrc

Repository files navigation

levelrunnerrc

About

This is the legacy-level runner event chain. Still used some of my legacy games. This a helpful tool if you build an event build code where some event can trigger multiple functions. The levels can be defined as a costume number of levels. So if a function is dependent on another. Possible to set the other to a lower level and that guarantees the dependencies running in the right level. This is maintained for legacy reasons only.

install

npm i levelrunnerrc

init

const levelrunner = new (require('levelrunner')).Base(
    ()=>{
       // do something before;
    },
    ()=>{
       // do something after; 
    },
    100 // numberOfLevels
);

add task

levelrunner.add(
    function(){
        //do something
    },
    runlevel,
    name
);

run

frontend

window.onload = levelrunner.run;

backend

levelrunner.run();