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() {

}
