Class: Termfront::RemoteEnemy
- Inherits:
-
Object
- Object
- Termfront::RemoteEnemy
- Defined in:
- lib/termfront/remote_enemy.rb
Instance Attribute Summary collapse
-
#alive ⇒ Object
Returns the value of attribute alive.
-
#hp ⇒ Object
Returns the value of attribute hp.
-
#id ⇒ Object
Returns the value of attribute id.
-
#max_hp ⇒ Object
Returns the value of attribute max_hp.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(id:, x:, y:, sprite_id:, hp:, max_hp:, alive: true) ⇒ RemoteEnemy
constructor
A new instance of RemoteEnemy.
- #sprite_id ⇒ Object
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
#alive ⇒ Object
Returns the value of attribute alive.
5 6 7 |
# File 'lib/termfront/remote_enemy.rb', line 5 def alive @alive end |
#hp ⇒ Object
Returns the value of attribute hp.
5 6 7 |
# File 'lib/termfront/remote_enemy.rb', line 5 def hp @hp end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/termfront/remote_enemy.rb', line 5 def id @id end |
#max_hp ⇒ Object
Returns the value of attribute max_hp.
5 6 7 |
# File 'lib/termfront/remote_enemy.rb', line 5 def max_hp @max_hp end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/termfront/remote_enemy.rb', line 5 def x @x end |
#y ⇒ Object
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_id ⇒ Object
17 18 19 |
# File 'lib/termfront/remote_enemy.rb', line 17 def sprite_id @sprite_id end |