@gamely/gly-engine-micro 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/dist/main.lua +51 -53
  2. package/package.json +9 -2
  3. package/README.md +0 -3
package/dist/main.lua CHANGED
@@ -1,28 +1,28 @@
1
1
  local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
2
- local source_version_563143e76540 = nil
3
- local source_engine_api_system_app_563143e39400 = nil
4
- local source_engine_api_system_key_563143e61c40 = nil
5
- local source_engine_api_system_math_563143e96320 = nil
6
- local source_engine_api_data_array_563143e916b0 = nil
7
- local source_engine_api_draw_text_563143e85750 = nil
8
- local source_engine_api_draw_poly_563143e75a00 = nil
9
- local source_engine_api_raw_memory_563143e9bc80 = nil
10
- local source_engine_api_system_color_563143e770e0 = nil
11
- local source_shared_var_object_std_563143ed4a30 = nil
12
- local source_shared_string_parse_lua_563143ed5430 = nil
13
- local source_shared_functional_decorator_563143e8a380 = nil
14
- local function main_563143e62ad0()
15
- local version = source_version_563143e76540()
16
- local engine_game = source_engine_api_system_app_563143e39400()
17
- local engine_key = source_engine_api_system_key_563143e61c40()
18
- local engine_math = source_engine_api_system_math_563143e96320()
19
- local engine_array = source_engine_api_data_array_563143e916b0()
20
- local engine_api_draw_text = source_engine_api_draw_text_563143e85750()
21
- local engine_api_draw_poly = source_engine_api_draw_poly_563143e75a00()
22
- local engine_raw_memory = source_engine_api_raw_memory_563143e9bc80()
23
- local color = source_engine_api_system_color_563143e770e0()
24
- local std = source_shared_var_object_std_563143ed4a30()
25
- local util_lua = source_shared_string_parse_lua_563143ed5430()
2
+ local source_version_608 = nil
3
+ local source_engine_api_system_app_61a = nil
4
+ local source_engine_api_system_key_625 = nil
5
+ local source_engine_api_system_math_630 = nil
6
+ local source_engine_api_data_array_63b = nil
7
+ local source_engine_api_draw_text_646 = nil
8
+ local source_engine_api_draw_poly_651 = nil
9
+ local source_engine_api_raw_memory_65c = nil
10
+ local source_engine_api_system_color_66e = nil
11
+ local source_shared_var_object_std_679 = nil
12
+ local source_shared_string_eval_code_68b = nil
13
+ local source_shared_functional_decorator_9db = nil
14
+ local function main_5ff()
15
+ local version = source_version_608()
16
+ local engine_game = source_engine_api_system_app_61a()
17
+ local engine_key = source_engine_api_system_key_625()
18
+ local engine_math = source_engine_api_system_math_630()
19
+ local engine_array = source_engine_api_data_array_63b()
20
+ local engine_api_draw_text = source_engine_api_draw_text_646()
21
+ local engine_api_draw_poly = source_engine_api_draw_poly_651()
22
+ local engine_raw_memory = source_engine_api_raw_memory_65c()
23
+ local color = source_engine_api_system_color_66e()
24
+ local std = source_shared_var_object_std_679()
25
+ local eval_code = source_shared_string_eval_code_68b()
26
26
  local f=function(a,b)end
27
27
  local engine={keyboard=f}
28
28
  local application={
@@ -77,7 +77,7 @@ end
77
77
  function native_callback_init(width, height, game_lua)
78
78
  local ok, script=true, game_lua
79
79
  if type(script) == 'string' then
80
- ok, script=util_lua.eval(script)
80
+ ok, script=eval_code.script(script)
81
81
  end
82
82
  if not script then
83
83
  ok, script=pcall(loadfile, 'game.lua')
@@ -94,7 +94,6 @@ std.draw.color=native_draw_color
94
94
  std.draw.font=native_draw_font
95
95
  std.draw.rect=native_draw_rect
96
96
  std.draw.line=native_draw_line
97
- std.draw.image=native_image_draw
98
97
  std.image.load=native_image_load
99
98
  std.image.draw=native_image_draw
100
99
  std.text.print=native_text_print
@@ -131,12 +130,12 @@ version=version
131
130
  }
132
131
  return P
133
132
  end
134
- source_version_563143e76540 = function()
135
- return '0.1.1'
133
+ source_version_608 = function()
134
+ return '0.1.3'
136
135
  end
137
136
  --
138
- source_engine_api_system_app_563143e39400 = function()
139
- local util_decorator = source_shared_functional_decorator_563143e8a380()
137
+ source_engine_api_system_app_61a = function()
138
+ local util_decorator = source_shared_functional_decorator_9db()
140
139
  local function reset(std, engine)
141
140
  if std.node then
142
141
  std.bus.emit('exit')
@@ -176,7 +175,7 @@ install=install
176
175
  return P
177
176
  end
178
177
  --
179
- source_engine_api_system_key_563143e61c40 = function()
178
+ source_engine_api_system_key_625 = function()
180
179
  local function real_key(std, engine, rkey, rvalue)
181
180
  local value = rvalue == 1 or rvalue == true
182
181
  local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
@@ -200,23 +199,20 @@ end
200
199
  local function real_keyup(std, engine, key)
201
200
  real_key(std, engine, key, 0)
202
201
  end
203
- local function event_bus(std, engine)
204
- std.bus.listen_std_engine('rkey', real_key)
205
- std.bus.listen_std_engine('rkey1', real_keydown)
206
- std.bus.listen_std_engine('rkey0', real_keyup)
207
- end
208
202
  local function install(std, engine, key_bindings)
209
203
  engine.key_bindings = key_bindings or {}
210
204
  engine.keyboard = real_key
205
+ std.bus.listen_std_engine('rkey', real_key)
206
+ std.bus.listen_std_engine('rkey1', real_keydown)
207
+ std.bus.listen_std_engine('rkey0', real_keyup)
211
208
  end
212
209
  local P = {
213
- event_bus = event_bus,
214
210
  install = install
215
211
  }
216
212
  return P
217
213
  end
218
214
  --
219
- source_engine_api_system_math_563143e96320 = function()
215
+ source_engine_api_system_math_630 = function()
220
216
  local function abs(value)
221
217
  if value < 0 then
222
218
  return -value
@@ -391,8 +387,8 @@ install = install_clib_random
391
387
  return P;
392
388
  end
393
389
  --
394
- source_engine_api_data_array_563143e916b0 = function()
395
- local util_decorator = source_shared_functional_decorator_563143e8a380()
390
+ source_engine_api_data_array_63b = function()
391
+ local util_decorator = source_shared_functional_decorator_9db()
396
392
  local function array_map(array, func)
397
393
  local res = {}
398
394
  local index = 1
@@ -553,8 +549,8 @@ install = install
553
549
  return P
554
550
  end
555
551
  --
556
- source_engine_api_draw_text_563143e85750 = function()
557
- local util_decorator = source_shared_functional_decorator_563143e8a380()
552
+ source_engine_api_draw_text_646 = function()
553
+ local util_decorator = source_shared_functional_decorator_9db()
558
554
  local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
559
555
  size = size or 2
560
556
  local hem = engine.current.data.width / 80
@@ -581,7 +577,7 @@ install=install
581
577
  return P
582
578
  end
583
579
  --
584
- source_engine_api_draw_poly_563143e75a00 = function()
580
+ source_engine_api_draw_poly_651 = function()
585
581
  local function decorator_poo(object, func)
586
582
  if not object or not func then return func end
587
583
  return function(a, b, c, d)
@@ -688,7 +684,7 @@ install=install
688
684
  return P
689
685
  end
690
686
  --
691
- source_engine_api_raw_memory_563143e9bc80 = function()
687
+ source_engine_api_raw_memory_65c = function()
692
688
  local memory_dict_unload = {}
693
689
  local memory_dict = {}
694
690
  local memory_list = {}
@@ -743,7 +739,7 @@ install=install
743
739
  return P
744
740
  end
745
741
  --
746
- source_engine_api_system_color_563143e770e0 = function()
742
+ source_engine_api_system_color_66e = function()
747
743
  local function install(std)
748
744
  std.color = std.color or {}
749
745
  std.color.white = 0xFFFFFFFF
@@ -778,12 +774,14 @@ install = install
778
774
  return P
779
775
  end
780
776
  --
781
- source_shared_var_object_std_563143ed4a30 = function()
777
+ source_shared_var_object_std_679 = function()
782
778
  local P = {
783
779
  milis = 0,
784
780
  delta = 0,
785
781
  math = {
786
782
  },
783
+ media = {
784
+ },
787
785
  draw = {
788
786
  image = function() end,
789
787
  clear = function () end,
@@ -844,28 +842,28 @@ any=false
844
842
  return P;
845
843
  end
846
844
  --
847
- source_shared_string_parse_lua_563143ed5430 = function()
848
- local function eval(script)
845
+ source_shared_string_eval_code_68b = function()
846
+ local function script(src)
849
847
  local loader = loadstring or load
850
848
  if not loader then
851
849
  error('eval not allowed')
852
850
  end
853
- local ok, chunk = pcall(loader, script)
851
+ local ok, chunk = pcall(loader, src)
854
852
  if not ok then
855
853
  return false, chunk
856
854
  end
857
855
  if type(chunk) ~= 'function' then
858
- return false, 'failed to eval'
856
+ return false, 'failed to eval code'
859
857
  end
860
858
  return pcall(chunk)
861
859
  end
862
860
  local P = {
863
- eval = eval,
861
+ script = script,
864
862
  }
865
863
  return P
866
864
  end
867
865
  --
868
- source_shared_functional_decorator_563143e8a380 = function()
866
+ source_shared_functional_decorator_9db = function()
869
867
  local function decorator_prefix3(zig, zag, zom, func)
870
868
  return function (a, b, c, d, e, f)
871
869
  return func(zig, zag, zom, a, b, c, d, e, f)
@@ -923,4 +921,4 @@ prefix1_t = table_prefix1
923
921
  return P
924
922
  end
925
923
  --
926
- return main_563143e62ad0()
924
+ return main_5ff()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamely/gly-engine-micro",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "author": "RodrigoDornelles",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://docs.gamely.com.br",
@@ -15,5 +15,12 @@
15
15
  "game engine",
16
16
  "game",
17
17
  "engine"
18
- ]
18
+ ],
19
+ "scripts": {
20
+ "step1": "cd ../.. && rm -Rf dist && mkdir -p ./dist/types",
21
+ "step2": "cd ../.. && node cli.js build --core micro --bundler --outdir dist/dist",
22
+ "step3": "cd ../.. && node cli.js meta source/cli/main.lua --infile npm/gly-engine-micro/package.json --outfile dist/package.json",
23
+ "step4": "cd ../.. && echo \"declare module '@gamely/gly-engine-micro' {\n const content: string;\n export default content;\n}\" > dist/types/main.d.ts",
24
+ "build": "npm run step1 && npm run step2 && npm run step3 && npm run step4"
25
+ }
19
26
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- <div align="center">
2
- <h1>:mechanical_arm:<br>GLY Engine<br><sup><sub>powered by <a href="https://gamely.com.br" target="_blank">gamely.com.br</a></sub></sup></h1>
3
- </div>