Brought in screen manager, minor refactor.

This commit is contained in:
2024-11-11 09:54:30 -05:00
parent 9130155999
commit 6f794b7bb2
21 changed files with 373 additions and 170 deletions

34
elements/projectile.go Normal file
View File

@@ -0,0 +1,34 @@
package elements
import (
"math"
"mover/gamedata"
)
type Projectile struct {
Pos gamedata.Coordinates
Velocity float64
a float64
}
func NewProjectile(origin gamedata.Coordinates, angle, velocity float64) *Projectile {
return &Projectile{
Velocity: velocity,
a: angle,
Pos: origin,
}
}
func (p *Projectile) Update() {
dx := p.Velocity * math.Cos(p.a)
dy := p.Velocity * math.Sin(p.a)
p.Pos.X += dx
p.Pos.Y += dy
}
func (p *Projectile) Draw() {
}