You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
995 B

2 years ago
"use strict"
let debug = false,
viewPort = {x: 0, y: 0};
let game,
menuOpen = false,
globalCursor,
loader,
settings,
colors,
values,
audio,
font,
credits;
function preload(){
settings = loadJSON("data/settings/Settings.json");
font = loadFont("data/styles/font.ttf");
credits = loadJSON("data/settings/Credits.json");
}
function setup(){
canvasSetup();
createVariables();
loadAudioFiles(audioFilesLoaded);
prepareInterface();
}
function draw(){
checkCursor();
if (loader){
loader.update();
}
if (game){
game.update();
game.display();
}
if (debug) debugInformation();
}
function canvasSetup(){
setFrameRate(60);
let c = createCanvas($("#canvasHolder").width(), $("#canvasHolder").height());
c.parent("canvasHolder");
textFont(font);
textAlign(CENTER, CENTER);
}
function createVariables(){
colors = settings.colors;
values = settings.values;
prepareCredits();
}
function showCredits(){
game.pause();
new Message(Message.Credits()).display();
}