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, {
|
push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, {
|
||||||
fullscreen = false,
|
fullscreen = false,
|
||||||
vsync = false,
|
vsync = false,
|
||||||
resizable = false
|
resizable = true
|
||||||
})
|
})
|
||||||
|
|
||||||
gStateStack = StateStack()
|
gStateStack = StateStack()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ function Ball:update(dt,level)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Ball:render()
|
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)
|
love.graphics.circle('fill', self.x, self.y, self.width/2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function FadeInState:init(color, time, onFadeComplete)
|
|||||||
self.time = time
|
self.time = time
|
||||||
|
|
||||||
Timer.tween(self.time, {
|
Timer.tween(self.time, {
|
||||||
[self] = {opacity = 255}
|
[self] = {opacity = 255/255}
|
||||||
})
|
})
|
||||||
:finish(function()
|
:finish(function()
|
||||||
gStateStack:pop()
|
gStateStack:pop()
|
||||||
@@ -29,5 +29,5 @@ function FadeInState:render()
|
|||||||
love.graphics.setColor(self.r, self.g, self.b, self.opacity)
|
love.graphics.setColor(self.r, self.g, self.b, self.opacity)
|
||||||
love.graphics.rectangle('fill', 0, 0, VIRTUAL_WIDTH, VIRTUAL_HEIGHT)
|
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
|
end
|
||||||
@@ -10,7 +10,7 @@ FadeOutState = Class{__includes = BaseState}
|
|||||||
|
|
||||||
function FadeOutState:init(color, time, onFadeComplete)
|
function FadeOutState:init(color, time, onFadeComplete)
|
||||||
self.name = 'FadeOutState'
|
self.name = 'FadeOutState'
|
||||||
self.opacity = 255
|
self.opacity = 255/255
|
||||||
self.r = color.r
|
self.r = color.r
|
||||||
self.g = color.g
|
self.g = color.g
|
||||||
self.b = color.b
|
self.b = color.b
|
||||||
@@ -33,5 +33,5 @@ function FadeOutState:render()
|
|||||||
love.graphics.setColor(self.r, self.g, self.b, self.opacity)
|
love.graphics.setColor(self.r, self.g, self.b, self.opacity)
|
||||||
love.graphics.rectangle('fill', 0, 0, VIRTUAL_WIDTH, VIRTUAL_HEIGHT)
|
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
|
end
|
||||||
@@ -26,9 +26,9 @@ function GameOverState:update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GameOverState:render()
|
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.setFont(gFonts['large'])
|
||||||
love.graphics.printf('GAME OVER', 0, VIRTUAL_HEIGHT / 2 - 72, VIRTUAL_WIDTH, 'center')
|
love.graphics.printf('GAME OVER', 0, VIRTUAL_HEIGHT / 2 - 72, VIRTUAL_WIDTH, 'center')
|
||||||
love.graphics.setFont(gFonts['medium'])
|
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.printf('Press Enter', 0, VIRTUAL_HEIGHT / 2 + 88, VIRTUAL_WIDTH, 'center')
|
||||||
love.graphics.setFont(gFonts['small'])
|
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)
|
-- love.graphics.draw(gTextures[self.sprite], self.spriteX, self.spriteY)
|
||||||
end
|
end
|
||||||
@@ -27,8 +27,8 @@ function PlayState:update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function PlayState:render()
|
function PlayState:render()
|
||||||
love.graphics.clear(0, 0, 0, 255)
|
love.graphics.clear(0, 0, 0, 255/255)
|
||||||
love.graphics.setColor(40, 45, 52,255)
|
love.graphics.setColor(40/255, 45/255, 52/255,255/255)
|
||||||
|
|
||||||
love.graphics.setFont(gFonts['small'])
|
love.graphics.setFont(gFonts['small'])
|
||||||
love.graphics.printf('Score '..tostring(self.player.score),
|
love.graphics.printf('Score '..tostring(self.player.score),
|
||||||
@@ -95,7 +95,7 @@ end
|
|||||||
|
|
||||||
function PlayState:nextStage()
|
function PlayState:nextStage()
|
||||||
gStateStack:push(FadeOutState({
|
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.stage = self.stage + 1
|
||||||
self.level = Level()
|
self.level = Level()
|
||||||
self.player:reset()
|
self.player:reset()
|
||||||
@@ -108,7 +108,7 @@ function PlayState:nextStage()
|
|||||||
self.level.balls = self.balls
|
self.level.balls = self.balls
|
||||||
gSounds['music']:stop()
|
gSounds['music']:stop()
|
||||||
gSounds['heal']:play()
|
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()
|
gSounds['music']:play()
|
||||||
end))
|
end))
|
||||||
end))
|
end))
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ end
|
|||||||
function StartState:update(dt)
|
function StartState:update(dt)
|
||||||
if love.keyboard.wasPressed('enter') or love.keyboard.wasPressed('return') then
|
if love.keyboard.wasPressed('enter') or love.keyboard.wasPressed('return') then
|
||||||
gStateStack:push(FadeInState({
|
gStateStack:push(FadeInState({
|
||||||
r = 255, g = 255, b = 255
|
r = 255/255, g = 255/255, b = 255/255
|
||||||
}, 1,
|
}, 1,
|
||||||
function()
|
function()
|
||||||
gSounds['intro-music']:stop()
|
gSounds['intro-music']:stop()
|
||||||
@@ -27,8 +27,8 @@ end
|
|||||||
|
|
||||||
function StartState:render()
|
function StartState:render()
|
||||||
-- print("StartSate : setting colors")
|
-- print("StartSate : setting colors")
|
||||||
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.setFont(gFonts['large'])
|
||||||
love.graphics.printf('Spider Cut!', 0, VIRTUAL_HEIGHT / 2 - 72, VIRTUAL_WIDTH, 'center')
|
love.graphics.printf('Spider Cut!', 0, VIRTUAL_HEIGHT / 2 - 72, VIRTUAL_WIDTH, 'center')
|
||||||
love.graphics.setFont(gFonts['medium'])
|
love.graphics.setFont(gFonts['medium'])
|
||||||
|
|||||||
Reference in New Issue
Block a user