forked from Banderi/Ozymandias
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
s.kushnirenko
committed
Sep 24, 2023
1 parent
54acfa0
commit 07672f0
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Math.clamp = function (a, b, c) { | ||
return Math.max(b, Math.min(c, a)); | ||
} | ||
|
||
Math.randomIndex = function(min, max) { | ||
var offset = min; | ||
var range = (max - min) + 1; | ||
|
||
var randomNumber = Math.floor( Math.random() * range) + offset; | ||
return randomNumber; | ||
} | ||
|
||
Math.percentage = function(value, base) { | ||
return Math.floor(value / base * 100); | ||
} | ||
|
||
log_info("!!! Module Math Loaded") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
log_info("Ozymandias: load modules started") | ||
|
||
var modules = [ | ||
"math", | ||
// "main_menu" | ||
] | ||
|
||
for (var i in modules) { | ||
log_info("Loading module " + modules[i]) | ||
load_js_module(":" + modules[i] + ".js") | ||
} |