@gamely/gly-engine-micro 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.lua +51 -48
- package/package.json +1 -1
package/dist/main.lua
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
|
|
2
|
-
local
|
|
3
|
-
local
|
|
4
|
-
local
|
|
5
|
-
local
|
|
6
|
-
local
|
|
7
|
-
local
|
|
8
|
-
local
|
|
9
|
-
local
|
|
10
|
-
local
|
|
11
|
-
local
|
|
12
|
-
local
|
|
13
|
-
local
|
|
14
|
-
local
|
|
15
|
-
local
|
|
16
|
-
local function
|
|
17
|
-
local version =
|
|
18
|
-
local engine_game =
|
|
19
|
-
local engine_key =
|
|
20
|
-
local engine_math =
|
|
21
|
-
local engine_math_clib =
|
|
22
|
-
local engine_math_random =
|
|
23
|
-
local engine_array =
|
|
24
|
-
local engine_api_draw_text =
|
|
25
|
-
local engine_api_draw_poly =
|
|
26
|
-
local engine_raw_memory =
|
|
27
|
-
local color =
|
|
28
|
-
local std =
|
|
29
|
-
local eval_code =
|
|
2
|
+
local source_version_13dc = nil
|
|
3
|
+
local source_engine_api_system_app_13ee = nil
|
|
4
|
+
local source_engine_api_system_key_13f9 = nil
|
|
5
|
+
local source_engine_api_math_basic_1404 = nil
|
|
6
|
+
local source_engine_api_math_clib_140f = nil
|
|
7
|
+
local source_engine_api_math_random_141a = nil
|
|
8
|
+
local source_engine_api_data_array_1425 = nil
|
|
9
|
+
local source_engine_api_draw_text_1430 = nil
|
|
10
|
+
local source_engine_api_draw_poly_143b = nil
|
|
11
|
+
local source_engine_api_raw_memory_1446 = nil
|
|
12
|
+
local source_engine_api_system_color_1458 = nil
|
|
13
|
+
local source_shared_var_object_std_1463 = nil
|
|
14
|
+
local source_shared_string_eval_code_1475 = nil
|
|
15
|
+
local source_shared_functional_decorator_17f6 = nil
|
|
16
|
+
local function main_13d3()
|
|
17
|
+
local version = source_version_13dc()
|
|
18
|
+
local engine_game = source_engine_api_system_app_13ee()
|
|
19
|
+
local engine_key = source_engine_api_system_key_13f9()
|
|
20
|
+
local engine_math = source_engine_api_math_basic_1404()
|
|
21
|
+
local engine_math_clib = source_engine_api_math_clib_140f()
|
|
22
|
+
local engine_math_random = source_engine_api_math_random_141a()
|
|
23
|
+
local engine_array = source_engine_api_data_array_1425()
|
|
24
|
+
local engine_api_draw_text = source_engine_api_draw_text_1430()
|
|
25
|
+
local engine_api_draw_poly = source_engine_api_draw_poly_143b()
|
|
26
|
+
local engine_raw_memory = source_engine_api_raw_memory_1446()
|
|
27
|
+
local color = source_engine_api_system_color_1458()
|
|
28
|
+
local std = source_shared_var_object_std_1463()
|
|
29
|
+
local eval_code = source_shared_string_eval_code_1475()
|
|
30
30
|
local f=function(a,b)end
|
|
31
31
|
local engine={keyboard=f}
|
|
32
32
|
local application={
|
|
@@ -82,7 +82,10 @@ end
|
|
|
82
82
|
function native_callback_init(width, height, game_lua)
|
|
83
83
|
local ok, script=true, game_lua
|
|
84
84
|
if type(script) == 'string' then
|
|
85
|
-
ok, script=eval_code.script(script)
|
|
85
|
+
ok, script = eval_code.script(script)
|
|
86
|
+
end
|
|
87
|
+
if type(script) == 'function' then
|
|
88
|
+
ok, script = pcall(script)
|
|
86
89
|
end
|
|
87
90
|
if not script then
|
|
88
91
|
ok, script=pcall(loadfile, 'game.lua')
|
|
@@ -138,12 +141,12 @@ version=version
|
|
|
138
141
|
}
|
|
139
142
|
return P
|
|
140
143
|
end
|
|
141
|
-
|
|
142
|
-
return '0.2.
|
|
144
|
+
source_version_13dc = function()
|
|
145
|
+
return '0.2.5'
|
|
143
146
|
end
|
|
144
147
|
--
|
|
145
|
-
|
|
146
|
-
local util_decorator =
|
|
148
|
+
source_engine_api_system_app_13ee = function()
|
|
149
|
+
local util_decorator = source_shared_functional_decorator_17f6()
|
|
147
150
|
local function reset(std, engine)
|
|
148
151
|
if std.node then
|
|
149
152
|
std.bus.emit('exit')
|
|
@@ -183,7 +186,7 @@ install=install
|
|
|
183
186
|
return P
|
|
184
187
|
end
|
|
185
188
|
--
|
|
186
|
-
|
|
189
|
+
source_engine_api_system_key_13f9 = function()
|
|
187
190
|
local function real_key(std, engine, rkey, rvalue)
|
|
188
191
|
local value = rvalue == 1 or rvalue == true
|
|
189
192
|
local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
|
|
@@ -220,7 +223,7 @@ install = install
|
|
|
220
223
|
return P
|
|
221
224
|
end
|
|
222
225
|
--
|
|
223
|
-
|
|
226
|
+
source_engine_api_math_basic_1404 = function()
|
|
224
227
|
local function abs(value)
|
|
225
228
|
if value < 0 then
|
|
226
229
|
return -value
|
|
@@ -319,7 +322,7 @@ install = install
|
|
|
319
322
|
return P
|
|
320
323
|
end
|
|
321
324
|
--
|
|
322
|
-
|
|
325
|
+
source_engine_api_math_clib_140f = function()
|
|
323
326
|
local function install(std)
|
|
324
327
|
assert(math and (1/2 ~= 0))
|
|
325
328
|
std.math = std.math or {}
|
|
@@ -355,7 +358,7 @@ install = install
|
|
|
355
358
|
return P
|
|
356
359
|
end
|
|
357
360
|
--
|
|
358
|
-
|
|
361
|
+
source_engine_api_math_random_141a = function()
|
|
359
362
|
local function install(std)
|
|
360
363
|
assert(math and (1/2 ~= 0))
|
|
361
364
|
std.math = std.math or {}
|
|
@@ -372,8 +375,8 @@ install = install
|
|
|
372
375
|
return P
|
|
373
376
|
end
|
|
374
377
|
--
|
|
375
|
-
|
|
376
|
-
local util_decorator =
|
|
378
|
+
source_engine_api_data_array_1425 = function()
|
|
379
|
+
local util_decorator = source_shared_functional_decorator_17f6()
|
|
377
380
|
local function array_map(array, func)
|
|
378
381
|
local res = {}
|
|
379
382
|
local index = 1
|
|
@@ -534,8 +537,8 @@ install = install
|
|
|
534
537
|
return P
|
|
535
538
|
end
|
|
536
539
|
--
|
|
537
|
-
|
|
538
|
-
local util_decorator =
|
|
540
|
+
source_engine_api_draw_text_1430 = function()
|
|
541
|
+
local util_decorator = source_shared_functional_decorator_17f6()
|
|
539
542
|
local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
|
|
540
543
|
size = size or 2
|
|
541
544
|
local hem = engine.current.data.width / 80
|
|
@@ -564,7 +567,7 @@ install=install
|
|
|
564
567
|
return P
|
|
565
568
|
end
|
|
566
569
|
--
|
|
567
|
-
|
|
570
|
+
source_engine_api_draw_poly_143b = function()
|
|
568
571
|
local function decorator_poo(object, func)
|
|
569
572
|
if not object or not func then return func end
|
|
570
573
|
return function(a, b, c, d)
|
|
@@ -671,7 +674,7 @@ install=install
|
|
|
671
674
|
return P
|
|
672
675
|
end
|
|
673
676
|
--
|
|
674
|
-
|
|
677
|
+
source_engine_api_raw_memory_1446 = function()
|
|
675
678
|
local memory_dict_unload = {}
|
|
676
679
|
local memory_dict = {}
|
|
677
680
|
local memory_list = {}
|
|
@@ -726,7 +729,7 @@ install=install
|
|
|
726
729
|
return P
|
|
727
730
|
end
|
|
728
731
|
--
|
|
729
|
-
|
|
732
|
+
source_engine_api_system_color_1458 = function()
|
|
730
733
|
local function install(std)
|
|
731
734
|
std.color = std.color or {}
|
|
732
735
|
std.color.white = 0xFFFFFFFF
|
|
@@ -761,7 +764,7 @@ install = install
|
|
|
761
764
|
return P
|
|
762
765
|
end
|
|
763
766
|
--
|
|
764
|
-
|
|
767
|
+
source_shared_var_object_std_1463 = function()
|
|
765
768
|
local P = {
|
|
766
769
|
milis = 0,
|
|
767
770
|
delta = 0,
|
|
@@ -829,7 +832,7 @@ any=false
|
|
|
829
832
|
return P;
|
|
830
833
|
end
|
|
831
834
|
--
|
|
832
|
-
|
|
835
|
+
source_shared_string_eval_code_1475 = function()
|
|
833
836
|
local function script(src)
|
|
834
837
|
local loader = loadstring or load
|
|
835
838
|
if not loader then
|
|
@@ -850,7 +853,7 @@ script = script,
|
|
|
850
853
|
return P
|
|
851
854
|
end
|
|
852
855
|
--
|
|
853
|
-
|
|
856
|
+
source_shared_functional_decorator_17f6 = function()
|
|
854
857
|
local function decorator_prefix3(zig, zag, zom, func)
|
|
855
858
|
return function (a, b, c, d, e, f)
|
|
856
859
|
return func(zig, zag, zom, a, b, c, d, e, f)
|
|
@@ -908,4 +911,4 @@ prefix1_t = table_prefix1
|
|
|
908
911
|
return P
|
|
909
912
|
end
|
|
910
913
|
--
|
|
911
|
-
return
|
|
914
|
+
return main_13d3()
|