types.go 481 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. score int
  21. moves int
  22. teleports int
  23. }
  24. type Robot struct {
  25. position Position
  26. }
  27. type Game struct {
  28. screen tcell.Screen
  29. style tcell.Style
  30. keypresses chan int
  31. player Player
  32. robots []Robot
  33. trash []Position
  34. gameover int
  35. }