module SpaceInvaders::Fireable

Public Instance Methods

bullet_collection() click to toggle source
# File lib/space_invaders/behaviors/fireable.rb, line 7
def bullet_collection
  @bullet_collection ||= BulletCollection.new
end
Also aliased as: bullets
bullet_offset_speed() click to toggle source
# File lib/space_invaders/behaviors/fireable.rb, line 30
def bullet_offset_speed
  5
end
bullets()
Alias for: bullet_collection
bullets_going_down?() click to toggle source
# File lib/space_invaders/behaviors/fireable.rb, line 26
def bullets_going_down?
  true
end
fire!() click to toggle source
# File lib/space_invaders/behaviors/fireable.rb, line 13
def fire!
  bullet = Bullet.new(shooter, bullets_going_down?, bullet_collection, bullet_offset_speed)
  sound.play
end
shooter() click to toggle source
# File lib/space_invaders/behaviors/fireable.rb, line 18
def shooter
  raise NotImplementedError.new("You must implement the inherited shooter method")
end
sound() click to toggle source
# File lib/space_invaders/behaviors/fireable.rb, line 22
def sound
  raise NotImplementedError.new("You must implement the inherited sound method")
end