From 458d00435809ea4569b45d1796673086181cafe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Oliveira=20Couto?= Date: Fri, 8 Feb 2019 02:08:28 -0200 Subject: [PATCH] Added Final Score to appear Fixed some errors and bugs Added all map colider to a new file, to cleanup the code Added LetterboadTimer to show the remaining time --- .../sprites/DeficientElevator/button.lua | 55 ++++++++ .../sprites/DeficientElevator/button.png | Bin 0 -> 17036 bytes .../DeficientElevator/control_panel.png | Bin 0 -> 12145 bytes src/assets/sprites/misc/letterboard_timer.png | Bin 0 -> 5158 bytes src/controllers/GameDirector.lua | 6 +- src/controllers/gamemodes/BusStop/init.lua | 10 +- .../gamemodes/DeficientElevator/init.lua | 51 ++++++- .../gamemodes/DriveTheBus/init.lua | 131 ++++-------------- .../DriveTheBus/models/business/MapData.lua | 113 +++++++++++++++ .../DriveTheBus/models/entities/Bus.lua | 4 + .../gamemodes/HowMuchMoneyBack/init.lua | 10 +- src/models/LetterboardTimer.lua | 12 ++ src/scenes/InGameScene.lua | 13 +- src/scenes/subscenes/FinalScore.lua | 34 +++++ 14 files changed, 315 insertions(+), 124 deletions(-) create mode 100644 src/assets/sprites/DeficientElevator/button.lua create mode 100644 src/assets/sprites/DeficientElevator/button.png create mode 100644 src/assets/sprites/DeficientElevator/control_panel.png create mode 100644 src/assets/sprites/misc/letterboard_timer.png create mode 100644 src/controllers/gamemodes/DriveTheBus/models/business/MapData.lua create mode 100644 src/models/LetterboardTimer.lua create mode 100644 src/scenes/subscenes/FinalScore.lua diff --git a/src/assets/sprites/DeficientElevator/button.lua b/src/assets/sprites/DeficientElevator/button.lua new file mode 100644 index 0000000..cfc6a98 --- /dev/null +++ b/src/assets/sprites/DeficientElevator/button.lua @@ -0,0 +1,55 @@ +return { + frames = { + pressed = { + frame = { + h = 400, + w = 240, + x = 243, + y = 1, + }, + sourceSize = { + h = 400, + w = 240, + }, + spriteSourceSize = { + h = 400, + w = 240, + x = 0, + y = 0, + }, + trimmed = false, + rotated = false, + }, + normal = { + frame = { + h = 400, + w = 240, + x = 1, + y = 1, + }, + sourceSize = { + h = 400, + w = 240, + }, + spriteSourceSize = { + h = 400, + w = 240, + x = 0, + y = 0, + }, + trimmed = false, + rotated = false, + }, + }, + meta = { + format = "RGBA8888", + size = { + h = 402, + w = 484, + }, + scale = "1", + app = "http://www.codeandweb.com/texturepacker", + image = "button.png", + version = "1.0", + }, +} diff --git a/src/assets/sprites/DeficientElevator/button.png b/src/assets/sprites/DeficientElevator/button.png new file mode 100644 index 0000000000000000000000000000000000000000..c8cfaec8ab85ffda9925dfdd2196a1a112b12827 GIT binary patch literal 17036 zcmeIaWmME{)HkZ4A|N6l(x5}PfOIJgAT2Q4M>(SM0riu?cyuu1HKsLwM!N6=J1lP^~LhuFivh(YJ1b zPXvCKvRt|H;EEFTsg7sz`jm&K(TEqD|2QJXt!^xT^k#kc%bW7dETQ-12g#Huv@@8s zt}ixF`t@V4yq}hMa_^l^c@4LCDKs?Hp);DrP{@(Ch@9=fX~d4L)+?FKlAg_ZY!qR+ zzquJ%eYiT!k&9<^<;*{INt*TPAmpFZ9jPU$O)={sR>=P^zYI*F^D>N5-g_jn(g!6> ziU{AcjwmKZ%BUVlsSF<<9}IeNbhM2LV1_VGplpYN>`%DJHE*@?4~R2C8UxOb;6Wo; zx5dRpE1&vlV=phS5hT(80$E2QQ?+3G1f*X2(1sl3s)i2C&k*X*1PS1S%;>`Q#b7W- zO_-Z3?00EhUEO;~si266M^Nyq#f62eY3DAUc>8hG%1`%z1}H5l=8FwIc~liRj_aO0 zhwi-vI1C0Jr;(SP{fU{`LqZ}V&F9bmdH3$x{L&JWj0__Z87Os9w6L^9+h}^Zi$uyo zO(>(B!aDLtu=Scyfk;M~3q|*U3n=YXaOD(n_#8AbgMGw~X>kcUKNA`j7V$FTUT%r! z&hBnR02M0W5rfvf)}?*#BC@C+_WY*K7NaRI+Zf?gd6H@(> zE2&($<(CIDAsshhu!(!})zaX_YNt&3GRlMDsw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n|q-FD8q;en{WI1#t@L(15}Gv|ztwNkb&u z*G3r~|LqR04@N`49&g)ACudX7|5|z3KA(p7PT4HF`@%Ie+SwK!5~=@gxOd=0vBc{ zJ?;Z3KmtYjCMH-Fbn|2e`)b>vJ>{VO4hssf;IB+v OQIc1O7RtVS_x}L(mn<0o literal 0 HcmV?d00001 diff --git a/src/assets/sprites/DeficientElevator/control_panel.png b/src/assets/sprites/DeficientElevator/control_panel.png new file mode 100644 index 0000000000000000000000000000000000000000..ffdc4da9319d44f8edbc9ec245896c4070903f9f GIT binary patch literal 12145 zcmXY1Wmp?s)9#bv6bMf7;O-8E5~Mf<3KWL|1&X^vDZz?`;$GafKyU&@g1cLAr^Q?J zOW*7Jk!*HzcIM2SnS1UzyHRg7-r(U-;yioy3{P1}UK@4%{p{I)P%I48FX-G!0P2A4 zqGaIy>=_T^zt4X@MKWH`p3y&3mY03!V|tS9Un#t5GCzMDICjxK-`P-81cRO6HWZ~y z=^2H}^4Hnoq(rut29xwDh6>;3u~1k}kT98k36Z~lu0W*y`u@3P9R{y_Srj=~mjo>t z9JaB8<~>Eri7_M^vvS&R@M z7z>2@IwdF%_-~QdIe0nxw_qppjuv~ovM)UuR~wCe(nVpv2%G7U-cWK<^n1%kfs{6F zY1W+|+R`-kTy%hw<+|@dyZzrVV`aY3RV;)M@Ez}uHUG3gj zQn}He`iCgg258}EAbG!?gV{BeeB+XARD8peB6dn{zT*mHM8Ya+V@dA=#VU<7R6EEngN- zZ!PV&-(OhxaZZ=IPImj1)&!KQ`^N1wRbO`TOp?oG zKdz{DJ?B#0sePcl65*%`2oYxc^UW!Z=$bCB#8d4ga8U>??6YE!nqtR`2w-P#`mT=$ zhkc(AHPE?j3_PF8}ZoUuvP?4`T2v!k5a8!EChEj15$4`Zv-At9zWByaw5FCs-vfYfeJSxGl}gISq8K2J3#@)ST4 zkYBayV?UeK2a(1HsZF)Odd$D{?&g0=^lFNi3%D06 z8n)z&t|*E*UO^6Bx~u;Hn>P7r;4>!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ntrbDStv4u~|R zVm|V<&isst)b2KW*pBzVTv>HcmP(5g$V8>5G;_ z6LX^kM4GEzNU_Bo&2l1oN*ukpqnwgI zaHx~?lsJ^DL)19A7mDRXZ0#~fFO;DHG1|&^e}DfC-TY5pzK(06l^vn6M~NvhH(>}i zotU$DB*{0E^blVJD8|82g2R}=kRrIjA zz>v*cc2gYdbBQB8%)MKjh@Kj!<_|9%-_D*B(PKH*pP_4rQ3HZRNUGe!>GZ?h;vc@# ziHO?Bn>GR}i7tsrn``hKt4BM0 zIgb3X9J@#@aUy!w$)WBoj`Y}e-grRpZCIREca* z02VJ@UcwEJu31Pc1!M^S}jl5bKNQ*!BTKINqNeC!)u5a`h_Nk}SiCV&xHHF)Da4 zo-uX$V3O0^z(K%}wh9zjRF)yJlyp<0)Hnb=xnHqa4%hxmf;mnpp~jm_{;a}Ly;OJa zkJS_9$PDN`XJz$4u}7~a_}rcP7_$5#mo5_2>F6}Iz8K|5RO zSS1eS;^Y!NKIsfD3W{HJ^QjXHkHer~G357+TF!PJQ@Kt>FLgArrGgiT}Zy)F|FfM2Zh zC-phLt($+C!WF8qcxCYY#e8M`g3nRoemq|XEgInl z_BtOma!B;OnxRvxp?tt+6qGt&MvrvlV0G%e#*bo5T@jSp#`;mJ=O+BbhQ3mMc+Zq? z1({taa7U7lB>6;=w7gWF>E?g9 zfNQ=Ng^=2=2FHX6Lvc7Vx%)c@GlIM#$(xhh+s%J`^u{DFPeMdd8~Yax_^vtQAomgK zse2q%Z_302I=AgoI@dL#&)9PhuSYg>pUIWm^PK)6usSVDw){PvTh#ojmF*OE-pRt0 zicx~CT1GggS9d0Pba739ApAQcuG!k<$oH-}@>N+L5S^dz207*qoM6N<$f+OlTpa1{> literal 0 HcmV?d00001 diff --git a/src/controllers/GameDirector.lua b/src/controllers/GameDirector.lua index 6e3e462..00efaad 100644 --- a/src/controllers/GameDirector.lua +++ b/src/controllers/GameDirector.lua @@ -3,6 +3,7 @@ local CameraController = require "controllers.CameraController" local DataPersistence = require "controllers.DataPersistence" -- Models +local LetterboardTimer = require "models.LetterboardTimer" local World = require "models.business.World" local Wall = require "models.business.Wall" @@ -29,11 +30,12 @@ function GameDirector:new() libraries = { Sanghost = Sanghost, ButtonManager = ButtonManager, Button = Button, Pixelurite = Pixelurite, CameraController = CameraController, DataPersistence = DataPersistence, - Wall = Wall + Wall = Wall, LetterboardTimer = LetterboardTimer }, fonts = { + default = love.graphics.getFont(), ledDigits = love.graphics.newFont("assets/fonts/DS-DIGII.ttf", 36), - default = love.graphics.getFont() + letterboard = love.graphics.newFont("assets/fonts/advanced_led_board-7.ttf", 36) } } diff --git a/src/controllers/gamemodes/BusStop/init.lua b/src/controllers/gamemodes/BusStop/init.lua index ec85906..5dc0e82 100644 --- a/src/controllers/gamemodes/BusStop/init.lua +++ b/src/controllers/gamemodes/BusStop/init.lua @@ -37,7 +37,7 @@ end function GameController:reset() self.x = 900; self.currentStop = 1; self.requestedStop = love.math.random(5) - self.elapsedTime = 0; self.tries = 0; self.score = 0 + self.elapsedTime = 0; self.tries = 0; self.score = 0; self.totalTime = 40 end function GameController:setGamemodesController(gamemodeController) @@ -45,6 +45,7 @@ function GameController:setGamemodesController(gamemodeController) end function GameController:finishGame() + self.gamemodeController:increaseScore(self.score) self.gamemodeController:exitGamemode() self:reset() end @@ -68,12 +69,6 @@ end function GameController:keyreleased(key, scancode) end -function GameController:mousemoved(x, y, dx, dy, istouch) - self.tx = x - self.ty = y - print(x, y) -end - function GameController:resetStop() self.x = 900 if self.currentStop >= #self.busStops then self.currentStop = 1 else self.currentStop = self.currentStop + 1 end @@ -105,6 +100,7 @@ function GameController:draw() love.graphics.setFont(gameDirector:getFonts().default) love.graphics.draw(self.busStops[self.requestedStop], -70, 240, -0.65, 0.5, 0.5) love.graphics.draw(self.background, 0, 0, 0) + gameDirector:getLibrary("LetterboardTimer"):draw(self.totalTime) end return GameController diff --git a/src/controllers/gamemodes/DeficientElevator/init.lua b/src/controllers/gamemodes/DeficientElevator/init.lua index f0a5d46..9cc9f0c 100644 --- a/src/controllers/gamemodes/DeficientElevator/init.lua +++ b/src/controllers/gamemodes/DeficientElevator/init.lua @@ -16,7 +16,9 @@ function GameController:new(world) background = love.graphics.newImage("assets/sprites/DeficientElevator/bus_background.png"), elevator = love.graphics.newImage("assets/sprites/DeficientElevator/elevator.png"), wheelchair = gameDirector:getLibrary("Pixelurite").configureSpriteSheet("wheelchair", "assets/sprites/DeficientElevator/", true, nil, 1, 1, true), - elapsedTime = 0, + controlPanel = love.graphics.newImage("assets/sprites/DeficientElevator/control_panel.png"), + panelButton = {}, buttonSprite = gameDirector:getLibrary("Pixelurite").getSpritesheet():new("button", "assets/sprites/DeficientElevator/"), + elapsedTime = 0, totalTime = 20, score = 0, currentState = 0, driverSprite = gameDirector:getLibrary("Pixelurite").configureSpriteSheet("driver", "assets/sprites/DeficientElevator/", true, nil, 1, 1, true) } @@ -24,6 +26,20 @@ function GameController:new(world) world:changeCallbacks("DeficientElevator") this = setmetatable(this, GameController) + + local spriteQuads = this.buttonSprite:getQuads() + local buttonQuads = { + normal = spriteQuads["normal"], hover = spriteQuads["normal"], + pressed = spriteQuads["pressed"], disabled = spriteQuads["pressed"] + } + local button = gameDirector:getLibrary("Button"):new(nil, 516, 94, 400, 240, buttonQuads, this.buttonSprite:getAtlas()) + button:setCallback(function(self) this:elevatorMovement("up") end) + table.insert(this.panelButton, button) + button = gameDirector:getLibrary("Button"):new(nil, 516, 273, 400, 240, buttonQuads, this.buttonSprite:getAtlas()) + button:setCallback(function(self) this:elevatorMovement("down") end) + button:setScale(1, -1) + button:setOffset(0, 240) + table.insert(this.panelButton, button) return this end @@ -35,14 +51,14 @@ function GameController:getInstance(world) end function GameController:reset() - self.currentState = 0; self.score = 0; self.elevatorPosition = 0; self.elapsedTime = 0 + self.currentState = 0; self.score = 0; self.elevatorPosition = 0; self.elapsedTime = 0; self.totalTime = 20 end function GameController:setGamemodesController(gamemodeController) self.gamemodeController = gamemodeController end -function GameController:keypressed(key, scancode, isrepeat) +function GameController:elevatorMovement(key) if key == "up" then if self.elevatorPosition > -38 then self.elevatorPosition = self.elevatorPosition - 4 @@ -58,14 +74,38 @@ function GameController:keypressed(key, scancode, isrepeat) end end +function GameController:keypressed(key, scancode, isrepeat) + self:elevatorMovement(key) +end + function GameController:keyreleased(key, scancode) end +function GameController:mousemoved(x, y, dx, dy, istouch) + for _, button in pairs(self.panelButton) do + button:mousemoved(x, y, dx, dy, istouch) + end +end + +function GameController:mousepressed(x, y, button, istouch) + for _, button in pairs(self.panelButton) do + button:mousepressed(x, y, button, istouch) + end +end + +function GameController:mousereleased(x, y, button, istouch) + for _, button in pairs(self.panelButton) do + button:mousereleased(x, y, button, istouch) + end +end + function GameController:update(dt) self.elapsedTime = self.elapsedTime + dt + self.totalTime = self.totalTime - dt self.driverSprite:update(dt) self.wheelchair:update(dt) - if self.elapsedTime >= 10 then + if self.totalTime <= 0 then + self.gamemodeController:increaseScore(self.score) self.gamemodeController:exitGamemode() self:reset() end @@ -77,7 +117,10 @@ function GameController:draw() if self.currentState == 1 then self.wheelchair:draw(158, 430 + self.elevatorPosition) end + love.graphics.draw(self.controlPanel, 517, 113, 0, 1, 1) + for _, button in pairs(self.panelButton) do button:draw() end self.driverSprite:draw(45, 467) + gameDirector:getLibrary("LetterboardTimer"):draw(self.totalTime) end return GameController diff --git a/src/controllers/gamemodes/DriveTheBus/init.lua b/src/controllers/gamemodes/DriveTheBus/init.lua index 9cca992..90e8fe0 100644 --- a/src/controllers/gamemodes/DriveTheBus/init.lua +++ b/src/controllers/gamemodes/DriveTheBus/init.lua @@ -9,9 +9,13 @@ GameController.__index = GameController local function beginContact(a, b, col) if a:getUserData() == "Passenger" or b:getUserData() == "Passenger" then + if totalPassengers == 1 then + instance.score = instance.score + instance.totalTime + end instance:removePassenger(a:getUserData() == "Passenger" and a or b) instance.score = instance.score + 1 instance.gamemodeController:changeGamemode() + instance.busHead:stop() instance.growBus = true end end @@ -27,8 +31,9 @@ function GameController:new(world) cameraController = nil, passengers = {}, passengerSprite = love.graphics.newImage("assets/sprites/DriveTheBus/bus_stop.png"), mapSize = {w = 2400, h = 1800}, - elapsedTime = 0, - score = 0, + elapsedTime = 0, totalTime = 110, + score = 0, totalPassengers = 0, + mapData = require(string.format("%smodels.business.MapData", currentPath)), growBus = false, walls = {}, invisibleWall = {}, gamemodeController = nil, @@ -38,107 +43,8 @@ function GameController:new(world) world:addCallback("DriveTheBus", beginContact, "beginContact") world:changeCallbacks("DriveTheBus") - local Wall = gameDirector:getLibrary("Wall") - --[[ Adding walls to game --]] - table.insert(this.walls, Wall:new(world.world, 1200, 0, {w = 2400, h = 10})) - table.insert(this.walls, Wall:new(world.world, 1200, 1800, {w = 2400, h = 10})) - table.insert(this.walls, Wall:new(world.world, 0, 900, {w = 10, h = 1800})) - table.insert(this.walls, Wall:new(world.world, 2400, 900, {w = 10, h = 1800})) - - --[[ Adding invisible wall --]] - table.insert(this.invisibleWall, Wall:new(world.world, 80, 600, {w = 10, h = 900})) - table.insert(this.invisibleWall, Wall:new(world.world, 200, 600, {w = 10, h = 900})) - table.insert(this.invisibleWall, Wall:new(world.world, 110, 80, {w = 10, h = 130}, nil, 0.653599)) - table.insert(this.invisibleWall, Wall:new(world.world, 720, 40, {w = 1100, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 720, 150, {w = 1000, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1320, 90, {w = 10, h = 150}, nil, -0.553599)) - table.insert(this.invisibleWall, Wall:new(world.world, 1300, 320, {w = 1300, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1300, 430, {w = 1300, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1650, 180, {w = 600, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1650, 290, {w = 600, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1150, 620, {w = 520, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1150, 730, {w = 480, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 400, 1330, {w = 520, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 450, 1450, {w = 480, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 580, 1480, {w = 740, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 580, 1580, {w = 740, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1730, 1630, {w = 740, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1730, 1730, {w = 740, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1580, 1340, {w = 450, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1580, 1440, {w = 450, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 520, 650, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 620, 650, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 810, 950, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 910, 950, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 950, 1390, {w = 10, h = 170})) - table.insert(this.invisibleWall, Wall:new(world.world, 1050, 1390, {w = 10, h = 170})) - table.insert(this.invisibleWall, Wall:new(world.world, 1240, 1020, {w = 10, h = 280})) - table.insert(this.invisibleWall, Wall:new(world.world, 1340, 1020, {w = 10, h = 280})) - table.insert(this.invisibleWall, Wall:new(world.world, 1240, 1540, {w = 10, h = 200})) - table.insert(this.invisibleWall, Wall:new(world.world, 1340, 1540, {w = 10, h = 180})) - table.insert(this.invisibleWall, Wall:new(world.world, 1530, 800, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 1630, 800, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 1670, 800, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 1770, 800, {w = 10, h = 440})) - table.insert(this.invisibleWall, Wall:new(world.world, 2240, 870, {w = 10, h = 310})) - table.insert(this.invisibleWall, Wall:new(world.world, 2350, 870, {w = 10, h = 310})) - table.insert(this.invisibleWall, Wall:new(world.world, 2100, 1450, {w = 10, h = 310})) - table.insert(this.invisibleWall, Wall:new(world.world, 2210, 1450, {w = 10, h = 310})) - table.insert(this.invisibleWall, Wall:new(world.world, 1820, 1250, {w = 10, h = 150})) - table.insert(this.invisibleWall, Wall:new(world.world, 1920, 1250, {w = 10, h = 150})) - table.insert(this.invisibleWall, Wall:new(world.world, 1960, 510, {w = 10, h = 150})) - table.insert(this.invisibleWall, Wall:new(world.world, 2070, 510, {w = 10, h = 150})) - table.insert(this.invisibleWall, Wall:new(world.world, 2210, 505, {w = 10, h = 150})) - table.insert(this.invisibleWall, Wall:new(world.world, 2110, 515, {w = 10, h = 150})) - table.insert(this.invisibleWall, Wall:new(world.world, 1590, 1160, {w = 180, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 420, 895, {w = 180, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 435, 1045, {w = 180, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 2080, 1045, {w = 320, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 345, 1155, {w = 320, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 1725, 470, {w = 320, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 425, 1015, {w = 160, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 2165, 1155, {w = 160, h = 10})) - table.insert(this.invisibleWall, Wall:new(world.world, 585, 1090, {w = 160, h = 10}, nil, 0.653599)) - table.insert(this.invisibleWall, Wall:new(world.world, 580, 350, {w = 160, h = 10}, nil, -0.503599)) - table.insert(this.invisibleWall, Wall:new(world.world, 835, 670, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1280, 800, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1430, 1080, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1855, 1105, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1290, 1380, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 2710, 955, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 105, 1400, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1555, 530, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1885, 1405, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 2180, 1695, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 2030, 675, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1745, 1095, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1455, 1240, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 1010, 1540, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 585, 960, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 2315, 1105, {w = 160, h = 10}, nil, -0.8035)) - table.insert(this.invisibleWall, Wall:new(world.world, 710, 1225, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1000, 1230, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1290, 1695, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 130, 1540, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 560, 1260, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 135, 1115, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 855, 1260, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1270, 235, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1865, 680, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 2155, 680, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1275, 1250, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 2005, 1255, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 2155, 1220, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1460, 670, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 2020, 220, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 2295, 640, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 2160, 360, {w = 160, h = 10}, nil, 0.6535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1900, 530, {w = 160, h = 10}, nil, 0.7535)) - table.insert(this.invisibleWall, Wall:new(world.world, 745, 1365, {w = 160, h = 10}, nil, 1.8535)) - table.insert(this.invisibleWall, Wall:new(world.world, 260, 960, {w = 160, h = 10}, nil, 2.2535)) - table.insert(this.invisibleWall, Wall:new(world.world, 1440, 820, {w = 160, h = 10}, nil, 2.2535)) - this = setmetatable(this, GameController) + this.mapData(this, world, gameDirector:getLibrary("Wall"), true) for count = 1, 6 do this:increaseBusSize() end @@ -154,12 +60,20 @@ function GameController:getInstance(world) end function GameController:reset() + self.mapData(self, self.world, gameDirector:getLibrary("Wall"), true) + self.score = 0; self.totalTime = 110 end function GameController:setGamemodesController(gamemodeController) self.gamemodeController = gamemodeController end +function GameController:finishGame() + self.gamemodeController:increaseScore(self.score) + self.gamemodeController:exitGamemode(true) + self:reset() +end + function GameController:removePassenger(fixture) if self.passengers[fixture] then self.passengers[fixture]:destroy() @@ -167,8 +81,8 @@ function GameController:removePassenger(fixture) end end -function GameController:addPassenger() - local passenger = Passenger:new(self.world.world, love.math.random(self.mapSize.w), love.math.random(self.mapSize.h), self.passengerSprite) +function GameController:addPassenger(x, y) + local passenger = Passenger:new(self.world.world, x, y, self.passengerSprite) self.passengers[passenger:getFixture()] = passenger end @@ -186,12 +100,15 @@ end function GameController:update(dt) self.elapsedTime = self.elapsedTime + dt + self.totalTime = self.totalTime - dt + if self.totalTime <= 0 then + self:finishGame() + end self.cameraController:update(dt) self.busHead:update(dt) if self.elapsedTime >= self.waitTime then self.elapsedTime = 0 self.waitTime = love.math.random(1.5, 6) - self:addPassenger() end if self.growBus then self.growBus = false @@ -205,10 +122,14 @@ function GameController:draw() for _, wall in pairs(self.walls) do wall:draw() end --for _, wall in pairs(self.invisibleWall) do wall:draw() end self.busHead:draw() + local count = 0 for _, passenger in pairs(self.passengers) do + count = count + 1 passenger:draw() end + self.totalPassengers = count end) + gameDirector:getLibrary("LetterboardTimer"):draw(self.totalTime) end return GameController diff --git a/src/controllers/gamemodes/DriveTheBus/models/business/MapData.lua b/src/controllers/gamemodes/DriveTheBus/models/business/MapData.lua new file mode 100644 index 0000000..a5db077 --- /dev/null +++ b/src/controllers/gamemodes/DriveTheBus/models/business/MapData.lua @@ -0,0 +1,113 @@ +local function createMapColliders(this, world, Wall, newPassengers) + --[[ Adding walls to game --]] + table.insert(this.walls, Wall:new(world.world, 1200, 0, {w = 2400, h = 10})) + table.insert(this.walls, Wall:new(world.world, 1200, 1800, {w = 2400, h = 10})) + table.insert(this.walls, Wall:new(world.world, 0, 900, {w = 10, h = 1800})) + table.insert(this.walls, Wall:new(world.world, 2400, 900, {w = 10, h = 1800})) + + --[[ Adding invisible wall --]] + table.insert(this.invisibleWall, Wall:new(world.world, 80, 600, {w = 10, h = 900})) + table.insert(this.invisibleWall, Wall:new(world.world, 200, 600, {w = 10, h = 900})) + table.insert(this.invisibleWall, Wall:new(world.world, 110, 80, {w = 10, h = 130}, nil, 0.653599)) + table.insert(this.invisibleWall, Wall:new(world.world, 720, 40, {w = 1100, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 720, 150, {w = 1000, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1320, 90, {w = 10, h = 150}, nil, -0.553599)) + table.insert(this.invisibleWall, Wall:new(world.world, 1300, 320, {w = 1300, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1300, 430, {w = 1300, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1650, 180, {w = 600, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1650, 290, {w = 600, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1150, 620, {w = 520, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1150, 730, {w = 480, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 400, 1330, {w = 520, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 450, 1450, {w = 480, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 580, 1480, {w = 740, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 580, 1580, {w = 740, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1730, 1630, {w = 740, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1730, 1730, {w = 740, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1580, 1340, {w = 450, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1580, 1440, {w = 450, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 520, 650, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 620, 650, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 810, 950, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 910, 950, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 950, 1390, {w = 10, h = 170})) + table.insert(this.invisibleWall, Wall:new(world.world, 1050, 1390, {w = 10, h = 170})) + table.insert(this.invisibleWall, Wall:new(world.world, 1240, 1020, {w = 10, h = 280})) + table.insert(this.invisibleWall, Wall:new(world.world, 1340, 1020, {w = 10, h = 280})) + table.insert(this.invisibleWall, Wall:new(world.world, 1240, 1540, {w = 10, h = 200})) + table.insert(this.invisibleWall, Wall:new(world.world, 1340, 1540, {w = 10, h = 180})) + table.insert(this.invisibleWall, Wall:new(world.world, 1530, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 1630, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 1670, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 1770, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 2240, 870, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 2350, 870, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 2100, 1450, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 2210, 1450, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 1820, 1250, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 1920, 1250, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 1960, 510, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 2070, 510, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 2210, 505, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 2110, 515, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 1590, 1160, {w = 180, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 420, 895, {w = 180, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 435, 1045, {w = 180, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 2080, 1045, {w = 320, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 345, 1155, {w = 320, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1725, 470, {w = 320, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 425, 1015, {w = 160, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 2165, 1155, {w = 160, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 585, 1090, {w = 160, h = 10}, nil, 0.653599)) + table.insert(this.invisibleWall, Wall:new(world.world, 580, 350, {w = 160, h = 10}, nil, -0.503599)) + table.insert(this.invisibleWall, Wall:new(world.world, 835, 670, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1280, 800, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1430, 1080, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1855, 1105, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1290, 1380, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2710, 955, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 105, 1400, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1555, 530, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1885, 1405, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2180, 1695, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2030, 675, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1745, 1095, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1455, 1240, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1010, 1540, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 585, 960, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2315, 1105, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 710, 1225, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1000, 1230, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1290, 1695, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 130, 1540, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 560, 1260, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 135, 1115, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 855, 1260, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1270, 235, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1865, 680, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2155, 680, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1275, 1250, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2005, 1255, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2155, 1220, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1460, 670, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2020, 220, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2295, 640, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2160, 360, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1900, 530, {w = 160, h = 10}, nil, 0.7535)) + table.insert(this.invisibleWall, Wall:new(world.world, 745, 1365, {w = 160, h = 10}, nil, 1.8535)) + table.insert(this.invisibleWall, Wall:new(world.world, 260, 960, {w = 160, h = 10}, nil, 2.2535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1440, 820, {w = 160, h = 10}, nil, 2.2535)) + + if newPassengers then + --[[ Adding passengers --]] + this:addPassenger(630, 90); this:addPassenger(1670, 230) + this:addPassenger(1160, 370); this:addPassenger(1725, 515) + this:addPassenger(1585, 1095); this:addPassenger(2310, 750) + this:addPassenger(2020, 1100); this:addPassenger(2165, 1480) + this:addPassenger(1755, 1680); this:addPassenger(1595, 1385) + this:addPassenger(1440, 730); this:addPassenger(280, 1100) + this:addPassenger(940, 1240); this:addPassenger(145, 1460) + end +end + +return createMapColliders diff --git a/src/controllers/gamemodes/DriveTheBus/models/entities/Bus.lua b/src/controllers/gamemodes/DriveTheBus/models/entities/Bus.lua index 36be88e..8e6919d 100644 --- a/src/controllers/gamemodes/DriveTheBus/models/entities/Bus.lua +++ b/src/controllers/gamemodes/DriveTheBus/models/entities/Bus.lua @@ -53,6 +53,10 @@ function Bus:getPosition() return self.body:getX(), self.body:getY() end +function Bus:stop() + self.body:setLinearVelocity(0, 0) +end + function Bus:keypressed(key, scancode, isrepeat) if self.keys[key] then if self.orientations[self.keys[key]] == "horizontal" then diff --git a/src/controllers/gamemodes/HowMuchMoneyBack/init.lua b/src/controllers/gamemodes/HowMuchMoneyBack/init.lua index ec24f1d..070dda6 100644 --- a/src/controllers/gamemodes/HowMuchMoneyBack/init.lua +++ b/src/controllers/gamemodes/HowMuchMoneyBack/init.lua @@ -45,7 +45,7 @@ end function GameController:new(world) local this = { world = world, - gamemodeController = nil, gateAngle = 0, totalTime = 0, + gamemodeController = nil, gateAngle = 0, totalTime = 15, elapsedTime = 0, waitTime = 0, ticketGate = love.graphics.newImage("assets/sprites/HowMuchMoneyBack/ticket_gate.png"), hand = {spritesheet = nil, x = 660, y = -60, currentQuad = nil}, button = nil, buttonSprite = gameDirector:getLibrary("Pixelurite").getSpritesheet():new("button", "assets/sprites/HowMuchMoneyBack/"), @@ -105,7 +105,7 @@ function GameController:getInstance(world) end function GameController:reset() - self.moneyValue = 0; self.totalTime = 0; self.elapsedTime = 0; self.exchangeValue = 0; self.score = 0; + self.moneyValue = 0; self.totalTime = 15; self.elapsedTime = 0; self.exchangeValue = 0; self.score = 0; self.updateFunction = updateStates[1]; self.gateAngle = 0; self.currentState = 0 end @@ -159,8 +159,9 @@ function GameController:update(dt) if self.waitTime > 0 then self.waitTime = self.waitTime - dt else - self.totalTime = self.totalTime + dt - if self.totalTime > 15 then + self.totalTime = self.totalTime - dt + if self.totalTime <= 0 then + self.gamemodeController:increaseScore(self.score) self.gamemodeController:exitGamemode() self:reset() else @@ -192,6 +193,7 @@ function GameController:draw() love.graphics.setFont(gameDirector:getFonts().ledDigits) love.graphics.print(string.format("Troco Atual: %f", self.exchangeValue), 210, 240, 0) love.graphics.setFont(gameDirector:getFonts().default) + gameDirector:getLibrary("LetterboardTimer"):draw(self.totalTime) end return GameController diff --git a/src/models/LetterboardTimer.lua b/src/models/LetterboardTimer.lua new file mode 100644 index 0000000..711d260 --- /dev/null +++ b/src/models/LetterboardTimer.lua @@ -0,0 +1,12 @@ +local LetterboardTimer = {} + +LetterboardTimer.__index = LetterboardTimer +local sprite = love.graphics.newImage("assets/sprites/misc/letterboard_timer.png") +function LetterboardTimer:draw(timer) + love.graphics.setFont(gameDirector:getFonts().letterboard) + love.graphics.draw(sprite, 604, 0, 0) + love.graphics.print(string.format("%d", timer), 684, 20, 0) + love.graphics.setFont(gameDirector:getFonts().default) +end + +return LetterboardTimer diff --git a/src/scenes/InGameScene.lua b/src/scenes/InGameScene.lua index c56b80e..a66189e 100644 --- a/src/scenes/InGameScene.lua +++ b/src/scenes/InGameScene.lua @@ -28,7 +28,8 @@ function InGameScene:new(world) }, letterboardImage = love.graphics.newImage("assets/sprites/misc/letterboard.png"), world = world, - currentGamemode = nil, gamemodeName = "DriveTheBus" + currentGamemode = nil, gamemodeName = "DriveTheBus", + totalScore = 0 } this.music:setLooping(true) this.currentGamemode = this.DriveTheBus:getInstance(world) @@ -47,10 +48,18 @@ function InGameScene:changeGamemode() sceneDirector:switchSubscene("letterboard") end -function InGameScene:exitGamemode() +function InGameScene:increaseScore(amount) + self.totalScore = self.totalScore + amount +end + +function InGameScene:exitGamemode(over) self.currentGamemode = self.DriveTheBus:getInstance(self.world) self.gamemodeName = "DriveTheBus" self.world:changeCallbacks("DriveTheBus") + if over then + sceneDirector:addSubscene("finalScore", require "scenes.subscenes.FinalScore":new(self.totalScore, self.DriveTheBus:getInstance(self.world).totalTime), true) + sceneDirector:switchSubscene("finalScore") + end end function InGameScene:keypressed(key, scancode, isrepeat) diff --git a/src/scenes/subscenes/FinalScore.lua b/src/scenes/subscenes/FinalScore.lua new file mode 100644 index 0000000..d867088 --- /dev/null +++ b/src/scenes/subscenes/FinalScore.lua @@ -0,0 +1,34 @@ +local GameOver = {} + +GameOver.__index = GameOver + +function GameOver:new(score, time) + local this = { + score = score, time = time or 0, + scoreSprite = love.graphics.newImage("assets/sprites/misc/mission_menu.png") + } + + return setmetatable(this, GameOver) +end + +function GameOver:keypressed(key, scancode, isrepeat) + if key == "escape" then + sceneDirector:exitSubscene() + sceneDirector:previousScene() + sceneDirector:previousScene() + end +end + +function GameOver:draw() + love.graphics.setColor(0, 0, 0) + local width, height = self.scoreSprite:getWidth(), self.scoreSprite:getHeight() + love.graphics.rectangle("fill", (love.graphics.getWidth() / 2) - 120, 80, width, height) + love.graphics.setColor(1, 1, 1) + love.graphics.draw(self.scoreSprite, (love.graphics.getWidth() / 2) - 120, 80) + love.graphics.setFont(gameDirector:getFonts().letterboard) + love.graphics.print(string.format("%d", self.score), 500, 320) + love.graphics.print(string.format("%d", self.time), 450, 380) + love.graphics.setFont(gameDirector:getFonts().default) +end + +return GameOver