rowboz/trash.go

26 lines
449 B
Go

package main
func (game *Game) drawTrash() {
for _, t := range game.trash {
game.screen.SetContent(t.x, t.y, '*', nil, game.style)
}
}
func (game *Game) onTrash(pos Position) bool {
var found bool
for _, t := range game.trash {
if t.x == pos.x && t.y == pos.y {
found = true
}
}
return found
}
func (game *Game) addTrash(pos Position) {
game.trash = append(game.trash, pos)
}
func (game *Game) cleanTrash() {
game.trash = nil
}