From 1131d5a4d9397e6c450d37f724abfb278ce0ecbc Mon Sep 17 00:00:00 2001 From: checamon Date: Sat, 18 Dec 2021 23:55:01 +0100 Subject: [PATCH] color changes --- main.lua | 2 +- src/Ball.lua | 2 +- src/states/game/FadeInState.lua | 4 ++-- src/states/game/FadeOutState.lua | 4 ++-- src/states/game/GameOverState.lua | 6 +++--- src/states/game/PlayState.lua | 8 ++++---- src/states/game/StartState.lua | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/main.lua b/main.lua index 67cefa0..3fb509d 100644 --- a/main.lua +++ b/main.lua @@ -39,7 +39,7 @@ function love.load() push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, { fullscreen = false, vsync = false, - resizable = false + resizable = true }) gStateStack = StateStack() diff --git a/src/Ball.lua b/src/Ball.lua index ff78618..224f772 100644 --- a/src/Ball.lua +++ b/src/Ball.lua @@ -60,7 +60,7 @@ function Ball:update(dt,level) end function Ball:render() - love.graphics.setColor(255,255,255,255) + love.graphics.setColor(255/255,255/255,255/255,255/255) love.graphics.circle('fill', self.x, self.y, self.width/2) end diff --git a/src/states/game/FadeInState.lua b/src/states/game/FadeInState.lua index 551eaed..b237aab 100644 --- a/src/states/game/FadeInState.lua +++ b/src/states/game/FadeInState.lua @@ -17,7 +17,7 @@ function FadeInState:init(color, time, onFadeComplete) self.time = time Timer.tween(self.time, { - [self] = {opacity = 255} + [self] = {opacity = 255/255} }) :finish(function() gStateStack:pop() @@ -29,5 +29,5 @@ function FadeInState:render() love.graphics.setColor(self.r, self.g, self.b, self.opacity) love.graphics.rectangle('fill', 0, 0, VIRTUAL_WIDTH, VIRTUAL_HEIGHT) - love.graphics.setColor(255, 255, 255, 255) + love.graphics.setColor(1/255, 1/255, 1/255, 1/255) end \ No newline at end of file diff --git a/src/states/game/FadeOutState.lua b/src/states/game/FadeOutState.lua index 91930bf..5f3226d 100644 --- a/src/states/game/FadeOutState.lua +++ b/src/states/game/FadeOutState.lua @@ -10,7 +10,7 @@ FadeOutState = Class{__includes = BaseState} function FadeOutState:init(color, time, onFadeComplete) self.name = 'FadeOutState' - self.opacity = 255 + self.opacity = 255/255 self.r = color.r self.g = color.g self.b = color.b @@ -33,5 +33,5 @@ function FadeOutState:render() love.graphics.setColor(self.r, self.g, self.b, self.opacity) love.graphics.rectangle('fill', 0, 0, VIRTUAL_WIDTH, VIRTUAL_HEIGHT) - love.graphics.setColor(255, 255, 255, 255) + love.graphics.setColor(1/255, 1/255, 1/255, 255/255) end \ No newline at end of file diff --git a/src/states/game/GameOverState.lua b/src/states/game/GameOverState.lua index ad39926..cf8bc81 100644 --- a/src/states/game/GameOverState.lua +++ b/src/states/game/GameOverState.lua @@ -26,9 +26,9 @@ function GameOverState:update(dt) end function GameOverState:render() - love.graphics.clear(0, 0, 0, 255) + love.graphics.clear(0, 0, 0, 255/255) - love.graphics.setColor(56, 56, 56, 255) + love.graphics.setColor(56/255, 56/255, 56/255, 255/255) love.graphics.setFont(gFonts['large']) love.graphics.printf('GAME OVER', 0, VIRTUAL_HEIGHT / 2 - 72, VIRTUAL_WIDTH, 'center') love.graphics.setFont(gFonts['medium']) @@ -39,6 +39,6 @@ function GameOverState:render() love.graphics.printf('Press Enter', 0, VIRTUAL_HEIGHT / 2 + 88, VIRTUAL_WIDTH, 'center') love.graphics.setFont(gFonts['small']) - love.graphics.setColor(255, 255, 255, 255) + love.graphics.setColor(255/255, 255/255, 255/255, 255/255) -- love.graphics.draw(gTextures[self.sprite], self.spriteX, self.spriteY) end \ No newline at end of file diff --git a/src/states/game/PlayState.lua b/src/states/game/PlayState.lua index bec0d8e..3116827 100644 --- a/src/states/game/PlayState.lua +++ b/src/states/game/PlayState.lua @@ -27,8 +27,8 @@ function PlayState:update(dt) end function PlayState:render() - love.graphics.clear(0, 0, 0, 255) - love.graphics.setColor(40, 45, 52,255) + love.graphics.clear(0, 0, 0, 255/255) + love.graphics.setColor(40/255, 45/255, 52/255,255/255) love.graphics.setFont(gFonts['small']) love.graphics.printf('Score '..tostring(self.player.score), @@ -95,7 +95,7 @@ end function PlayState:nextStage() gStateStack:push(FadeOutState({ - r = 255, g = 255, b = 255}, 1,function() + r = 255/255, g = 255/255, b = 255/255}, 1,function() self.stage = self.stage + 1 self.level = Level() self.player:reset() @@ -108,7 +108,7 @@ function PlayState:nextStage() self.level.balls = self.balls gSounds['music']:stop() gSounds['heal']:play() - gStateStack:push(FadeOutState({r = 255, g = 255, b = 255}, 1,function() + gStateStack:push(FadeOutState({r = 1/255, g = 1/255, b = 1/255}, 1,function() gSounds['music']:play() end)) end)) diff --git a/src/states/game/StartState.lua b/src/states/game/StartState.lua index c0937c1..6a61d7b 100644 --- a/src/states/game/StartState.lua +++ b/src/states/game/StartState.lua @@ -11,7 +11,7 @@ end function StartState:update(dt) if love.keyboard.wasPressed('enter') or love.keyboard.wasPressed('return') then gStateStack:push(FadeInState({ - r = 255, g = 255, b = 255 + r = 255/255, g = 255/255, b = 255/255 }, 1, function() gSounds['intro-music']:stop() @@ -27,8 +27,8 @@ end function StartState:render() -- print("StartSate : setting colors") - love.graphics.clear(0, 0, 0, 255) - love.graphics.setColor(56, 56, 56, 255) + love.graphics.clear(0, 0, 0, 255/255) + love.graphics.setColor(56/255, 56/255, 56/255, 255/255) love.graphics.setFont(gFonts['large']) love.graphics.printf('Spider Cut!', 0, VIRTUAL_HEIGHT / 2 - 72, VIRTUAL_WIDTH, 'center') love.graphics.setFont(gFonts['medium'])