Create a Simple Video Game with Pygame - Step by Step Tutorial for Python Beginners!

preview_player
Показать описание
Today we will learn the basics of Pygame by creating a simple car game from scratch! 🚗

⭐ This video is brought to you by Anvil ⭐

📃 IMPORTANT NOTES 📃
This tutorial is a 100% beginner friendly! 💯💯💯
It's designed for folks with the most basic knowledge of Python (are you familiar with integers, lists, tuples, while loops, for loops and if statements? no need to be an expert, but as long as you have a basic understanding of these concepts - this tutorial is perfect for you! 😀)

So on today's menu, we will:
⭐ learn how to draw shapes in Pygame
⭐ learn how to work with images in Pygame
⭐ learn how to use relative coordinates
⭐ learn how to animate Pygame elements
⭐ learn how to create keyboard events
⭐ learn how to increase the game difficulty overtime

🐍 INSTALL PYGAME 🐍
____________________________________
FOR NEWER VERSIONS OF PYTHON
⭐ pip install pygame
FOR OLDER VERSIONS OF PYTHON (& ANACONDA)
⭐ conda install -c cogsci pygame

⚒️ RELATED TUTORIALS ⚒️
____________________________________
⭐ My ultimate guide to Anaconda:

⭐ For Loops For Beginners:

⭐ Convert Colours to Numbers:

⭐ My Simple Calculator App with Anvil:

⏰ TIME STAMPS ⏰
____________________________
00:00 - intro
00:54 - create Pygame window
03:13 - run Pygame app with Anaconda
04:02 - set background colour
04:51 - set window title
05:27 - what is relative coordinates?
06:35 - draw rectangles with Pygame
07:24 - use coordinates in Pygame
11:22 - relative coordinates example
12:00 - use images in Pygame
15:50 - keyboard events in Pygame
18:48 - animation in Pygame
20:46 - random events in Pygame
23:07 - end game logic in Pygame
25:13 - game levels logic
25:58 - introduction to Anvil
26:44 - increase game difficulty over time
28:32 - thanks for watching!

🔗 IMPORTANT LINKS 🔗
____________________________
⭐ Complete Tutorial Code:

⭐ Pygame Documentation:

⭐Vehicle Images by:

😁 THANKS FOR WATCHING! 😁
Рекомендации по теме
Комментарии
Автор

Dear Mariya, width // 1.6 and Int( width / 1.6 ) gives exactly the same result. Tested many times and I always use the first solution.

lukajeliciclux
Автор

Very nice tutorial! I love how thought through the process seems while still keeping it light and fun. I also like the fact that you actually create a working game before the sponsor ad is run as it keeps the flow and add bonus instead of making the video into a two part one like most of the creators seem to do. The only thing i would add in a beginners guide is a ToDo list commented into the code for easy progression and structured work flow.

argosy
Автор

You really do a way better job teaching coding than other channels. Other tutorials are the same old scripts over and over never really explaining the syntax, just saying "type this" .. keep up the awesome work!

joepetrakis
Автор

You rock! I'm teaching python to my 9 y.o. I taught him Scratch when he was 7 y.o., and now it's time for him to learn a real programming language. But all the talk of strings and arrays are not at all interesting to a child. We tried a snake program, but it lacked line numbers and contained several errors. Then I found your channel and you're awakening the 9 y.o. within me, making coding fun again! 👍🙂👍

TRUESTORIES-YT
Автор

Great tutorial. You’re covering what I’m doing with my school aged son, but you’re way quicker and more accurate. He’ld love it if he got to your level one day. You’re a great role model.

davidianmusic
Автор

Thanks for this tutorial Maria! I'm going to make some minor changes (add a motorcycle and sand instead of a second car and grass) and add it to an upcoming video I have for a podcast episode on the book 'Zen and the Art of Motorcycle Maintenance'. I will link back to this video for my viewers that are interested in creating games with Pygame. Nice t-shirt too by the way!

ChaosArtist
Автор

I really love your tutorials on Python. You make complex programming syntax look easy. Huge thumbs up.

kachiimo
Автор

Mariya, thank you very much for you help with this tutorial. Your teaching style is very clear and concise. Much appreciated.

ezekielthemack
Автор

I watched the entire thing, it's a great introduction and looks like pygame is the way to go for a little dice roll app I'm making.

JorgeEscobarMX
Автор

Kinda genius, I managed to complete the tutorial and got a lot out of it. Thank you!

javascriptes
Автор

It was very interesting!
Thanks for another great guide!
Also I loved the shirt! 😁

balazsberes
Автор

dear mariya! you, re great i have learnt many things from your it up and upload these type of videos😍😍😀😍👍

vineetsoni-vkmn
Автор

Thanks to your tutorial, Mariya, I've managed to draft my own version of River Raid, something I've been desiring to do for the last 30 years 🤪😇

bvideoz
Автор

Mariya, sorry I had to leave the lesson earlier. I just finished watching it now and this helped me a toooon. Also, I checked your mic and looks awesome. I hope it sound as good as it looks. If you have questions about EQ your voice, don't hesitate to ask. Again, thank you for the lesson 😊

ryuyasho
Автор

Thank you so much. Just finished making the game. Took me like 4 hours but yeah. Progress. Haha

J_Shingy
Автор

I've been working on a game (in finger quotes) that also involves a stream of vehicles for what seems like a really long time. Some it's become really complex and doesn't work half the time. And yours seems to comparatively simple versus mine. I mean mine was made partially to help learn things like OOP. But it is jarring to seem something so simple do what I can only sometimes do in so few lines. So thanks for that.

tildesarecool
Автор

You understand very decent all the process while you are creating the video game.Also your English are very comprehensive!!

johnniewalkerjohnniewalker
Автор

I had no idea Pygame finally moved to Python 3. Like your other videos this is clear and straight to the point. Excellent work, and thank you!

LeftoverBeefcake
Автор

Thank you Mariya for the tutorial, much appreciate

jefflee
Автор

So it’s always an exciting moment to learn with you ❤ I’m not a native English speaker but i understand easily when you explain something 🎉Be blessed

From 🇭🇹

wiljamesonpl