Refactor to use better interfaces and event callbacks.

This commit is contained in:
2024-11-15 16:11:45 -05:00
parent 4ced75d66c
commit cbc4ba5eb3
16 changed files with 1009 additions and 14 deletions

23
elements/enemies.go Normal file
View File

@@ -0,0 +1,23 @@
package elements
import (
"mover/gamedata"
"github.com/hajimehoshi/ebiten/v2"
)
type Enemies interface {
Update() error
Draw()
GetPosition() gamedata.Coordinates
SetPosition(gamedata.Coordinates)
SetTarget(gamedata.Coordinates)
GetSprite() *ebiten.Image
GetEnemyState() gamedata.EnemyState
SetHit()
SetToggle()
IsToggled() bool
SetTouched()
ClearTouched()
IsTouched() bool
}