36 lines
418 B
Go
36 lines
418 B
Go
package main
|
|
|
|
import "github.com/gdamore/tcell/v2"
|
|
|
|
const (
|
|
Up = iota
|
|
Left
|
|
Right
|
|
Down
|
|
)
|
|
|
|
type Position struct {
|
|
x int
|
|
y int
|
|
}
|
|
|
|
type Player struct {
|
|
position Position
|
|
moves int
|
|
teleports int
|
|
}
|
|
|
|
type Robot struct {
|
|
position Position
|
|
}
|
|
|
|
type Game struct {
|
|
screen tcell.Screen
|
|
style tcell.Style
|
|
keypresses chan int
|
|
player Player
|
|
robots []Robot
|
|
trash []Position
|
|
gameover int
|
|
}
|