If you are getting an error like "no module named pygame" or "pip is not recognised", then there may be an issue with your python install. This short video shows how to fix those errors: kzbin.info/www/bejne/ZqnCfniBp5WCgLM
@confidenceart127 ай бұрын
You haven't had your python run to paths
@pretzelshi2 ай бұрын
Whenever I run the command, nothing happens, not even text appears
@XTheGreenWeenieX2 күн бұрын
@@confidenceart12 I've done this and it still wont recognize python. I have been struggling to get it to install that it is detering me to start learning.
@confidenceart122 күн бұрын
@@XTheGreenWeenieX try using instructions from chatgpt to add your python to path on your machine
@PyroProtato Жыл бұрын
Genuinely, you’re a lifesaver. I was stressing so much about the complexity of Pygame, but this tutorial gave me such a good start. Thanks!
@CodingWithRuss Жыл бұрын
Glad it helped!
@ChrisMaster211 ай бұрын
I've made FlapPy Bird, but it was from a sample. Now, I'm watching this video to truly learn.
@GirduzzYT7 ай бұрын
I’m trying to make Tetris and you helped me a lot
@erie96915 күн бұрын
this is AMAZING !!!!! as someone with no experience i learned SO much SO quickly. this might be the best tutorial ive found
@CodingWithRuss14 күн бұрын
Thanks you! Glad you found it useful.
@laura-vara9 ай бұрын
I've been studying Data Analytics and been skipping Python so much to learn other things due to the Syllabus, and I really wanted to go back to learn more about the functionality of Python for other things. This tutorial made it fun, with concepts I am familiar with, but just focusing on other cool things we can do with Python. Thank you so much! It lightened my face and made my day.
@fumainc.4403 Жыл бұрын
I can say as a beginner to pygame and pythoon as a whole. This was a easy tutorial to follow.
@drnazishimran4 ай бұрын
Thanks bro. I just learned Python and wanted to try out some graphics. Most videos are like 30-60 minutes and don't have clear explanations, but this video explains everything in a great way in just 10 minutes! Awesome video
@CodingWithRuss4 ай бұрын
Nice! Glad to hear it helped. I've got plenty of long tutorials too but this one gets you started quickly.
@aimeeh20794 ай бұрын
Oh my gosh I've been meaning to get into proper coding after Scratch and this is suchhh a good tutorial I'm so excited with the possibilities! Thank you Russ
@CodingWithRuss4 ай бұрын
You're welcome :)
@giorgioclavelli175725 күн бұрын
Very well done tutorial: short enough to keep your attention and very well explained! Liked and subscribed.
@theafro11 ай бұрын
Brilliant! this is what a tutorial should be, neither over nor under-explaining. (and now I have a natty little red box on my screen and i'm going to make it eat things now!)
@Programm3r15 күн бұрын
Been programming python for data analytics, didn't want to learn c# just to make a game for when I'm bored, but this tutorial helped a ton with understanding the library! Thanks!
@CodingWithRuss14 күн бұрын
Nice! Glad you liked it
@jpopperman93692 ай бұрын
It literally took me 10 minutes following this video. Thanks so much! What a confidence booster this was!
@CodingWithRuss2 ай бұрын
Glad to hear it :)
@CodingPiratesHillerod11 ай бұрын
One of the best explanations of the needed basic elements to start a Pygame project. Thanks a bunch!
@CodingWithRuss11 ай бұрын
Thanks!
@Animalistic_ Жыл бұрын
Im following your platformer tutorials they are great! I started coding 9 daysa ago and they are easy to follow and awseome! at school we were learning about print('hello world') and its so cool seeing myself progress with your tutorials as you explain whats happening so im learning not just copying thanks you so so much your awsome
@CodingWithRuss Жыл бұрын
That's great to hear! Glad you are enjoying the tutorials.
@cloudedpotatoplays9199 ай бұрын
I started using Python for my work as a scientist and now I can also use if for my passion of games :D thank you alot for this introduction!
@NileshDarsan7 ай бұрын
thanks, I needed to draw rectangles for a chart so I thought to use pygame and this is the only tutorial that is not an hour long, lifesaver
@CodingWithRuss7 ай бұрын
Glad it helped :)
@m0th.shroommm10 ай бұрын
Dude, this was freaking fun. Thanks for the tutorial. It may look like it is from the Atari years, but the feeling of creating this is great!. Cheers!
@CodingWithRuss10 ай бұрын
Thanks! Glad to hear you liked it
@testAjitSNU5 ай бұрын
What a simple concise tutorial. Loved it.
@ilikepissuwu5 ай бұрын
he's not gonna see you lil bro
@Derpfulness2 ай бұрын
Thanks a ton for making this man, this boost me so far ahead in learning pygame
@CodingWithRuss2 ай бұрын
Thanks! Glad it helped
@ethanforman98504 ай бұрын
this is great! just got started in python and this is literally the first video (of many) I've come across that performed exactly as you explained. and everything made sense! thank you.
@mysterious_monolith_ Жыл бұрын
I think you're the best teacher I've found. Thanks for this video.
@CodingWithRuss Жыл бұрын
Thank you! Glad you liked it
@tacobeartaco7140 Жыл бұрын
This was the best 101 I've found so far. You've got yourself a new subscriber.
@CodingWithRuss Жыл бұрын
Thanks!
@pastellamayday Жыл бұрын
tsym for this tutorial king :> the simplicity in the explanation helped a ton, finally gonna be able to make games with screens rather than pure text inputs T>T
@CodingWithRuss Жыл бұрын
Glad you liked it
@okeomaikwuegbu8 ай бұрын
Thank you so much, I was clicking video after video until I saw yours. Great work!
@iwozz10448 ай бұрын
I wanted to try pygame and this video helped me with understanding pygame. Thanks!
@blacklight6376Ай бұрын
should I install Python 3.13.0 the latest version or 3.11.1 ??? I'm confused!!!
@iwozz1044Ай бұрын
@@blacklight6376 pretty sure you should install latest
@AB-rh5yq4 ай бұрын
This worked so well. I’m excited to code alongside your other videos
@DrDuck005 Жыл бұрын
Great tutorial. Perfect for peoples who never used pygame before what to know how to get started.
@CodingWithRuss Жыл бұрын
Thanks!
@vdBlogMaster6 ай бұрын
This is an amazing tutorial and great explanation! I can understand every line of the code and why it was written. Thank you so much!
@CodingWithRuss6 ай бұрын
Thank you! Glad to hear it makes sense
@yvonnevarley6351 Жыл бұрын
Hi, Russ! Thanks for this. FYI, in Thonny, you have to capitalise the True and False in the code for it to work.
@igoratagyan66647 ай бұрын
Great tutorial, thank you very much! I played the final result for about 15 minutes!
@MJ-ly1cv4 ай бұрын
thank you for the tutorial! i am in a (very) begginer state regards python, so some of the code's modules (i hope that's what they're called im so sorry 😭😭) are new to me and i thought i wasn't going to understand, but you explained it so well!! thank you very much :) i really wanted to try out making games, it seems fun
@CodingWithRuss4 ай бұрын
Thanks! I really wanted to make it easy to follow so I'm glad to hear it all made sense. Good luck with your game projects. Pygame is really flexible and you can make lots of different types of games with it.
@katie-e7z7f6 ай бұрын
great video, about to start trying to code a little game in python and this helped a lot! keep up the good work!!!
@CodingWithRuss5 ай бұрын
Glad you liked it!
@garrettbodily2 ай бұрын
This is a great "Hello World" for pygame! Thank you!
@Cr3ckedАй бұрын
Thank You, Altough It Will Still Take 2 Days To Revise, I Needed A Reasonably Good Tutorial. JUST What I Was Looking For!
@Master_Ed Жыл бұрын
personally I'd not use elif for the movement so you can move diagonally
@dminikkk Жыл бұрын
How do you do it then?
@pukeblo4382 Жыл бұрын
@@dminikkkyou could just do separate if statements for each directions
@Smart_Snorlax Жыл бұрын
Thanks this was so helpful
@leoelkin3036 Жыл бұрын
@@pukeblo4382but that means moving diagonally is quicker than sideways
@dallako Жыл бұрын
@@dminikkkif up elif down if left elif right 2 if statements and 2 else ifs
@P0isonw0lf10 ай бұрын
Straight to the point and crystal clear, thanks alot !
@Pantagana90005 ай бұрын
Woooow, so much code for such a "simple" task . How the hell you got all that knowledge ! Thanks
@judelfenix19499 ай бұрын
brooo you're so goodddddddddd i understand all and now i can start project. thank you so much
@CodingWithRuss9 ай бұрын
Glad it helped :)
@tubetimppa707123 күн бұрын
amazing tutorial, super easy to follow and understand
@Max_AE25 күн бұрын
Great Video! Very well explained!
@enigma69253 ай бұрын
Thanks, Great tutorial, easy to follow and works great, I'm running on Windows 11 using Geany 🙂
@CodingWithRuss3 ай бұрын
Nice! Glad to hear it :)
@mrblock131811 ай бұрын
Simple. Clear. Effective
@electricanimations618318 күн бұрын
2:50 If an error appears that says it cant find "__main__" module, you need to name your code file (the thing that you are inputting everything into right now) something like "main.py". Im not sure if it HAS to be called main, but it definitely needs the .py at the end.
@ToujoursIris Жыл бұрын
Glad to see you back!
@CodingWithRuss Жыл бұрын
Thanks, it's been a while! You even changed your name :)
@ToujoursIris Жыл бұрын
@@CodingWithRuss it sure has been a while and yeah i changed my name :))
@GabTheGamerGT Жыл бұрын
Thank You so Much! This Helped Me Improve My Python Skills a Lot!
@CodingWithRuss Жыл бұрын
Great to hear!
@LMGstudios-qp3ld11 ай бұрын
THANK YOU SO MUCH now i can start my dream job because of you😄
@Zenlayne2 ай бұрын
Epic tutorial, just what I needed
@CodingWithRuss2 ай бұрын
Thanks :)
@StanTxc Жыл бұрын
Hi, russ. I am happy to say that I finally made my first game completely on my own using the knowledge I got from all of your wonderful tutorials. I am giving you recommendations about tutorials that I would like to watch: again a tower defense game where you place towers on the map that shoot at the coming enemies, an upgrade system for them, wave calculating system for the enemies so that the waves are infinite and get harder with each wave. One other tutorial that I would love to watch and I can't find anywhere is about making popping score that appears, floats up and disappears shortly or just disappears after a while or even fades away. Maybe even randomize the size of the numbers, the rotation, the speed and so on . I know that you made a similar thing for your rpg game tutorial, but maybe you can expand on it. Also a game I'm really interested in making is a tower defense, but one where you have to buy troops that go and attack the enemy castle and defend from the enemy troops, im sure that you know of such games. I know how hard it is to make such tutorials and I appreciate your hard work, so I understand if you can't make them. Thats all, thank you for being such an awesome creator, keep it up 👍
@CodingWithRuss Жыл бұрын
Thanks a lot! Great to hear you've been working on your own projects, it's satisfying to create something yourself. I've not been able to focus on coding/youtube so much for a few months now but I keep trying to get back to it. I do actually have the tower defence game on my list of ideas so it's there in my plans to do someday :)
@tristandombroski9677 Жыл бұрын
I think a tower defense is a good milestone for novice programmers, that is where I am almost at myself.
@StanTxc Жыл бұрын
@@tristandombroski9677 Indeed i am also looking forward to the tower defense tutorial
@ComplexDodoYT Жыл бұрын
When I open up the program after the code at 7:30 it does not show the red box till I close the program 😕😕😕
@Warlock_71011 ай бұрын
What probably happened is that your pygame.display.update is under the quit program I had that problem too. What helped me was to put a extra line with enter
@asherphoenix558411 ай бұрын
mine keeps on not responding after i added the movement components. any clues what might be going on?
@3sides-o2b3 ай бұрын
Very good tutorial bro!
@CodingWithRuss3 ай бұрын
Thanks!
@3sides-o2b3 ай бұрын
@@CodingWithRuss Even though I wanna learn pygame,and you godot, try making Bomberman at one time!
@anartxx15839 ай бұрын
Bro actually i am new in programming so i dont know much about it but when i use commands like Import , init etc It doesnt show the colour like purplish as it shows urs Plz help me out of this
@elsyndur4415 Жыл бұрын
Hmm... I have PyGame installed, but when I try to run the code it says, "No module named 'pygame'".
@specktyplays446710 ай бұрын
try another code editor like notepad++
@meiscoolbutmo2 ай бұрын
I don't have any problems with this. For me this works really well and it's super cool i think
@Thesportymouse97310 күн бұрын
hey russ just wanna ask how do you run the program like what do you click
@CodingWithRuss Жыл бұрын
Hello folks! Visit codingwithruss.com/tutorial/getting-started to get the code and a quick reference of what was covered in this video.
@shenfon013 ай бұрын
i am sorry to ask but when i type pygame.init,it said init was not in the pygames(AttributeError: partially initialized module 'pygame' has no attribute 'init' (most likely due to a circular import)),i want to know what happened?
@jerrychandler7094 Жыл бұрын
I copied your code exactly, but all I get is a black screen. I have tried many things to fix the problem, even changing the screen to gray instead of black, but still it shows a black screen. No error warnings. Any thoughts?
@BradCantinMedia Жыл бұрын
I had this same issue and also an issue where as soon as i would load the window it would tell me not responding. I had to go through the code with a fine toothed comb and realized somehow i left all the [pygame.k_*] lower cased k instead of capitals and for some reason didnt get an error code it would just crash the window but once i made the k capital it ran like a charm. you may have some issue like that in the code
@4th_chaos Жыл бұрын
This was extremely easy to follow! thank you for this
@CodingWithRuss Жыл бұрын
Glad it was helpful!
@rudolfherwig7279 Жыл бұрын
Great explanation! Although I'm native german speaking I'd understood very good. Thanks for your effort! 👍😊
@zoundart7 ай бұрын
Thanks - great video! Is there a follow up, part two etc?
@CodingWithRuss7 ай бұрын
After this video it makes sense to jump into some small projects, so I've got tutorials for tic tac toe, snake etc that take what is in this video and build on it into a game.
@Blender_Builders10 күн бұрын
Nice tutorial! Just one problem. When i update the display it doesn't show the red rectangle. Good tutorial! Lifesaver honestly.
@g0obr10 күн бұрын
i got this error what do i do "AttributeError: module 'pygame' has no attribute 'init' (consider renaming 'c:\Users\\python\pygame.py' if it has the same name as a library you intended to import)"
@RustyBites Жыл бұрын
when i try to install py game it says 'pip' is not recognized as an internal or external command, operable program or batch file. Do you know how to fix that. Thanks:)
@CodingWithRuss Жыл бұрын
I've got a video covering just that :) kzbin.info/www/bejne/ZqnCfniBp5WCgLM
@brentmeadows9602Ай бұрын
Could you use a bigger font size or zoom, at least in the beginning , with the first page of code, or with the command prompt. 🙂
@samdavepollard Жыл бұрын
very nice thank you for sharing your knowledge (also have to say, as someone who's spent far too long being tortured by c++ build systems, python is a nice change; yeah, yeah, performance will be an issue many times but for what i'm trying to do python's just fine - thanks again)
@BrokenBattle8 ай бұрын
The elif statement prevents it from going diagonal I suggest just doing an if statement
@Hi.-_- Жыл бұрын
Thanks! The Coding was easy, but when i press Ctrl+B my pygame window opens up and shows a black screen and then it shows not responding and gets closed. I am using sublime text editor. please help me with this.
@CodingWithRuss Жыл бұрын
It's likely that your event handler isn't working correctly. Follow along with the video and you should get it to work
@AmogusVR342 ай бұрын
Um i using a raspberrypi 5 but it is keeps saying "Traceback (most recent call last): file "/home/#####/skibidi app (game).py", line 13 if key[py.K_a] == True: IndentationError: unindent does not match any indentation level"
@CodingWithRuss2 ай бұрын
It means the indentation in the code isn't right. Double check it to make sure it matches the code in the video
@justcallmespike51627 ай бұрын
I am attempting to code the rectangle movement, but I can only press one directional button each time I run it, and then it goes to the edge of the screen and doesn't move if I try to press another one.
@chloepudding2 ай бұрын
Did anyone’s red square go completely off screen idk what I did but the s key works but other keys make it go fast off screen if that makes sense ?
@QuransGems-zd1jd5 ай бұрын
that was quick and gooood!
@CodingWithRuss5 ай бұрын
Glad to hear it :)
@Camirritelecul3 ай бұрын
How do I make the rectangle to go slower?
@captainoftheocarina9 ай бұрын
Why does my sublime not have any colored text and when you get to the rect leaving a trail the pygame program is closing
@Jacksonsprx8 ай бұрын
i have same issue
@sayathaaliayup62507 ай бұрын
This is awesome video🎉
@CodingWithRuss7 ай бұрын
Thanks :)
@Acegamer1000-i1w10 ай бұрын
I got stuck on the very beginning and got this error: RuntimeWarning: import threads: No module named 'pygame.threads' (ModuleNotFoundError: No module named 'pygame.threads') import pygame
@baebee310 ай бұрын
I also got an error saying [Errrno 2] No such file or directory: ‘ ‘[finished in 110ms]
@flowerwork78 ай бұрын
Thank you so much for such a great tutorial.
@Nakameguro975 ай бұрын
What’s your opinion on pygame2 vs pygame zero vs arcade, from the perspective of an experienced python developer? Should I just go for pygame2 or are the other two worth using?
@CodingWithRuss5 ай бұрын
I've never used pygame zero but I played about with arcade a bit and that was quite cool. It does some of the work for you in terms of collision handling etc so you can get up and running faster. Overall though pygame is the more established of those, the documentation is decent and there's more tutorials and online support so it's probably the best one to begin with. It's not a huge time investment to try out each one though, so once you get a feel for one of them, you could try making a simple game in all three to see which you prefer.
@7guitarlover Жыл бұрын
Russ , you are my favorite game developer on KZbin ! Thank you so much for sharing your knowledge with us =) !
@JonathanBoulware Жыл бұрын
7:27 MY SCREEN CRASHED HOW DO I FIX
@hanazosimp Жыл бұрын
try to restart ur software and check indents
@JosiahBang7 ай бұрын
import pygame pygame.init() SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) gives me: AttributeError: partially initialized module 'pygame' has no attribute 'init' (most likely due to a circular import) i have windows 11, python and pygame both installed, plz help
@grantr7940 Жыл бұрын
HELP: 2:53 "The game window flashed for a second" my code: *import pygame pygame.init() SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) run = True WHILE run:* it says "can't find '__main__' module in 'C:\\Program Files\\Sublime Text 3' [Finished in 86ms]" and continuing onto further steps doesn't work. It's not your problem but help a brother out
@richardcornwell21519 ай бұрын
I'm getting the following error, any suggestions? C:\Windows\System32>pip install pygame 'pip' is not recognized as an internal or external command, operable program or batch file.
@ParticleAcceleratorgaming4 ай бұрын
Its normal, it happened to me but everything runs fine
@otakuuu17107 ай бұрын
the explanation is very clear. but i still had a problem with displaying the red cube correctly. it only showed once i closed the window. i moved the pygame.display.update() to a different place , under the line pygame.draw.rect() and now it seems to work. i don't know why that happened..
@7-N0B0DY3 ай бұрын
Hi so this a rlly good video but I need one piece of help, whenever I run the text and use WASD to move the red square around it just teleports to place by place not moved and flows like yours any ideas how to fix
@La_capsule_v24 ай бұрын
9:17 no way it was not intentional
@sydneyarmy6274 Жыл бұрын
Weird question, I seem to have followed everything exactly, but am not seeing the rectangle until right as I close the game... not sure where I went wrong
@CodingWithRuss Жыл бұрын
In these cases it's usually a small typo or missed indentation somewhere. Maybe your screen.flip() is outside the main game loop? Double check the code and see if you can track the issue.
@sydneyarmy6274 Жыл бұрын
@@CodingWithRuss thanks so much for your reply! Still trying to track down the issue, but running into the game just crashing every time I try to play it, even though there's still no rectangle. I'm going to keep at it though!
@lilysmith16735 ай бұрын
im a little confused on how you made the commands become commands in sublime. i have it downloaded, but my words arent coloured like that and it feels imprtant lol
@jacoblodiceofficial Жыл бұрын
this code doesn't work with python3 it gives me an indentation error on line 13 and i cant fix it i dont know what is going on here but if anyone can help id appreciate it greatly
@faqeerhasnain11 ай бұрын
soothing/relaxing voice, new sub..
@ayatallahosama6236Ай бұрын
this tutorial is great but i cant get the sublime text editor to run the code
@levipennerMTB9 ай бұрын
So I installed sublime text, and I wrote the code that was in the video, but all the text is just white, and not multicolored like in the video. How can I fix that?
@Squigally9 ай бұрын
in the bottom right of sublime it should say "plain text" click that and then a menu should pop up, look for "python" and click that. that should make them change colour.
@x7r45HM4Nx Жыл бұрын
I created the window and I can move it around, but the window doesn't close when hitting X. I followed the code exact up to that point. Any reason why that would happen?
@nicksonyosepsitumorang45578 ай бұрын
It's quite helpful thanks bro
@CodingWithRuss8 ай бұрын
Cheers 🙂
@Ertyi0303 Жыл бұрын
Instead of making a variable for the while loop you can just say While True: And to finish it just type Break
@user-kw1nu4vt9w Жыл бұрын
instead of break u gotta use exit()
@jaudatalhusen90493 ай бұрын
Great vid ... keep going
@CodingWithRuss3 ай бұрын
Cheers!
@Firecracker514 ай бұрын
very helpful! thank you very much
@CodingWithRuss4 ай бұрын
You're welcome!
@rob2701ful6 ай бұрын
I have an issue when I run the program it is fine until I enter the code for movement control then it freezes and crashes please can anyone help?
@the_flying_airplane53357 ай бұрын
This was an amazing tutorial! One question, when I run the code it’s very inconsistent- sometimes it moves quickly and other times it moves very slowly. I’m running it on a rather old laptop so I wonder if that’s the issue. Anything I can do to fix it?
@LivingLikeGaryYT9 ай бұрын
im just confused on how to come up with this on my own. like all the (()) and : , . how do i even know what to type? i can follow your steps and basically cope and paste but how do i understand what to write?
@Deristrome9 ай бұрын
Hello, I get the window to open and vscode shows no issue, but the window keeps loading and if I click it it turns white and stops responding until it crashes, any help?