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

42
elements/explosion.go Normal file
View File

@@ -0,0 +1,42 @@
package elements
import "mover/gamedata"
type Explosion struct {
Radius float64
Origin gamedata.Coordinates
cycle int
Active bool
}
func NewExplosion() *Explosion {
return &Explosion{
cycle: 1,
Active: false,
}
}
func (e *Explosion) Draw() {
}
func (e *Explosion) Update() {
if e.Active {
e.Radius = float64(e.cycle) / 0.15
e.cycle++
}
}
func (e *Explosion) SetOrigin(origin gamedata.Coordinates) {
e.Origin = origin
}
func (e *Explosion) ToggleActivate() {
e.Active = !e.Active
}
func (e *Explosion) Reset() {
e.cycle = 1
}