Python Space Invaders Game Tutorial with Pygame - Beginner Tutorial (OOP)
Вставка
- Опубліковано 7 лип 2024
- In this gamedev tutorial, I'll teach you how to create your own Space Invaders game using Python and Pygame. This is a great tutorial for beginners, and you'll learn some important game development concepts along the way.
Previous Tutorials (Watch in the following order)
Python for Absolute Beginners: studio.ua-cam.com/users/playlistP...
🏓 Pong Tutorial: • Pong Game Tutorial usi...
🐍 Snake Tutorial: • Snake Game in Python T...
🧱 Tetris Tutorial: • Creating Tetris in Pyt...
🎲Game of Life Tutorial: • Conway's Game of Life ...
📝 Code: github.com/educ8s/Python-Spac...
🎶 More Music by Spyros: assetstore.unity.com/packages...
🚀Join the Channel: / @programmingwithnick
00:00 Intro to Space Invaders tutorial
02:07 Install pygame-ce
04:57 Setup the Game Loop
15:07 Creating the Spaceship
31:07 Create the Lasers
46:59 Create the Obstacles
1:05:39 Create the Aliens
1:23:19 Create the Mystery Ship
1:30:39 Check for Collisions
1:39:29 Game Over
1:59:46 Add Scoring
2:05:15 Add High-Score
2:10:11 Add Sounds
I hope you took away lots from this video. Let me know below!
PS. Do you like quiz games? Check my popular FREE Android quiz game here: bit.ly/QuizOfKnowledge
Great work Nick, brings back memories when the game came out on an arcade machine in the local pub.
Thank you bro! Very good tutorial!
I used this to make a school project!
Fantastic coding exercise - I learnt lots of new tricks. Such a great game too ! Thanks.
Its funny how overexcited youre are but also very helpful you explain everything from ground up. Good stuff!
Thanks!
Thanks for your tutorials, Nick. You rock and with your teaching method, I have retaken my career in game development. You rock :D
This is amazing tutorial, congratulations bro 👌👌
Great video thank you for your work
Bạn đã giúp tôi gỡ rối rất nhiều thứ, cảm ơn nha 🤗, video rất tuyệt, hãy ra nhiều hơn nhé.
loved it thanks--but did have a problem --with the screen size not fitting my laptop and if I want to increase levels and if it is in there--how do I start the next level after clearing the first one. making the next level harder than the last. free ship would be nice after clearing a level or after reaching a certain score.
Welcome back Nick! Will there be a C++ version of this?
Sure!
Great !! really well explained (oop+flow) to follow
I'm using your example to update a breakout revision !!
Have you another tutorial with spritesheet on a simple platform game ?
Thanx for your time :)
Great suggestion! I noted it down!
im waiting !!!!@@programmingwithnick
Hi Nick, thanks again for another wonderful tutorial :)
I think you forgot to add in the offset for the laser sprites and the right-side spawn of the mystery space ship seems to be off.
Thanks for the feedback. For the laser sprites, we don't need to add an offset because they spawn at the center of the spaceship, or the alien sprite, so the offset is already there. As for the mystery ship, I will check it again, you may be right. Thanks again!
@@programmingwithnick I meant the laser sprite when it should be destroyed once it reaches the edge of the frame we have drawn
Good catch! You are right! We need to destroy it a bit earlier now that we have the frame. Thanks for letting me know.
The right side spawn of the mystery ship you need to minus the offset not add it "x = random.choice([self.offset/2, self.screen_width - self.offset - self.image.get_width()])"
Raylib version of this would be great
Yes I work on it soon!
At 40:44 it would be nice if you explained _why_ we can now delete half of the code we've written in the last half hour. Because I have no idea 🙄
Hello how can I add a python file ?
How can I make this go on forever until I loose all 3 lives?
Is pygame more featureful than rsylib python bindings
Yes, pygame has many more features which make game development faster.
thanks, I tried pygame in 2020 when I was just learning how to program. Now I'm using C and raylib but I wondered if I returned to python whether I should use raylib bindings or pygame.@@programmingwithnick
When I left pygame few years ago (switched to pyglet), it was hopelessly slow wrapper for SDL with no hardware or graphics API support. Since then it seems it's development has accelerated significantly.
Day 1:
1:00:00
there's no download scammer.
Can you see the link to the github repository? The code is there, free to download for everyone.