Added ring/elimination mechanic.
This commit is contained in:
@@ -14,12 +14,14 @@ type Block struct {
|
||||
position gamedata.Coordinates
|
||||
target gamedata.Coordinates
|
||||
hit bool
|
||||
clr color.RGBA
|
||||
}
|
||||
|
||||
func NewBlock() *Block {
|
||||
return &Block{
|
||||
Sprite: ebiten.NewImage(20, 20),
|
||||
cycle: 0,
|
||||
clr: color.RGBA{R: 0xff, G: 0x00, B: 0x00, A: 0x00},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,11 +42,7 @@ func (b *Block) Update() {
|
||||
|
||||
func (b *Block) Draw() {
|
||||
b.Sprite.Clear()
|
||||
if !b.hit {
|
||||
b.Sprite.Fill(color.RGBA{R: 0xff, G: 0x00, B: 0x00, A: 0x00})
|
||||
} else {
|
||||
b.Sprite.Fill(color.RGBA{R: 0x00, G: 0xff, B: 0x00, A: 0xff})
|
||||
}
|
||||
b.Sprite.Fill(b.clr)
|
||||
}
|
||||
|
||||
func (b *Block) SetPosition(pos gamedata.Coordinates) {
|
||||
@@ -63,10 +61,10 @@ func (b *Block) GetTargetosition() gamedata.Coordinates {
|
||||
return b.target
|
||||
}
|
||||
|
||||
func (b *Block) SetHit(hit bool) {
|
||||
b.hit = hit
|
||||
}
|
||||
|
||||
func (b *Block) GetHit() bool {
|
||||
return b.hit
|
||||
}
|
||||
|
||||
func (b *Block) SetColor(clr color.RGBA) {
|
||||
b.clr = clr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user