types.go 516 B

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