Class: Termfront::Opponent
- Inherits:
-
Object
- Object
- Termfront::Opponent
- Defined in:
- lib/termfront/opponent.rb
Instance Attribute Summary collapse
-
#ammo ⇒ Object
Returns the value of attribute ammo.
-
#angle ⇒ Object
Returns the value of attribute angle.
-
#fire_flash ⇒ Object
Returns the value of attribute fire_flash.
-
#health ⇒ Object
Returns the value of attribute health.
-
#shield ⇒ Object
Returns the value of attribute shield.
-
#weapon ⇒ Object
Returns the value of attribute weapon.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #dup_state ⇒ Object
-
#initialize(x:, y:, angle:, shield: Config::SHIELD_MAX, health: Config::HEALTH_MAX, weapon: :ar, ammo: 60, fire_flash: 0) ⇒ Opponent
constructor
A new instance of Opponent.
Constructor Details
#initialize(x:, y:, angle:, shield: Config::SHIELD_MAX, health: Config::HEALTH_MAX, weapon: :ar, ammo: 60, fire_flash: 0) ⇒ Opponent
Returns a new instance of Opponent.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/termfront/opponent.rb', line 7 def initialize(x:, y:, angle:, shield: Config::SHIELD_MAX, health: Config::HEALTH_MAX, weapon: :ar, ammo: 60, fire_flash: 0) @x = x @y = y @angle = angle @shield = shield @health = health @weapon = weapon @ammo = ammo @fire_flash = fire_flash end |
Instance Attribute Details
#ammo ⇒ Object
Returns the value of attribute ammo.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def ammo @ammo end |
#angle ⇒ Object
Returns the value of attribute angle.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def angle @angle end |
#fire_flash ⇒ Object
Returns the value of attribute fire_flash.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def fire_flash @fire_flash end |
#health ⇒ Object
Returns the value of attribute health.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def health @health end |
#shield ⇒ Object
Returns the value of attribute shield.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def shield @shield end |
#weapon ⇒ Object
Returns the value of attribute weapon.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def weapon @weapon end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'lib/termfront/opponent.rb', line 5 def y @y end |