-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit_e1.lua
25 lines (22 loc) · 988 Bytes
/
unit_e1.lua
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
E1Unit = Unit:extend()
function E1Unit:new(x, y)
E1Unit.super.new(self, x, y)
self.unit_name = "Hannah"
self.is_hero = true
self.has_feet = true
self.user_controlled = false
self.sprite_sheet = love.graphics.newImage('gfx/enemy/e1_1.png')
local loaded_sheet = anim8.newGrid(48, 48, self.sprite_sheet:getWidth(), self.sprite_sheet:getHeight(), 0, 0)
self.walk_animation = anim8.newAnimation(loaded_sheet('1-3', 1), constants.walk_animation_frame_length)
self.cast_animation = anim8.newAnimation(loaded_sheet('4-4', 1), constants.animation_frame_length)
self.damage_animation = anim8.newAnimation(loaded_sheet('5-5', 1), constants.animation_frame_length)
self.walk_animation:pauseAtStart()
self.facing_left = true
-- Movement
self.move_range = constants.e1_move_range
-- Combat math
self.max_hp = constants.e1_max_hp
self.hp = constants.e1_max_hp
self.atk = constants.e1_atk
self.def = constants.e1_def
end