post-refactor fixes

This commit is contained in:
jill 2021-01-24 20:46:52 +03:00
parent 5fbf569c65
commit 3a1183cdd7
Signed by: oat
GPG key ID: DD83A9617A252385
3 changed files with 24 additions and 6 deletions

View file

@ -16,7 +16,7 @@ local headerbuttons = {
cost = 100,
sprite = 'guppy',
openanim = 1,
open = false,
open = true,
closed = false,
func = function()
playSound('splash', 0.7, 0.8)
@ -28,13 +28,14 @@ local headerbuttons = {
sprite = 'food',
tier = foodtier,
openanim = 1,
open = false,
open = true,
closed = false,
func = function(self)
self.openanim = 0
foodtier = foodtier + 1
if foodtier >= 3 then
self.open = false
self.closed = true
else
self.tier = foodtier
end
@ -45,13 +46,14 @@ local headerbuttons = {
sprite = 'foodcount',
tier = foodcount,
openanim = 1,
open = false,
open = true,
closed = false,
func = function(self)
self.openanim = 0
foodcount = foodcount + 1
if foodcount >= 9 then
self.open = false
self.closed = true
else
self.tier = foodcount
end
@ -104,7 +106,7 @@ function self.update(dt)
bench.stopBenchmark('update_money')
bench.startBenchmark('update_fish')
require('scenes.gameplay.update.fish')(feesh, dt, food)
require('scenes.gameplay.update.fish')(feesh, dt, food, headerbuttons, money)
bench.stopBenchmark('update_fish')
end

View file

@ -1,4 +1,4 @@
return function(feesh, dt, food)
return function(feesh, dt, food, headerbuttons, money)
for fi, n in ipairs(feesh) do
bench.startBenchmark('update_fish_eases')
for _, e in ipairs(n.eases) do