Pos Lua >> Moon 2 1:[ local main = require("main") ] >> 2:[ main = require "main" ] 24 2:[ local bp = require("broadphase") ] >> 3:[ bp = require "broadphase" ] 50 3:[ local color = require("color") ] >> 4:[ color = require "color" ] 74 4:[ local ui = require("ui") ] >> 5:[ ui = require "ui" ] 93 5:[ local world = require("world") ] >> 7:[ world = require "world" --delete when done ] 154 7:[ Server = world.Server ] >> 8:[ import Server from world ] 178 9:[ World = world.World ] >> 9:[ import World from world ] 185 10:[ local mod = ... ] >> 10:[ mod = ... ] 208 11:[ local nwidth = 6 ] >> 13:[ nwidth = 6 ] 219 12:[ local section_width = 32 ] >> 14:[ section_width = 32 ] 238 13:[ local start_x = (-32) * (nwidth / 2) ] >> 15:[ start_x = (-32)*(nwidth/2) ] 265 14:[ mod.node = am.group() ] >> 16:[ mod.node = am.group! ] 286 15:[ mod.node:append(am.sprite("data/defeat_screen.png")) ] >> 17:[ mod.node\append(am.sprite("data/defeat_screen.png")) ] 339 16:[ local start_y = 0 ] >> 18:[ start_y = 0 ] 351 17:[ local padding = 32 ] >> 19:[ padding = 32 ] 364 18:[ local buttonspecs = { ] >> 20:[ buttonspecs = { ] 397 20:[ y_off = start_y, ] >> 22:[ y_off: start_y, ] 414 21:[ text = "Menu" ] >> 23:[ text: "Menu" ] 364 23:[ } ] >> 20:[ buttonspecs = { ] 430 24:[ mod.load = function() ] >> 28:[ mod.load = () -> ] 448 25:[ print("creating main menu") ] >> 29:[ print("creating main menu") ] 477 26:[ main.root("screen"):append(mod.node) ] >> 30:[ main.root("screen")\append(mod.node) ] 538 27:[ for name, button_tbl in pairs(buttonspecs) do ] >> 31:[ for name, button_tbl in pairs buttonspecs ] 559 28:[ local button_extra = ui.create_big_button(mod.node, 6, start_x, button_tbl.y_off) ] >> 32:[ button_extra = ui.create_big_button(mod.node,6,start_x,button_tbl.y_off) ] 634 29:[ button_extra.node:append(am.translate(start_x + ((nwidth * section_width) / 2), button_tbl.y_off - 32) ^ am.text(button_tbl.text, color.fg)) ] >> 33:[ button_extra.node\append(am.translate(start_x+((nwidth*section_width)/2),button_tbl.y_off - 32)^ am.text(button_tbl.text,color.fg)) ] 768 30:[ mod[name] = button_extra ] >> 34:[ mod[name] = button_extra ] 515 31:[ end ] >> 31:[ for name, button_tbl in pairs buttonspecs ] 794 32:[ local touch_indicator = am.group() ] >> 35:[ touch_indicator = am.group! ] 823 33:[ local touch_cursor = am.sprite("data/cursor.png", vec4(1, 1, 1, 1), "left", "top") ] >> 36:[ touch_cursor = am.sprite("data/cursor.png",vec4(1,1,1,1),"left","top") ] 895 34:[ local touch_loc = am.translate(0, 0) ^ touch_cursor ] >> 37:[ touch_loc = am.translate(0,0)^ touch_cursor ] 940 35:[ touch_indicator:append(touch_loc) ] >> 38:[ touch_indicator\append(touch_loc) ] 975 36:[ mod.node:append(am.translate(0, 100) ^ am.scale(3) ^ am.text("You failed to\nremain silly")) ] >> 39:[ mod.node\append(am.translate(0,100)^ am.scale(3)^ am.text("You failed to\nremain silly")) ] 1066 37:[ mod.node:action("click_interpreter", coroutine.create(function() ] >> 40:[ mod.node\action("click_interpreter",coroutine.create(()-> ] 1131 38:[ while true do ] >> 41:[ while true ] 1142 39:[ if #main.win:active_touches() > 0 then ] >> 42:[ if #main.win\active_touches! > 0 ] 1177 40:[ local touch = main.win:touch_position(1) ] >> 43:[ touch = main.win\touch_position(1) ] 1216 41:[ touch_cursor.color = vec4(1, 1, 1, 1) ] >> 44:[ touch_cursor.color = vec4(1,1,1,1) ] 1255 42:[ touch_loc.x = touch.x ] >> 45:[ touch_loc.x = touch.x ] 1281 43:[ touch_loc.y = touch.y ] >> 46:[ touch_loc.y = touch.y ] 1307 44:[ local col_but = bp.check(touch.x, touch.y + 64) ] >> 47:[ col_but = bp.check(touch.x, touch.y+64) ] 1353 45:[ if #col_but > 0 then ] >> 48:[ if #col_but > 0 ] 1372 46:[ touch_cursor.color = vec4(0.5, 0.5, 0.5, 0.5) ] >> 49:[ touch_cursor.color = vec4(0.5,0.5,0.5,0.5) ] 1351 47:[ end ] >> 48:[ if #col_but > 0 ] 1421 48:[ if #col_but > 0 then ] >> 50:[ if #col_but > 0 ] 1440 49:[ print("Collided with button:", col_but) ] >> 51:[ print("Collided with button:",col_but) ] 1484 50:[ print("mod.create prty was:", mod.create_party) ] >> 52:[ print("mod.create prty was:",mod.create_party) ] 1538 51:[ if col_but[1] == mod.menu then ] >> 53:[ if col_but[1] == mod.menu ] 1568 52:[ am.eval_js("location.reload()") ] >> 54:[ am.eval_js("location.reload()") ] 1536 53:[ end ] >> 53:[ if col_but[1] == mod.menu ] 1419 54:[ end ] >> 50:[ if #col_but > 0 ] 1612 56:[ touch_cursor.color = vec4(0, 0, 0, 0) ] >> 56:[ touch_cursor.color = vec4(0,0,0,0) ] 1650 58:[ coroutine.yield() ] >> 57:[ coroutine.yield! ] 1126 59:[ end ] >> 41:[ while true ] 1066 60:[ end)) ] >> 40:[ mod.node\action("click_interpreter",coroutine.create(()-> ] 1672 61:[ return mod.node:append(touch_indicator) ] >> 59:[ mod.node\append(touch_indicator) ] 430 62:[ end ] >> 28:[ mod.load = () -> ] 1706 63:[ mod.unload = function() ] >> 61:[ mod.unload = () -> ] 1726 64:[ main.root("screen"):remove(mod.node) ] >> 62:[ main.root("screen")\remove(mod.node) ] 1764 65:[ bp.remove(mod.create_party) ] >> 63:[ bp.remove(mod.create_party) ] 1793 66:[ return bp.remove(mod.join_party) ] >> 64:[ bp.remove(mod.join_party) ] 1706 67:[ end ] >> 61:[ mod.unload = () -> ] 1820 68:[ return mod ] >> 66:[ mod ]