Python RGB Matrix games and animations https://www.xythobuz.de/ledmatrix_v2.html
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

games.py 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/usr/bin/env python3
  2. # ----------------------------------------------------------------------------
  3. # "THE BEER-WARE LICENSE" (Revision 42):
  4. # <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
  5. # you can do whatever you want with this stuff. If we meet some day, and you
  6. # think this stuff is worth it, you can buy me a beer in return. Thomas Buck
  7. # ----------------------------------------------------------------------------
  8. camp_pink = (251, 72, 196)
  9. camp_green = (63, 255, 33)
  10. from splash import SplashScreen
  11. from scroll import ScrollText
  12. from solid import Solid
  13. from life import GameOfLife
  14. from net import CheckHTTP
  15. from image import ImageScreen
  16. from qr import QRScreen
  17. from snake import Snake
  18. from gamepad import InputWrapper
  19. from manager import Manager
  20. from tetris import Tetris
  21. import util
  22. url_uba = "http://ubabot.frubar.net"
  23. url_printer = "http://i3-am8.fritz.box"
  24. scroll_speed = 50
  25. # Need to import InputWrapper before initializing RGB Matrix on Pi
  26. i = util.getInput()
  27. t = util.getTarget(i)
  28. # Loading fonts and graphics takes a while.
  29. # So show a splash screen while the user waits.
  30. splash = SplashScreen(t)
  31. t.loop_start()
  32. splash.draw()
  33. t.loop_end()
  34. # Main "Menu"
  35. m = Manager(t, i)
  36. m.add(GameOfLife(t, 20, (0, 255, 0), (0, 0, 0), None, 2.0))
  37. m.add(Solid(t, 1.0))
  38. m.add(Tetris(t, i,))
  39. m.add(Solid(t, 1.0))
  40. m.add(Snake(t, i, camp_pink, camp_green))
  41. m.add(Solid(t, 1.0))
  42. m.restart()
  43. util.loop(t, m.draw)