Method: BulletPhysics#initialize

Defined in:
lib/entities/components/bullet_physics.rb

#initialize(game_object, object_pool) ⇒ BulletPhysics

Returns a new instance of BulletPhysics.



5
6
7
8
9
10
11
12
13
# File 'lib/entities/components/bullet_physics.rb', line 5

def initialize(game_object, object_pool)
  super(game_object)
  x, y = point_at_distance(START_DIST)
  object.move(x, y)
  @object_pool = object_pool
  if trajectory_length > MAX_DIST
    object.target_x, object.target_y = point_at_distance(MAX_DIST)
  end
end