This commit is contained in:
jill 2021-01-25 17:57:53 +03:00
parent 57fa26dfb7
commit 101ba11709
Signed by: oat
GPG key ID: DD83A9617A252385
2 changed files with 4 additions and 3 deletions

View file

@ -25,10 +25,11 @@ return function(headerheight, fishsprite, headerbuttons, sheets, balance)
if btn then
if btn.open then
-- sprite inside
if btn.sprite == 'guppy' then
local sheet = fishsprite('medium', false, 'swim')
if btn.sprite == 'guppy' or btn.sprite == 'carnivore' then
local sheet = fishsprite(btn.sprite == 'carnivore' and 'carnivore' or 'medium', false, 'swim')
local frame = math.floor((love.timer.getTime() * 2) % 1 * #sheet.quads) + 1
local scale = (sprites['header/buttonbg']:getWidth() / sheet.width) * 0.9
if btn.sprite == 'carnivore' then scale = scale * 0.7 end
local offset = (sprites['header/buttonbg']:getWidth() * size) / 2
love.graphics.draw(sheet.spriteSheet, sheet.quads[frame], x * size + offset, y * size + offset*0.75, 0, size * scale, size * scale, sheet.width/2, sheet.width/2)
elseif btn.sprite == 'food' then

View file

@ -192,7 +192,7 @@ function self.mousepressed(x, y, b)
end
if b == 1 and y > HEADER_HEIGHT and #food < foodcount then
if balance >= 5 then
if balance >= 5 or debug then
table.insert(food, constr.food(x/love.graphics.getWidth(), y/love.graphics.getHeight(), foodtier))
playSound('dropfood')
balance = balance - 5