mirror of
https://github.com/charmbracelet/harmonica.git
synced 2026-07-20 02:29: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 {
|
type model struct {
|
||||||
projectile harmonica.Projectile
|
projectile *harmonica.Projectile
|
||||||
pos harmonica.Point
|
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
|
// NewProjectile accepts a frame rate, and initial values for position, velocity, and acceleration and
|
||||||
// returns a new projectile.
|
// returns a new projectile.
|
||||||
func NewProjectile(deltaTime float64, initialPosition Point, initialVelocity, initalAcceleration Vector) Projectile {
|
func NewProjectile(deltaTime float64, initialPosition Point, initialVelocity, initalAcceleration Vector) *Projectile {
|
||||||
return Projectile{
|
return &Projectile{
|
||||||
pos: initialPosition,
|
pos: initialPosition,
|
||||||
vel: initialVelocity,
|
vel: initialVelocity,
|
||||||
acc: initalAcceleration,
|
acc: initalAcceleration,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user