-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoblin.lua
More file actions
29 lines (26 loc) · 887 Bytes
/
goblin.lua
File metadata and controls
29 lines (26 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
local goblinWalkAnimation = {}
local goblinAttackAnimation = {}
for i = 0, 6 do
local walkingFile = "imageAssets/goblin/WALK_00" .. i .. ".png"
local attackFile = "imageAssets/goblin/ATTAK_00" .. i .. ".png"
local walkingImage = love.graphics.newImage(walkingFile)
local attackImage = love.graphics.newImage(attackFile)
table.insert(goblinWalkAnimation, walkingImage)
table.insert(goblinAttackAnimation, attackImage)
end
Goblin = Enemy:extend()
function Goblin:new(x, y, wave)
Goblin.super.new(self, x, y)
self.hp = 80 + (80 * wave * 0.2)
self.damage = 40
self.speed = 100
self.maxHP = self.hp
self.height = 50
self.width = 50
self.time = 0
self.animation["walk"] = goblinWalkAnimation
self.animation["attack"] = goblinAttackAnimation
end
function Goblin:CreateWave(wave)
return math.floor(5 + (5 * wave * 0.5))
end