83 lines
950 B
Lua
83 lines
950 B
Lua
local lapis = require("lapis")
|
|
local app = lapis.Application()
|
|
local say = require('lua_scripts/main')
|
|
local mapFunc = require('lua_scripts/map')
|
|
local player = require('player')
|
|
|
|
local db = require("lapis.db")
|
|
local Model = require("lapis.db.model").Model
|
|
|
|
local map = Model:extend('map')
|
|
|
|
app:enable("etlua")
|
|
app.layout = require "views.layout"
|
|
|
|
app:post("/clickme", function(self)
|
|
self.plane = "P-38L"
|
|
<<<<<<< HEAD
|
|
mapFunc:populate(map)
|
|
=======
|
|
mapFunc.populate(self, map)
|
|
>>>>>>> refs/remotes/origin/master
|
|
return {self.plane, layout = false}
|
|
end)
|
|
|
|
app:get("/", function(self)
|
|
self.text = say.hello()
|
|
return {render = "index",
|
|
|
|
}
|
|
end)
|
|
|
|
app:match("/map/render", function(self)
|
|
self.tiles = {}
|
|
for h=1,10 do
|
|
self.tiles[h] = {}
|
|
for i=1,10 do
|
|
self.tiles[h][i] = map:find({x = h, y = i})
|
|
end
|
|
end
|
|
return {render = "map", layout = false}
|
|
end)
|
|
|
|
return app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|