Python RGB Matrix games and animations https://www.xythobuz.de/ledmatrix_v2.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

camp_small.py 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. if __name__ == "__main__":
  9. from splash import SplashScreen
  10. from draw import ScrollText
  11. from solid import Solid
  12. from life import GameOfLife
  13. from net import CheckHTTP
  14. from image import ImageScreen
  15. from qr import QRScreen
  16. from manager import Manager
  17. url = "http://ubabot.frubar.net"
  18. import util
  19. t = util.getTarget()
  20. splash = SplashScreen(t)
  21. t.loop_start()
  22. splash.draw()
  23. t.loop_end()
  24. success = Manager(t)
  25. success.add(ImageScreen(t, "drinka.gif", 0.2, 2, 20.0))
  26. success.add(Solid(t, 1.0))
  27. success.add(QRScreen(t, url, 30.0, "Order:"))
  28. success.add(Solid(t, 1.0))
  29. fail = Manager(t)
  30. fail.add(ImageScreen(t, "attention.gif", 0.2, 2, 20.0, (0, 0, 0)))
  31. fail.add(ScrollText(t, "The UbaBot Cocktail machine is currently closed. Please come back later for more drinks!", "ib8x8u", 2))
  32. fail.add(Solid(t, 2.0))
  33. fail.add(GameOfLife(t, 20, (0, 255, 0), (0, 0, 0), None, 2.0))
  34. fail.add(Solid(t, 2.0))
  35. d = CheckHTTP(url)
  36. d.success(success)
  37. d.fail(fail)
  38. t.debug_loop(d.draw)