class Asteroids::Missile

Attributes

angle[RW]
lifespan[RW]
radius[RW]
ship[RW]
vel_x[RW]
vel_y[RW]
x[RW]
y[RW]

Public Class Methods

new(ship, object_pool, x, y, vel_x, vel_y, angle) click to toggle source
Calls superclass method Asteroids::GameObject::new
# File lib/asteroids/missile/missile.rb, line 6
def initialize(ship, object_pool, x, y, vel_x, vel_y, angle)
  super(object_pool)
  @x = x
  @y = y
  @angle = angle
  @vel_x = vel_x
  @vel_y = vel_y
  @lifespan = 3
  @radius = 3
  @ship = ship
  @physics = MissilePhysics.new(self, object_pool)
  @graphics = MissileGraphics.new(self)
end