Changes:
- 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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user