diff options
Diffstat (limited to 'bin/client/data/init.lua')
| -rw-r--r-- | bin/client/data/init.lua | 68 |
1 files changed, 15 insertions, 53 deletions
diff --git a/bin/client/data/init.lua b/bin/client/data/init.lua index 8829e01..e893fa4 100644 --- a/bin/client/data/init.lua +++ b/bin/client/data/init.lua @@ -1,57 +1,19 @@ +print([[ +Welcome to Brok[en]gine! -dofile("../data/mahjong.lua") +This file is located at bin/client/data/init.lua, +it is the first file run after brokengine starts. +Modify it to make your game. -do return end -print("Phys was:",phys) -for k,v in pairs(phys) do - print(k,":",v) -end -local cam = scene.newcamera() ---local cam_m = getmetatable(cam) ---print("cam's meta table is ",cam_m) +Before brokengine starts, there's another file +located at bin/client/data/deviceinit.lua, which +is a settings file for the window, and does not +have access to a lot of the functions that +brokengine provides. If your game is crashing +right away, check for errors in that file. ---for k,v in pairs(cam_m["__index"]) do --- print(k,":",v) ---end +For more information about the functions +avaliable in brokengine, run `ldoc .`, and look +at index.html in the doc/ folder. +]]) ---print("attempting to create the first physbox") -local cambox = phys.newcphysbox({1,1,1},{0,0,0},1) ---print("function is",phys.newphysbox); ---print("attempting to create the second physbox") -local floor = phys.newcphysbox({10,1,10},{0,-10,0},0) -local floor_light = scene.newlight(1000,{0,-5,0}) ---print("created cam box") -print("cambox_m is:") -local cambox_m = getmetatable(cambox); -for k,v in pairs(cambox_m["__index"]) do - print(k,":",v) -end -print("cambox is:") -for k,v in pairs(cambox) do - print(k,":",v) -end -floor:setcpos({0,5,0}) - -print("floor is:") -local floor_m = getmetatable(floor); -for k,v in pairs(floor_m["__index"]) do - print(k,":",v) -end ---print("gui is:") ---for k,v in pairs(gui) do - --print(k,":",v) ---end ---local checkbox = gui.newcheckbox({0,0},{100,100},0,"test"); ---floor_light:getpos() ---GAME.tick = function() - --print("In game tick") - --cam:setpos(cambox:getpos()) ---end -GAME.onKeyDown = function(key,down,ctrl,shft) - if(down and key == 65) then -- a - print("Setting box's position") - cambox:setcpos({0,5,0}) - print("After setpos was called") - end - print("Got key input:",key,down,ctrl,shft) -end |
