color changes
This commit is contained in:
2
main.lua
2
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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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))
|
||||
|
||||
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user