mirror of
https://github.com/charmbracelet/harmonica.git
synced 2026-07-19 10:09:33 -06:00
Return pointer to projectile from NewProjectile
This commit is contained in:
parent
ea1f87748a
commit
33fdf985b9
@ -31,7 +31,7 @@ func wait(d time.Duration) tea.Cmd {
|
||||
}
|
||||
|
||||
type model struct {
|
||||
projectile harmonica.Projectile
|
||||
projectile *harmonica.Projectile
|
||||
pos harmonica.Point
|
||||
}
|
||||
|
||||
|
||||
@ -54,8 +54,8 @@ var TerminalGravity = Vector{0, 9.81, 0}
|
||||
|
||||
// NewProjectile accepts a frame rate, and initial values for position, velocity, and acceleration and
|
||||
// returns a new projectile.
|
||||
func NewProjectile(deltaTime float64, initialPosition Point, initialVelocity, initalAcceleration Vector) Projectile {
|
||||
return Projectile{
|
||||
func NewProjectile(deltaTime float64, initialPosition Point, initialVelocity, initalAcceleration Vector) *Projectile {
|
||||
return &Projectile{
|
||||
pos: initialPosition,
|
||||
vel: initialVelocity,
|
||||
acc: initalAcceleration,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user