Class: Termfront::RemoteEnemy

Inherits:
Object
  • Object
show all
Defined in:
lib/termfront/remote_enemy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, x:, y:, sprite_id:, hp:, max_hp:, alive: true) ⇒ RemoteEnemy

Returns a new instance of RemoteEnemy.



7
8
9
10
11
12
13
14
15
# File 'lib/termfront/remote_enemy.rb', line 7

def initialize(id:, x:, y:, sprite_id:, hp:, max_hp:, alive: true)
  @id = id
  @x = x
  @y = y
  @sprite_id = sprite_id
  @hp = hp
  @max_hp = max_hp
  @alive = alive
end

Instance Attribute Details

#aliveObject

Returns the value of attribute alive.



5
6
7
# File 'lib/termfront/remote_enemy.rb', line 5

def alive
  @alive
end

#hpObject

Returns the value of attribute hp.



5
6
7
# File 'lib/termfront/remote_enemy.rb', line 5

def hp
  @hp
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/termfront/remote_enemy.rb', line 5

def id
  @id
end

#max_hpObject

Returns the value of attribute max_hp.



5
6
7
# File 'lib/termfront/remote_enemy.rb', line 5

def max_hp
  @max_hp
end

#xObject

Returns the value of attribute x.



5
6
7
# File 'lib/termfront/remote_enemy.rb', line 5

def x
  @x
end

#yObject

Returns the value of attribute y.



5
6
7
# File 'lib/termfront/remote_enemy.rb', line 5

def y
  @y
end

Instance Method Details

#sprite_idObject



17
18
19
# File 'lib/termfront/remote_enemy.rb', line 17

def sprite_id
  @sprite_id
end