7 comments for “Tetris on a Raspberry Pi using the PiLite

  1. Thank you for publishing this, really works well 🙂
    Been looking for things to show off the Pilite and this does it very well.
    Steve

  2. Hi – thanks for sharing the game! I`m a beginner in Python and now I try to figure out what each line does by messing around with the code. For example, I tried to make the game start again after it ends, but I couldn`t figure it out. Could you please tell me how to do that? Love your blog – greetings from Germany!

    • Hello Germany! 🙂 I *think* you want to put the main game loop (129-225) inside a function. Then, call that function to start the game off. You then need to NOT call pygame.quit() and sys.exit() but instead have the function call itself again. Or, you have the initial function call inside a While True: loop. There’s a couple of different ways to do it. I haven’t got a PiLite myself to try it out otherwise I’d do it and show you. Let me know how you get on!

      • Hi guys,
        I’d advise against the function calling itself over and over again, because resources will be used on each call and never freed. Using ‘While True’ would definitely be better.
        Stephen

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.