types.go 466 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package main
  2. import "github.com/gdamore/tcell/v2"
  3. const (
  4. Up = iota
  5. Left
  6. Right
  7. Down
  8. upleft
  9. upright
  10. downleft
  11. downright
  12. teleport
  13. )
  14. type Position struct {
  15. x int
  16. y int
  17. }
  18. type Player struct {
  19. position Position
  20. moves int
  21. teleports int
  22. }
  23. type Robot struct {
  24. position Position
  25. }
  26. type Game struct {
  27. screen tcell.Screen
  28. style tcell.Style
  29. keypresses chan int
  30. player Player
  31. robots []Robot
  32. trash []Position
  33. gameover int
  34. }