- use toggle tile for all toggling entities (transient, switch, door)
- get rod of hard coded sprites (exception: particle class, to be
  fixed later)
- changed switch sprite (rect instead of elipse)
This commit is contained in:
2024-03-31 20:16:15 +02:00
parent f6f2172f11
commit faf0fd99c2
24 changed files with 334 additions and 339 deletions

View File

@@ -7,6 +7,7 @@ import (
// virtual location, aka tile address
type Renderable struct {
Pos *Position // just for debugging, will not used as positiion!
Image *ebiten.Image
DamageImage *ebiten.Image
Damaged int

View File

@@ -1,24 +1,10 @@
package components
import (
"log"
"github.com/hajimehoshi/ebiten/v2"
)
type Transient struct {
Activated bool
Sprites []string
Current int // sprite index
}
func (trans *Transient) GetNext() string {
if len(trans.Sprites) > trans.Current {
trans.Current++
return trans.Sprites[trans.Current]
}
log.Fatalf("not enough sprites in transient tile, have %d sprites, index requested: %d",
len(trans.Sprites), trans.Current+1,
)
return ""
Wall *ebiten.Image
}