carnivore

This commit is contained in:
jill 2021-01-25 17:48:31 +03:00
parent 3b70bf9b5d
commit 57fa26dfb7
Signed by: oat
GPG key ID: DD83A9617A252385
14 changed files with 106 additions and 28 deletions

View file

@ -2,11 +2,12 @@ require 'const'
local self = {}
function self.fish(x, y)
function self.fish(x, y, type)
type = type or 0
local fish = {
x = x,
y = y,
size = 0, -- 0 for small, 1 for medium, 2 for big, 3 for king
size = type, -- 0 for small, 1 for medium, 2 for big, 3 for king, 4 for carnivore
eattimer = 0 + math.random() * 2, -- starts out hungry, with a 2s delay
moneytimer = 10 + math.random() * 5, -- min 10s before it can make money
dead = false,