Start a high paying tech career making $60k+/year with NO DEBT: coursecareers.com/a/techwithtim
@Romirazer3 жыл бұрын
@@jiaqiwang3793 Those mp3's work fine for me though
@uprola3 жыл бұрын
pygame.mixer works only with raw files, like WAV. For mp3 you should use pygame.muic
@dimitriosdesmos46993 жыл бұрын
thank you for this so much
@py_tok55893 жыл бұрын
It DID WORK, I think you forgot to place double brackets
@py_tok55893 жыл бұрын
this way works the sound for me, mp3 files are NOT CORRUPTED
@Fr4nk40002 жыл бұрын
I just wanna tell you how much this helped me. I started out knowing nothing about pygame and when you went along with the video i actually did a lot of the things you did later myself, starting to understand how this all works. Now i'm adding things like powerups and i'm having a blast. Can't wait to show this to my buddies when summer vacation ends and we can play this together. I never thought i could make ANYTHING like this
@forzeferrari2668 Жыл бұрын
This attitude ^
@blackbeast85718 ай бұрын
This💫
@connie45874 ай бұрын
Just starting this now. I hope to have some sort of game finished by the end of the summer so my friends and I can play!
@arcei57262 жыл бұрын
16:25 fps implementation 17:44 creating and defining the spaceships 32:39 movement keys
@RailwayPenguin2 жыл бұрын
@@producedbyosp i think KZfaq automatically made those chapters
@jaredcortes366 Жыл бұрын
@@RailwayPenguin i'm pretty sure they're made by the user
@ashters4204 Жыл бұрын
@@RailwayPenguin all timestamps are made by the creator
@secretr5024 Жыл бұрын
You are chad
@TitaniumTronic2 жыл бұрын
How tf this dude can code for almost 2 hours and not open stack overflow and like 30 tabs? Wizard. Wizard I say.
@Wojtek_17773 ай бұрын
No he is the chosen one ALL HAIL TECH WITH TIM
@theanonymoustechie3 ай бұрын
Techfuckery
@dlv56523 ай бұрын
Ha has the code on the side
@talhaghauri89879 күн бұрын
@@dlv5652 exactly😢😢
@abhipatel45953 күн бұрын
ok
@agent-333 жыл бұрын
You're a very good tutor, definitely an educator level. You explain what you write, the purpose and how a code or line of code is used. Readability is also important, the highlight effect, the zoom-in. Unlike most tutorial videos, they only say what they type which we (the viewers) are already looking at, or what is worse is they don't bother zooming in their codes, they are like texts from mini bible. Thank you so much.
@u2b8422 жыл бұрын
Hey thanks, but why not just changing SPACEHEIGHT to a higher number ?
@ldelamat1 Жыл бұрын
no he didnt help me
@BallisticGamer1017 ай бұрын
@@ldelamat1 Yep the first I watched this vid it was very confusing compared to other tutorials that I watched simply as I was a beginner but as I learnt more from other sources I came back to give this video a chance and it helped me a ton!
@siebedeerenberg87663 жыл бұрын
Great tutorial! One small comment: When rotating the images, the height and width change as well. That is what caused the problems with border and that is why the bullets don't shoot out from the middle of the spaceship. And why the bullets start in front of the spaceship.(That's why Tim added + 15, which is the difference between height and weight, 55-40 = 15). To correct the border you can change yellow.height to yellow.width in the yellow_handle_movement. To correct the bullets, you can change yellow.width to yellow.height in the Main function at the bullet movement.(bullet = pygame.Rect(yellow.x + yellow.height, yellow.y + yellow.width//2 - 2, 10, 5))
@siebedeerenberg87663 жыл бұрын
or first rotate and then resize
@vedanlkektokekto6872 Жыл бұрын
oh
@MusicWizards2 жыл бұрын
I don't comment lot of videos, but this one was great. 1) There was not only code from a to z, but every step was explained. 2) Code that was made is obtainable for example. Thx DUDE! Two thumbs up!
@TechWithTim2 жыл бұрын
Glad it helped!
@xjud32 жыл бұрын
I love your tutorials Tim, and something funny i found in the video: Tim: 'im gonna write some code and go abit faster now, but we gonna go through it after' Tim: going exactly the same nice and calm speed and explaining everything as he goes xD
@mariusmuller38863 жыл бұрын
I think the reason why can go further down than the button at 48:25 is that you've rotated the spaceship. So now height is technically width and width is height. If you change the variables in the if-statement it should work fine.
@SuperMarioGalaxySMG8 ай бұрын
this and you guys should also change your movement if statements to take into account if red/yellow.x/y ± SPEED goes over your border so the if statements look like this if keys[pygame.K_w]: if yellow.y - SPEED >= 0: yellow.y -= SPEED else: yellow.y = 0 if keys[pygame.K_a]: if yellow.x - SPEED >= 0: yellow.x -= SPEED else: yellow.x = 0 if keys[pygame.K_s]: if yellow.y + SPEED + yellow.height
@shalevforfor55508 ай бұрын
The width and hight is not only x and y
@josecostarosa25262 жыл бұрын
I've started learning python this week, coming for 2 months of learning C++, this has got me so excited,. I'm still a newbie programmer but these things just leave a person wanting more and more, it's very exciting and encouraging that someone starting with 0 programming skills can use these videos and other sources to learn and become a better progammer in my case as a great suplement for my ciber-security degree. Great video and all the best.
@nutsberserk12 жыл бұрын
Python is my first and only known language (not counting Scratch), I've been learning from high school classes, and making games has always seemed like an interesting idea!
@toso1038 Жыл бұрын
@@nutsberserk1 is good to start with JS its just the easiest language. Not that useful but you will undersand programming very well
@pbprimeplay3 жыл бұрын
The perfect guide for pefecting the art of perfection in Pygame
@sailajaraman70673 жыл бұрын
And that's perfectly true
@Kouka20053 жыл бұрын
*PERFECTION*
@naveen51263 жыл бұрын
And I just found the perfect comment
@g3itnal3 жыл бұрын
by the perfect person
@mysterry20003 жыл бұрын
I love how he perfectly teaches and follows programming conventions, so perfect
@tholver58953 жыл бұрын
Thank you so much for the tutorial. I had a project in school where I had to pick a skill, learn it for a month, and make an end project and this video has made all the difference. I understood the parts of Python you were using, what they were doing, and how to modify them to fit my needs which is great. Very rarely do I find a tutorial that helps me learn rather than copy but I'm glad I found one today.
@ayze_khla17833 жыл бұрын
From the 6 hours full python tutorial to here.... Thank u Tim~
@themathforyou3 жыл бұрын
Are you talking about Mosh?
@harikishan18813 жыл бұрын
@@themathforyou ofcourse
@Lighthammer183 жыл бұрын
Really nice that you kept the bugfixing in there because that's like 90% of the work. Showing how to fix code is almost as valuable as showing how to write new code.
@Fr4nk40002 жыл бұрын
For anyone who followed the tutorial and want to practice more of what you learned, here's some things you could do to make the game better. -Add a collision check to the bullets so if they collide, they destroy each other -Add poer ups that you can pick up and will increase the amount of bullets you can fire, increase bullet speed etc... -Add a healt system so you can get hit more times before you die -You could also add a healtbar if you're adding a healt system -You can also add different firing modes, like holding down a different key will shoot 2 bullets next to each other etc... -You could also add a border that slowly shrinks the space you can move around to prevent stalemates -You could add a score system That's just some ideas that came to mind and i'm implementing some of them already myself
@sanjanam58332 жыл бұрын
Do you have complete code ?
@Fr4nk40002 жыл бұрын
@@sanjanam5833 I do have the code for the game. I didn't follow it 100%. Theres not a devider in the middle and isntead of the space ship sprites i just use suqares. Also I didn't watch the entire tutorial i kinda finished it myself, but i works. Do you want the code?
@sanjanam58332 жыл бұрын
@@Fr4nk4000 yes please do send
@thoserandomshredders Жыл бұрын
As a beginner python coder: your tutorials help me so much. Keep making them!
@pablolongobardi72402 жыл бұрын
Im at minute 15 and I already love this! I am an experienced developer, andf I appreciate a lot the detail and the easy explanations
@GL-ETC3 жыл бұрын
Thank you so much Tech With Tim, I am only 10 - though I've done some python before, and I can nearly completely understand everything!
@axolotlinanutshell76293 жыл бұрын
Im also 10
@antonioa.jepkoko45882 жыл бұрын
I'm not 10
@nemi79162 жыл бұрын
Im also not 10
@intelchip_x862 жыл бұрын
im also not 10
@dylanchase1478 Жыл бұрын
I might be 10
@artistpw2 жыл бұрын
This is a truly great tutorial! You could have just made little “pew, pew, pew” noises for the firing and “blam” for the collisions. That would have sounded cute!
@poisonfoxxy3 жыл бұрын
For your problem at 48:20 its actually a pretty easy fix the rectangles you drew for the spaceship to be blit in are rotated incorrect just change the height and width in the main Yours: red = pygame.Rect(100, 450, SPACESHIP_WIDTH, SPACESHIP_HEIGTH) Fixed: red = pygame.Rect(100, 450, SPACESHIP_HEIGHT, SPACESHIP_WIDTH) Change that for both and it should be fine :) This also fixes the greater distance to the middle border. But great tutorial!!!
@muhammadgiffariakbarrizkyr3802 жыл бұрын
can you give the explanation about that fixes
@muhammadgiffariakbarrizkyr3802 жыл бұрын
btw i'm bad at english, so i'm sorry if i type something wrong but hope you understand what i mean
@asolutezero13043 жыл бұрын
He is a great explainer. The way that he explains concepts is so cool.
@tungarafrog25493 жыл бұрын
Hi Tim, it is unlikely that you will see this but I just want to thank you for all of your Great tutorials. I would also like to ask if you could show a more advanced version of this tutorial or maybe how to make a platformer game with gravity and other stuff.
@richardreif34073 жыл бұрын
I'm the same I really like it. Thank you very much. :)
@flaviomarcelo90443 жыл бұрын
@Krishnansh Agarwal Identical Sublime Text Monokai theme
@mrgasmask75842 жыл бұрын
You know its actually not that hard to imploment gravity
@dominicballinger65362 жыл бұрын
Gravity should be simple, remember the example he used to show movement on screen before button presses? Do that, but down.
@tungarafrog25492 жыл бұрын
@@dominicballinger6536 thanks, I realize how to do that, what I was having trouble doing was making it so that the player can stand on solid blocks and collide with them from all directions.
@placeholder83712 жыл бұрын
Thanks for this video. Really appreciate it! Just a tip: When people click on your video, they know they're watching a video. Consider not telling your viewers they're watching another video on KZfaq and tell people what they're going to see without explicitly telling them "we're going to go over."
@hemaanthsivakumar21183 жыл бұрын
Loved the tutorial! The three hours I spent carefully going over each piece of the tutorial and taking notes really paid off - finally made my first pygame powered python game 😀. Hope you keep making amazing videos 🔥🔥🔥 ❤
@sanuk96503 жыл бұрын
Hey Tim, Could you please make tutorials on Data Structures & Algorithms with Python..🤞 It would be very helpful.. Hope you would make tutorials on DS soon..😊😊
@ChristianFure3 жыл бұрын
I want this too
@danielkursitis90312 жыл бұрын
I agree, it would be very helpful
@jasonkloesel51132 жыл бұрын
Yep
@user-sp3ew1rs5m10 ай бұрын
Me too
@benhardsim86293 жыл бұрын
The way you always try to make the code a little bit more dynamic, really make this tutorial hundred times better. Thank you some much 😀
@mythicshop16393 жыл бұрын
I'm new to coding and was struggling after the basics, this really helped me to get an insight and i watched a bunch of tutorials and was almost on the verge of loosing hope. Most of the videos out there are hard to understand with the logic maybe because they don't know or they just posting it for the views. but your contents are really different and you know what you talking about, Teaching or programming you will reach great heights bro. Thanks again , Love your content. wish that you had more followers so you can earn profit and we can get some proper intel. Guys other than watching toxic tik tok suggestion Give a thumbs up here.
@juststopcamping84282 жыл бұрын
how u doing now
@data.artist3 жыл бұрын
Also find out is that it is best to move the if winner_text != "" section to after draw_window in the main(), this will allow the health to be properly displayed to 0, then the game will show who is the winner. Whereas original setup will declare the winner when the health is still showing 1. hopefully this helps anyone wanting to make the game even more polished.
@Cabarnacus2 жыл бұрын
I second this one and I did the same.
@koppany36782 жыл бұрын
The problem you had with the spaceship going off the border is because of mixing up height and width when you rotated the spaceship. Here is a correct version: def red_movement(keys_pressed, red): if keys_pressed[pygame.K_LEFT]: # if left key is pressed if (red.x - VEL - 5) < (WIDTH/2): pass else: red.x -= VEL if keys_pressed[pygame.K_RIGHT]: if (red.x + VEL + SPACESHIP_HEIGHT) > WIDTH: pass else: red.x += VEL if keys_pressed[pygame.K_DOWN]: if (red.y + 4 + SPACESHIP_WIDTH) > HEIGHT: pass else: red.y += VEL if keys_pressed[pygame.K_UP]: if (red.y - 4) < (HEIGHT -HEIGHT): pass else: red.y -= VELdef red_movement(keys_pressed, red): if keys_pressed[pygame.K_LEFT]: # if left key is pressed if (red.x - VEL - 5) < (WIDTH/2): pass else: red.x -= VEL if keys_pressed[pygame.K_RIGHT]: if (red.x + VEL + SPACESHIP_HEIGHT) > WIDTH: pass else: red.x += VEL if keys_pressed[pygame.K_DOWN]: if (red.y + 4 + SPACESHIP_WIDTH) > HEIGHT: pass else: red.y += VEL if keys_pressed[pygame.K_UP]: if (red.y - 4) < (HEIGHT -HEIGHT): pass else: red.y -= VEL
@SReaperz3 жыл бұрын
For anyone else wondering why the bottom part of the ship was going through the bottom of the window and how to fix that without manually adding pixels to it the problem is that he set the width and height of the spaceship as constants... then he rotated the image by 90 degrees which made the height be the width and the width be the height so just switch the values around for the rects and that should make it so you don't have to manually adjust for not going through the top and bottom, and bullets properly hit the ship
@cc-to2jn3 жыл бұрын
you genius
@johannesziaether39163 жыл бұрын
Thank u ! It's a tip that may serve in other projects too.
@demaxl7323 жыл бұрын
i also figured it
@colederusha3 жыл бұрын
Thanks so much!
@Polygonepictures3 жыл бұрын
I thaught of the same thing! Tricky one...
@nickg18282 жыл бұрын
Thanks for the clear explanation on how pygame works. My final project for Python II is due in 2 weeks and you just saved my life.
@sprinter5901 Жыл бұрын
37:36 you have no idea how much happy I was when I reached till this point. Even the simplest thing can make a person soo happy
@bloocifer3 жыл бұрын
Im at 45:00 in your video, and granted i have taken everything very slowly and wrote special notes in my own code so i can come back and refer here, this is SOOO helpful. i was getting bored doing tutorials and this is making me have fun now. So far i have two working spaceships with the border in the middle and im sittin here so happy that i made it. Even if i was following ur code. Im gonna finish these and continue to do projects cuz im learning a lot of applications of the code as well as growing a little project base of my own that i can always come back to and refer to and look at my own notes about why the code is written the way it is, and its like my own little cheatsheet of code with applications that i KNOW work. Great vid! vscode makes this soooo much better too. i was still using IDLE before i switched to vsc lol
@kathleen_lalala2 жыл бұрын
Thank you Tim for this AMAZING tutorial! This is the first time I am able to follow through a coding video because I am a beginner and it was hard finding a tutorial that explain codes and train of thoughts in this much detail. I felt much more confident in coding now with this tutorial and am very motivated to learn more! Thanks a lot really :)
@CCC-qm6hf2 ай бұрын
Thanks ,Tim. I love it .and .....You have rotated the spaceship by 90 degrees, so the values of the height and width of the spaceship should be swapped."
@ZeynepC39 ай бұрын
I am grateful that you are zooming in on the code part.
@deanjordan60533 жыл бұрын
The fact that he kept going even when he spilled water on himself-
@josephstalin26473 жыл бұрын
yeah
@umanglunia21943 жыл бұрын
So nice seeing 2 of the greatest minds in the same comment :)
@imanoob1283 жыл бұрын
@@umanglunia2194 lmao
@diarrheagaming62153 жыл бұрын
commie
@vamsi85693 жыл бұрын
@@diarrheagaming6215 its dripping on your username :P
@mantawhitest18953 жыл бұрын
This guy is severely underrated.
@johannesperez95482 жыл бұрын
I replaced the sound effects to wav format. Now works great. Thanks Tim for this awesome tutorial!
@cyphersyndicate1Ай бұрын
TECH WITH TIM IS A GOD. I did a 3 hour tutorial about Pygame before that was worthless. Thank you for creating these types of great videos Tim!
@tdpencil28113 жыл бұрын
Thank you so much. After I watch this, I hope I'll be able to create fun games for some kids in my neighborhood!
@Frosty-dq2jw3 жыл бұрын
Hey the problem with ships not moving good around the border (going under the screen and cant touch the border on the right) is because we made our hitboxes/collision before they were rotated , so collision boxes are placed horizontal and not vertical , all you have to do is switch the SPACESHIP_WIDTH and SPACESHIP_HEIGHT values but then switch them while scaling the picture (YELLOW_SPACESHIP and RED_SPACESHIP), anyway thank you for getting me into python programming @Tech With Tim !
@pablolongobardi72402 жыл бұрын
was gonna point this out! nice
@leagueofangels186614 күн бұрын
Hey Tim, I followed along with the tutorial and it works out great than I expected ❤!~ Thank you for this amazing video🌹
@codeklaudia96963 жыл бұрын
You are awesome. I did a 1,5 year program in information technologies, and have been working in C# since the last year. Your explanation about CPU frequency and frames per second is awesome. I really enjoyed your video
@youmuq3 жыл бұрын
Thanks Tim for the great tutorial! The problem with sound likely is the file path. The filename has ‘+’, I removed that and works fine here.
@Arjunsiva3 жыл бұрын
I can't even begin to describe how much grateful I'm for this video. Thanks a lot
@beez1th6362 жыл бұрын
Tim I got to tell you every time I look up something for coding your always there thanks for the help
@vmr_1997 Жыл бұрын
Hey man, just thought I'd let you know that I made sure to come back and watch your sponsor spot. Ppl bringing knowledge to the masses for free should always be rewarded IMO. Good shit!
@sharmakartikeya3 жыл бұрын
1:16:04 Just saving for now. Thanks Tim, super excited for 2D game-dev !!
@ayaanp3 жыл бұрын
I was wanting to learn PyGame as I hadn't really done anything with it before, and this video just came out. You're actually amazing
@gvigary1 Жыл бұрын
I've done a bit of commercial Python (many years ago) but never used Pygame. I'm now trying to teach a friend's son how to program, and this tutorial was so clear and well structured that it'll make that job a lot easier. Great job!
@R0k47Ай бұрын
Tim, thank you so much. It took me a few hours to do this and to make it run perfectly but it was so fun to do it. Amazing tutorial, well explained and also the sound effects are awesome.
@jamesbessant92903 жыл бұрын
11:58 That was my first ever pygame window so I think you'll find it was actually very exciting!!
@nopens3 жыл бұрын
Hawkeye, my man!
@jiaqiwang37933 жыл бұрын
Hey Tim, found the cause of your problem at 48:20 with the ship going outside the screen. Because you have rotated the image now the width and height have swapped thus your image does not match the rect anymore. Loved your video by the way!
@mateuszstasiak68613 жыл бұрын
48:20 It is because in line 43 we put yellow.height instead of yellow.width. We rotated the spaceship image so now the vertical size is width and the horizontal size is height.
@giddygiddybangbang94252 ай бұрын
Thank you so much! It was my first time learning pygame. I successfully launched the game!
@MattiHolden3 жыл бұрын
Hi Tim, Thanks for the great tutorial, the code and the assets. I think the problem with the ships going off the bottom and being way of the border etc,. is because the images were rotated but the ship's rectangles weren't. I just switched the width and heights where red and yellow were created and it removed the need for the adjustments. I apologise if you were already aware of this by now 😁
@Dracevui3 жыл бұрын
for anyone getting a 'pygame.error: video system not initialized' error - just import the 'sys' module and add the 'sys.exit()' function underneath the pygame.quit() function learned that trick from the flappy bird tutorial lmao
@L0wPressure3 жыл бұрын
Thank you mate, and good day to you!
@xenonguard3 жыл бұрын
Could not get 'sys.exit()' to work for me. However modifying the following at the end, worked: if running == True: main() else: pygame.quit()
@saadadchoudhury71633 жыл бұрын
Thank you!
@xklepx Жыл бұрын
'sys.exit()' worked for me -- thx mate!! now I can close it w/o an error after passing through auto-py-to-exe lol
@dip8 Жыл бұрын
I enjoyed following this tutorial. Along the way i noticed some of your not syntax related mistakes which was cool, and i made my own sounds w sfxr. I love how simple and understandable are your explenations. Even tho the music didnt work i still this was great, thank you for posting this tutorial for free
@XnonXte6 ай бұрын
Very overwhelming at first but this is a very good guide on learning game dev with pygame, thank you so much!
@JayeshSarvaiya3 жыл бұрын
Thank you so much Tim, such a wonderful tutorial ! You really made it look all very easy, glad that I found your channel on KZfaq ! 😀
@CHITUS2 жыл бұрын
Thank you so much Tim, such a wonderful tutorial ! You really made it look all very easy, glad that I found your channel on KZfaq !
@arcei57262 жыл бұрын
found you again, for the third time!
@intelchip_x862 жыл бұрын
@@arcei5726 i feel like this channel is actually a bot channel
@draverros2 жыл бұрын
If you are on mac and using mac keyboard, change the shooting key for the red ship to K_RALT as option key is marked as alt.
@bluejay4322 жыл бұрын
You just indirectly gave me a genius idea to handle window blits WAY more efficiently in my project THANK YOU SO MUCH!
@tanmaygautam13483 жыл бұрын
Hey Tim, We need a video on some hashing algorithms python btw I also need this video. Thanks Tim.
@ParleysWoodedJourney2 жыл бұрын
You covered so much in just one video. Thank you.
@donbedner64822 жыл бұрын
A rare experience: Everything worked! Even the sound. I learned a lot. Thanks!
@JackStreet-fv3xj3 ай бұрын
This helped a lot and I think the reason why the ship went of screen 48:40 was because the ship had been rotated so the width and height were swapped so trying to add or subtract 55 instead of 40
@petersteenkamp3 жыл бұрын
One thing I'm worried about is when you finish a game round, you restart by calling the main() function from within the main() function. This means that the original call to the main() function never gets closed. Wouldn't this cause an increase in memory use after every game round? Given that this is a simple game, you'd probably need to play an insane number of rounds before your computer crashes with an "out of memory error" or similar, but if the game was much bigger, this may become a problem. How about not calling main() in line 177 and instead change line 180+ to: if __name__ == "__main__": while True: main()
@mbenz31453 жыл бұрын
Or use continue instead of break statement....
@patlow2 жыл бұрын
@@mbenz3145 that wouldn't work, continue cannot be used
@9Kino33 жыл бұрын
Instead of duplicating, you could use the same function to handle both red and yellow keypresses. Just use the player variable to decide which ship to move, less unnecessary code repetition
@skyricq3 жыл бұрын
I've learned more in 30 minutes on this video than my high school teacher was able to get across in 6 months.
@wernerw.13283 жыл бұрын
In one of my last comments I wrote that I will follow you everywhere. I kept my promise, came here - and it is great again.
@avarice45563 жыл бұрын
Now it's my turn to follow you everywhere.
@Melvinn272 жыл бұрын
This was such a good tutorial. As a beginner to pygame this gave me so many things to play around with. Thank you!
@Flashxyz1233 жыл бұрын
hi Tim thank you for all of these tutorials you helped me a lot I am a 10 years old python programer who started coding at the age of 9 you helped me a lot thanks
@RoshiAILol27 күн бұрын
Thank you so much man saved me a ton! your other tutorial was a bit hard to follow I love how clear this new one is !
@rapdo73592 жыл бұрын
This is pure gold! Thank you so much Tim, its really useful to learn new topics developing a project, even more so if you have such a great instructor like you. ❤
@sparkosthenes3 жыл бұрын
Amazing tutorial tim! Keep it up.
@hockeyandtacos51532 жыл бұрын
Finally, a great tutorial for pygame, got this game working on my said in about 3 hours and it was so worth it!
@ssigitas693 жыл бұрын
🤯🤯🤯 To understand this for me, need to watch 1000 times, probably?! And need to learn Python again few more times 🤪
@freshness_of_air79093 жыл бұрын
i was genuinely shocked when i saw his face for the first time
@Unity_Particle_System3 жыл бұрын
I will do this great tutorial as many times as possible until I can teach Pygame to others. As Tim said in another video, the best way to learn is to teach.
@vrajsavani2 жыл бұрын
Thanks for this amazing tutorial! I forgot all about pygame and this kept me back up to date.
@Yamas258 Жыл бұрын
Man i wish there was someone that explained JavaScript this detailed and clear with each step. You alone are making me reconsider learning python as my first
@TechWithTim Жыл бұрын
Wow, thanks!
@TechWithTim Жыл бұрын
I do have a javascript tutorial series FYI
@Yamas258 Жыл бұрын
@@TechWithTim well thank you for taking the time ! ohh dohh!! well being it’s my first language, u think it’s better to start with python first? What would you do if u were brand new ?
@GreatGameTerminator3 жыл бұрын
Why do his ships move so smoothly, yet on my pc the movement is really delayed and choppy?
@user-wv9kf2nb2x3 жыл бұрын
Probably cuz ur PC cannot run 60 fps
@efekaanefe8703 жыл бұрын
In main function, you might have written "keys_pressed = pygame.key.get_pressed() yellow_handle_movement(keys_pressed, yellow) red_handle_movement(keys_pressed, red) handle_bullets(yellow_bullets, red_bullets, yellow, red) draw_window(red, yellow, red_bullets, yellow_bullets, red_health, yellow_healt)" these codes to the inside of the for-loop. They must be exactly inside of the while-loop.
@saif03163 жыл бұрын
This tutorial is so perfect.
@laurablue78932 жыл бұрын
I really appreciate the way you explain why things are the way they are!
@mr.shroom42802 жыл бұрын
Thanks so much for the tutorial it really helps, I've mastered C# and I'm moving on to python and wanting to master it, you've helped me on my journey to master python. Thankyou so much for your quality tutorials!
@Alex-ik8pr3 жыл бұрын
Exploit for the pro-players, if you spam shoot while the game reloads you'll send a mega shot 😉
@jonathanalexander98812 жыл бұрын
Will use this at the next eSports event for this game.
@Alex-ik8pr2 жыл бұрын
@@jonathanalexander9881 try and solve the problem! 😁
@jonathanalexander98812 жыл бұрын
@@Alex-ik8pr I am still trying to figure out why my Python won't recognize the module :(
@ReddoX302 жыл бұрын
There is a bug I noticed. If you continue to press CTRL to fire during the PLAYER WINS! message, the shots will be registered and fired automatically when the next round starts, even without pressing anything! What's worse, it will buffer up to 3 shots, 2 of which are invisible! My solution is to clear the keyboard input after the winner massage is displayed. I added this line at the end of the draw_winner() function: pygame.event.clear(eventtype=pygame.KEYDOWN) This clears the key inputs after the pause and fixes the problem.
@Playboi_3 жыл бұрын
Have been fiding it really hard to get into programming, this was the perfect TUT to really get started.
@dharun71963 жыл бұрын
same
@noelatum8692 Жыл бұрын
I enjoyed every step of this tutorial. Thanks a lot. For the sound, I used (.wav) audio files instead of (.mp3) and it worked!
@codingboy22543 жыл бұрын
Is there a way for me to develop an "android game" using pygame . I mean does the library support touch inputs ?
@addisumengistu47843 жыл бұрын
There is a library called kivy try thaf
@codingboy22543 жыл бұрын
@@addisumengistu4784 but i wanna make a game not an app
@codingboy22543 жыл бұрын
@@addisumengistu4784 Thank u anyways
@addisumengistu47843 жыл бұрын
@@codingboy2254 ya u can make a game using that but y have to learn other library just google abt how to make a game in kivy
@emackenzie3 жыл бұрын
@@codingboy2254 if you want it to run on Android it's going to be an "app" no matter what because it's just short for application. You can make games for Android with Kivy
@Legend-rn5ee3 жыл бұрын
Hey Tim! I had a question. Which according to you is better: Pygame or Kivy?
@kittenlord99013 жыл бұрын
Pygame is not a very professional framework, so if you are just making something to play with your friends, pygame can meet most of your needs.
@tanmaygautam13483 жыл бұрын
Pygame is for making games and have fun. Kivy used for some serious application or i should say PTOJECTS.
@galaxfire85913 жыл бұрын
Thank You So Much For This! I wanted to learn pygame and was looking for a great starter tutorial and without a doubt in my mind this was it! This and other tutorials made by you are always so high-quality. Again Thank You!
@deivcohen43007 ай бұрын
Thank you very much for the tutorial. I just wanted to add that the two problems in the borders (down and right) can be fixed by first rotating and then resizing the images
@cosmic_4173 жыл бұрын
You should also consider teaching unity😃
@eyosiyas_js3 жыл бұрын
Tim can you make this game online multiplayer . and show us how you did it. pls
@u_ori3 жыл бұрын
Hint: tcp
@soisauce3643 жыл бұрын
import socket
@abhaysrivastav5664 Жыл бұрын
You're the best python tutor in the world, Tim!!!!!!!!!!
@jammincoder3 жыл бұрын
Your code is so beautifully written! I'm not skilled at reading other peoples' code, but yours is a rare exception.
@jammincoder3 жыл бұрын
Not sure
@jiggilybuff55293 жыл бұрын
great tutorial so far! But I'm having problems importing the images. I've tried many thing like moving the python file to the assets folder and getting rid of the 'Assests' and just trying 'spaceship_yellow'. My spelling is correct too. But every time i try to run the program its says, "FileNotFoundError: No such file or directory." plz help
@mariuskunauskas12972 жыл бұрын
Running into the same issue. Have you found the solution?
@djwesleymarques2 жыл бұрын
The same issue here. Somebody?
@charlotteblue9812 жыл бұрын
me too
@sinjinblade2 жыл бұрын
Same here as well. I'm getting a Couldn't open Assets\spaceship_yellow.png
@sinjinblade2 жыл бұрын
UPDATE: I had to change directory to specifically the PygameForBeginners-main directory. Apparently my editor was looking at the folder above that one.