types.go 458 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 Game struct {
  25. screen tcell.Screen
  26. style tcell.Style
  27. keypresses chan int
  28. player Player
  29. level int
  30. robots []Position
  31. trash []Position
  32. gameover int
  33. }