You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
806 B

local love = require "love"
local Chat = require "chat"
function Game()
return {
state = {
menu = false,
paused = false,
running = true,
ended = false,
},
level = 5,
changeGameState = function(self, state)
self.state.menu = state == "menu"
self.state.paused = state == "paused"
self.state.running = state == "running"
self.state.ended = state == "ended"
end,
startNewGame = function (self, player)
self:changeGameState("running")
chats = {}
for i = 1, 1 do
local chat_x = math.floor(math.random(love.graphics.getWidth()))
local chat_y = math.floor(math.random(love.graphics.getHeight()))
table.insert(chats, i, Chat(chat_x, chat_y, self.level))
end
end
}
end
return Game