-
Notifications
You must be signed in to change notification settings - Fork 2
/
game.js
109 lines (82 loc) · 2.03 KB
/
game.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
var GAME = (function(global) {
var module = {};
module.screenToGameX = function(x) {
return (x - getWidth() / 2) / getRatio() + getX();
}
module.screenToGameY = function(y) {
return (y - getHeight() / 2) / getRatio() + getY();;
}
module.drawPoint = function(x, y, drawColor, text, size) {
global.drawPoint(x, y, drawColor, text, size);
}
module.drawArc = function(x_1, y_1, x_2, y_2, x_3, y_3, drawColor) {
global.drawArc(x_1, y_1, x_2, y_2, x_3, y_3, drawColor);
}
module.drawLine = function(x_1, y_1, x_2, y_2, drawColor) {
global.drawLine(x_1, y_1, x_2, y_2, drawColor);
}
module.drawCircle = function(x_1, y_1, radius, drawColor) {
global.drawCircle(x_1, y_1, radius, drawColor);
}
module.screenDistance = function() {
return global.getScreenDistance();
}
module.getDarkBool = function() {
return global.getDarkBool();
}
module.getMassBool = function() {
return global.getMassBool();
}
module.getMemoryCells = function() {
return global.getMemoryCells();
}
module.getCellsArray = function() {
return global.getCellsArray();
}
module.getCells = function() {
return global.getCells();
}
module.getPlayer = function() {
return global.getPlayer();
}
module.getWidth = function() {
return global.getWidth();
}
module.getHeight = function() {
return global.getHeight();
}
module.getRatio = function() {
return global.getRatio();
}
module.getOffsetX = function() {
return global.getOffsetX();
}
module.getOffsetY = function() {
return global.getOffsetY();
}
module.getX = function() {
return global.getX();
}
module.getY = function() {
return global.getY();
}
module.getPointX = function() {
return global.getPointX();
}
module.getPointY = function() {
return global.getPointY();
}
module.getMouseX = function() {
return global.getMouseX();
}
module.getMouseY = function() {
return global.getMouseY();
}
module.getUpdate = function() {
return global.getLastUpdate();
}
module.getMode = function() {
return global.getMode();
}
return module;
})(window);