Trade-Winds/start.js

37 lines
862 B
JavaScript
Raw Normal View History

OS.S.defaultStep = 1 / 120;
2016-04-17 07:35:04 +02:00
OS.S.numberOfScriptsToLoad = 16;
OS.S.pixelScale = 4;
// Oversimplified.DEBUG.showMessages = false;
OS.SetCamera({
width: pixel(64),
height: pixel(64),
hBorder: pixel(24),
vBorder: pixel(24)});
function start()
{
OS.AddScript("loadControls.js");
2016-04-16 21:11:16 +02:00
OS.AddScript("loadAudio.js");
2016-04-06 16:00:58 +02:00
OS.AddScript("loadGameManager.js");
OS.AddScript("loadPrefabs.js");
OS.AddScript("loadGUIs.js");
OS.AddScript("loadRooms.js");
}
function pixel(number) {
return ((typeof number !== 'undefined') ? number : 1) * OS.S.pixelScale;
}
function secondsWorthOfFrames(seconds) {
return seconds * (1 / OS.R[OS.R.currentRoom].stepSpeed);
}
function randomSmidge() {
// Return a random amount between -10 and 10 on the pixel scale.
return (pixel(Math.round(Math.randomRange(-10, 10))));
}
function sortNumber(a, b) {
return a - b;
}