class

Harmonica::Projectile

Inherits Reference < Object

Projectile is the representation of a projectile that has a position on a plane, an acceleration, and velocity.

Constructors

new(delta_time : Float64, initial_position : Point, initial_velocity : Vector, initial_acceleration : Vector)

Creates a new projectile. It accepts a frame rate and initial values for position, velocity, and acceleration.

Source

Instance methods

acceleration
Source
delta_time
Source
position
Source
update

Updates the position and velocity values for the given projectile. Call this after calling .new to update values.

Source
velocity
Source