DEV Community

Cover image for Building Chrome Dinosaur Game in Pygame (Part 6: Press Pause ⏸️)
Chukwuemeka Ngumoha
Chukwuemeka Ngumoha

Posted on

Building Chrome Dinosaur Game in Pygame (Part 6: Press Pause ⏸️)

If you’ve been following this series, you know we’ve come a long way — from setting up Pygame, to making the Dino jump with gravity, to scrolling horizons, and even adding randomized obstacles. 🎉

At this point, I originally planned to dive into collision detection, but I realized something important: trying to build the game and explain every step in a tutorial format was slowing me down. Instead of dragging things out, I’d like to pause here and wrap up this mini-project by sharing what I’ve learned so far.

This way, you still get the value (and a complete game skeleton to build on), and I can move on to exploring even bigger and better projects in Pygame and learning more in the process. We all win

In this post, I’ll:

  • Recap the main things we built together
  • Highlight the key Pygame concepts I learned
  • Point you toward how you can handle collision detection on your own
  • Share what’s next for me

Alright, let's dive in one last time !


Our game so far

Even as a work in progress, our game is still awesome. In the course of the series, we were able to:

  • Set up the game project and installed relevant dependencies. In the process:

    • We learned how to install Pygame
    • We learned what Pygame is all about
  • Started working with Pygame:

    • Learning how to work with a simple Pygame boilerplate. Specifically, what each part of the boilerplate does.
    • Ran the code and saw the canvas for the first time.
    • Got introduced to the concept of Surfaces and changing the background color of the canvas.
  • Created a progressively unfolding pathway for the Dino. In the process:

    • We learned about the Coordinate system in Pygame and it's use in positioning game elements on the canvas.
    • We learned how to display images on the canvas.
    • We learned about the concept of a Refresh Rate and how to control it in Pygame.
    • We learned about using offsets to push game elements along the horizontal x axis on the canvas, giving an illusion of motion.
  • Placed our Dinosaur on the open road and let it run wild. In the process:

    • We learned how to scale the width and height of images we display on the canvas.
    • We learned about Events and how we can create custom events and read them within the event checking loop.
    • We also learned how to repeatedly send events on to the event queue and used that knowledge to make the Dino move it's legs. That was a really cool lesson.
    • We also used all we learned to ensure that game play only starts once the user presses the SPACE key.
  • We made our Dinosaur jump in order to avoid obstacles. In the process:

    • We learned how to asynchronously listen to key presses on the keyboard. And then, we used this functionality to vary how high the Dinosaur jumped based on how long the SPACE key was pressed.
    • We also learned how to create bounding boxes around game elements in order to be able to use these bounding boxes to dynamically control the positions of said elements.
  • Finally, we added the deadly obstacles on the Dino's path. In the process:

    • We worked with the pygame.event.Event() object and learned how to trigger Pygame events based on a condition.

Look at us! We’ve covered a lot, and you now have a neat little game skeleton you can keep building on.


Why I'm pausing the series

When I started this series, my goal was simple: learn Pygame by building something fun and familiar — a Chrome Dino clone — and share that journey step by step. Along the way, I discovered that writing each post in a full tutorial style while still figuring things out for myself was slowing me down more than I expected.

Instead of staying in the flow of building, I often found myself splitting focus between coding mode and teaching mode. That back-and-forth made progress on the actual game feel slower, and I realized I was spending more time explaining every detail than experimenting, failing fast, and moving forward.

So, rather than drag out the series and burn myself out, I decided to call this post an intermission. The game in its current form already demonstrates a lot of Pygame fundamentals — events, image handling, motion through offsets, and obstacle generation. That’s a strong foundation, and it feels like a natural point to pause.

This doesn’t mean I’m done with Pygame. Quite the opposite. I want to take what I’ve learned here and channel it into a bigger, more ambitious project where I can dive deeper without the pressure of writing a tutorial for every step.

Forgive me, dear reader — for even I could not escape the limits of being human.


If you’ve been following along, thank you — I hope you picked up some insights you can use in your own projects. And don’t worry: I’ll still be sharing what I build next, just in a format that works better for both me and you.

To access the complete codebase for this project, please check out the Github repo. Give the repo a star ⭐ if this series has helped, entertained or educated you in any way. And for now:

Thanks for reading.

Top comments (0)