star fish
This commit is contained in:
parent
00f4f5a30b
commit
0cf9e962b6
10 changed files with 110 additions and 41 deletions
|
@ -65,11 +65,24 @@ return function(feesh, spritescale, fishsprite)
|
|||
local sadsheet = fishsprite(size, true, anim)
|
||||
|
||||
local alpha = n.render.hungry == 1 and 0 or 1
|
||||
love.graphics.setColor(1, 1, 1, alpha - n.render.deathanim)
|
||||
local allalpha = 1
|
||||
if n.star then allalpha = 0.8 end
|
||||
love.graphics.setColor(1, 1, 1, (alpha - n.render.deathanim) * allalpha)
|
||||
love.graphics.draw(sheet.spriteSheet, sheet.quads[math.max(math.min(frame, #sample.quads), 1)], x, y, angle, sizex * spritescale, spritescale, sample.width/2, sample.height/2)
|
||||
love.graphics.setColor(1, 1, 1, n.render.hungry - n.render.deathanim)
|
||||
love.graphics.setColor(1, 1, 1, (n.render.hungry - n.render.deathanim) * allalpha)
|
||||
love.graphics.draw(sadsheet.spriteSheet, sheet.quads[math.max(math.min(frame, #sample.quads), 1)], x, y, angle, sizex * spritescale, spritescale, sample.width/2, sample.height/2)
|
||||
|
||||
if n.star then
|
||||
local mult = (math.sin(love.timer.getTime() / 4) / 2 + 0.5) * 0.1 + 0.9
|
||||
|
||||
love.graphics.setBlendMode('add')
|
||||
love.graphics.setColor(1, 1, 1, (alpha - n.render.deathanim) * mult)
|
||||
love.graphics.draw(sheet.spriteSheet, sheet.quads[math.max(math.min(frame, #sample.quads), 1)], x, y, angle, sizex * spritescale, spritescale, sample.width/2, sample.height/2)
|
||||
love.graphics.setColor(1, 1, 1, (n.render.hungry - n.render.deathanim) * mult)
|
||||
love.graphics.draw(sadsheet.spriteSheet, sheet.quads[math.max(math.min(frame, #sample.quads), 1)], x, y, angle, sizex * spritescale, spritescale, sample.width/2, sample.height/2)
|
||||
love.graphics.setBlendMode('alpha')
|
||||
end
|
||||
|
||||
love.graphics.setColor(1, 1, 1)
|
||||
if debug then love.graphics.print(shrt(n.eattimer), x + 20, y + 20) end
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
return function(food, sheets, spritescale)
|
||||
local sheetNames = {
|
||||
'food1', 'food2', 'food3', 'potion'
|
||||
}
|
||||
|
||||
return function(food, sheets, spritescale, starpotionequipped)
|
||||
local sw, sh = love.graphics.getDimensions()
|
||||
for _,f in ipairs(food) do
|
||||
local sheet = sheets['food' .. (f.type)]
|
||||
local sheet = sheets[sheetNames[f.type]]
|
||||
local x = f.x * sw
|
||||
local y = f.y * sh
|
||||
local frame = math.floor((f.time%1) * #sheet.quads) + 1
|
||||
|
@ -10,4 +14,10 @@ return function(food, sheets, spritescale)
|
|||
|
||||
love.graphics.draw(sheet.spriteSheet, sheet.quads[math.max(math.min(frame, #sheet.quads), 1)], x, y, 0, spritescale, spritescale, sheet.width/2, sheet.height/2)
|
||||
end
|
||||
|
||||
if starpotionequipped then
|
||||
local sheet = sheets.potion
|
||||
love.graphics.setColor(1, 1, 1, 0.8)
|
||||
love.graphics.draw(sheet.spriteSheet, sheet.quads[1], love.mouse.getX(), love.mouse.getY(), 0, spritescale, spritescale, sheet.width/2, sheet.height/2)
|
||||
end
|
||||
end
|
|
@ -1,4 +1,4 @@
|
|||
return function(headerheight, fishsprite, headerbuttons, sheets, balance)
|
||||
return function(headerheight, fishsprite, headerbuttons, sheets, balance, moneyflashtimer)
|
||||
local sw, sh = love.graphics.getDimensions()
|
||||
local base = sprites['header/base']
|
||||
local size = headerheight / HEADER_HEIGHT
|
||||
|
@ -68,6 +68,12 @@ return function(headerheight, fishsprite, headerbuttons, sheets, balance)
|
|||
|
||||
love.graphics.setColor(0, 1, 0)
|
||||
love.graphics.printf(btn.tier + 1, round(x * size), round(y * size + offset*0.75 - fonts.continuum:getHeight()/2), round(sprites['header/buttonbg']:getWidth() * size), 'center')
|
||||
elseif btn.sprite == 'starpotion' then
|
||||
local sheet = sheets.potion
|
||||
|
||||
local scale = (sprites['header/buttonbg']:getWidth() / sheet.width) * 0.65
|
||||
local offset = (sprites['header/buttonbg']:getWidth() * size) / 2
|
||||
love.graphics.draw(sheet.spriteSheet, sheet.quads[1], x * size + offset, y * size + offset*0.75, 0, size * scale, size * scale, sheet.width/2, sheet.width/2)
|
||||
end
|
||||
|
||||
-- price
|
||||
|
@ -101,11 +107,13 @@ return function(headerheight, fishsprite, headerbuttons, sheets, balance)
|
|||
end
|
||||
|
||||
-- money count
|
||||
if love.timer.getTime() % 0.25 < 0.125 and moneyflashtimer > 0 then love.graphics.draw(sprites['header/moneyflash'], sw * 0.851, (HEADER_HEIGHT - 29) * size, 0, size, size) end
|
||||
love.graphics.setFont(fonts.continuum)
|
||||
love.graphics.setColor(179/255, 254/255, 89/255)
|
||||
local leftpad = 100
|
||||
love.graphics.printf(balance, round(sw * 0.965 - leftpad), round(HEADER_HEIGHT - 25), leftpad, 'right')
|
||||
love.graphics.printf(balance, round(sw * 0.965 - leftpad), round((HEADER_HEIGHT - 25) * size), leftpad, 'right')
|
||||
|
||||
-- tooltips
|
||||
if tooltipText then
|
||||
love.graphics.setColor(254/255, 254/255, 199/255)
|
||||
love.graphics.rectangle('fill', round(tooltipx - 5), round(tooltipy - 5), round(tooltipText:getWidth() + 10), round(tooltipText:getHeight() + 10))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue