working on game
This commit is contained in:
@@ -4,6 +4,52 @@ local playerList = {}
|
||||
local playerStaticList = {}
|
||||
local scoreboard = {}
|
||||
|
||||
multi, thread = require("multi"):init({priority=true})
|
||||
multi.setClock(require("socket").gettime) -- When on linux os.clock doesn't reture actual seconds the program has elapsed for
|
||||
GLOBAL, THREAD = require("multi.integration.loveManager"):init()
|
||||
|
||||
gui = require("gui")
|
||||
color = require("gui.core.color")
|
||||
theme = require("gui.core.theme")
|
||||
utils = require("utils")
|
||||
board = require("board")
|
||||
yaml = require("yaml")
|
||||
loader = require("loader")
|
||||
require("gui.addons")
|
||||
|
||||
scoreUpdater = gui:getProcessor():newProcessor("score-updater")
|
||||
scoreUpdater.Start()
|
||||
|
||||
gui.registerExtension({
|
||||
sayHello = function(self)
|
||||
print("Extended Hello World")
|
||||
end,
|
||||
sayBye = function(self)
|
||||
print("Extended Bye World")
|
||||
end,
|
||||
})
|
||||
|
||||
function love.load()
|
||||
gui:cacheImage({"assets/checked.png","assets/unchecked.png","assets/speaker.png"})
|
||||
gui:setAspectSize(1920, 1080)
|
||||
gui.aspect_ratio = true
|
||||
|
||||
local bg = gui:newFrame()
|
||||
bg:fullFrame()
|
||||
bg.color = color.new("#242f9b")
|
||||
|
||||
-- bg:setBlur(10)
|
||||
bg:OnUpdate(function(self, dt)
|
||||
if self.__blur then
|
||||
-- pulse the blur between 2 and 12
|
||||
local t = love.timer.getTime()
|
||||
self:setBlurRadius(7 + 5 * math.sin(t * 2))
|
||||
end
|
||||
end)
|
||||
|
||||
StartGame(bg)
|
||||
end
|
||||
|
||||
function GetActivePlayer()
|
||||
if not activePlayer then return end
|
||||
return activePlayer.link
|
||||
@@ -35,25 +81,6 @@ function love.filedropped(file)
|
||||
print("Load file? " .. file:getFilename())
|
||||
end
|
||||
|
||||
|
||||
function init()
|
||||
multi, thread = require("multi"):init({priority=true})
|
||||
multi.setClock(require("socket").gettime) -- When on linux os.clock doesn't reture actual seconds the program has elapsed for
|
||||
GLOBAL, THREAD = require("multi.integration.loveManager"):init()
|
||||
|
||||
gui = require("gui")
|
||||
color = require("gui.core.color")
|
||||
theme = require("gui.core.theme")
|
||||
utils = require("utils")
|
||||
board = require("board")
|
||||
yaml = require("yaml")
|
||||
loader = require("loader")
|
||||
require("gui.addons")
|
||||
|
||||
scoreUpdater = gui:getProcessor():newProcessor("score-updater")
|
||||
scoreUpdater.Start()
|
||||
end
|
||||
|
||||
function ScoreBoard(frame, x, y, w, h, sx, sy, sw, sh)
|
||||
-- Colors
|
||||
local C_BG_PANEL = color.new("#1a1a2e")
|
||||
@@ -313,56 +340,15 @@ function ScoreBoard(frame, x, y, w, h, sx, sy, sw, sh)
|
||||
return scoreboard
|
||||
end
|
||||
|
||||
function LandingPage(bg)
|
||||
|
||||
|
||||
-- local webp = require("webp")
|
||||
init()
|
||||
|
||||
local function noOf(sx,sy,sw,sh)
|
||||
return nil,nil,nil,nil,sx,sy,sw,sh
|
||||
end
|
||||
|
||||
function love.load()
|
||||
gui:cacheImage({"assets/checked.png","assets/unchecked.png"})
|
||||
gui:setAspectSize(1920, 1080)
|
||||
gui.aspect_ratio = true
|
||||
-- local ext = require("gui.addons.extensions")
|
||||
local bg = gui:newFrame()
|
||||
bg:fullFrame()
|
||||
bg.color = color.new("#242f9b")
|
||||
|
||||
-- pb = bg:newProgressBar(0, 0, 200, 40, 0, 0, 0, 0, 200, 0)
|
||||
|
||||
-- thread:newThread(function()
|
||||
-- for i=1,200 do
|
||||
-- thread.sleep(.01)
|
||||
-- pb:add(1)
|
||||
-- end
|
||||
-- end)
|
||||
|
||||
-- local group = bg:newRadioGroup({
|
||||
-- padding = 5,
|
||||
-- "Option A",
|
||||
-- "Option B",
|
||||
-- "Option C"
|
||||
-- },0,0,0,0, 80)
|
||||
|
||||
-- group.OnSelectionChanged(function(group, selection)
|
||||
-- print(selection:getLabel())
|
||||
-- end)
|
||||
|
||||
|
||||
|
||||
|
||||
function StartGame(bg)
|
||||
local qframe = bg:newFrame(0, 0, 0, 0, .2, .05, .75, .9)
|
||||
qframe.color = color.new("#060ee9")
|
||||
local scoreboard = ScoreBoard(bg, 0, 0, 0, 0, .015, .05, .170, .9)
|
||||
|
||||
board.buildBoard(qframe, "anime")
|
||||
|
||||
-- gui:newVideoPlayer("test.ogv",0,0,428,240)
|
||||
-- local img = webp.load("test.webp")
|
||||
-- gui:newImageLabel(img,0,0,735,1041)
|
||||
end
|
||||
|
||||
function love.update(dt)
|
||||
|
||||
Reference in New Issue
Block a user