Pygame Tutorial - Creating Space Invaders

Pygame Tutorial - Creating Space Invaders

Tech With Tim

54 года назад

815,990 Просмотров

In this pygame tutorial we will be working through creating a full space shooter/invader game! I will be teaching the pygame module and some basic game design principles as we walk through this long python 3 pygame tutorial.

🎙If you want to show your support please subscribe to @Time Out With Tim, where I'll be posting weekly podcasts! https://www.youtube.com/channel/UCSATlCAUi7R0Ik-wsZb2gOA

⚙ How to Install Pygame (Windows): https://www.youtube.com/watch?v=AdUZArA-kZw
⚙ How to Install Pygame (Mac): https://www.youtube.com/watch?v=E-WhAS6qzsU&t=1s

💾 Game Assets & Code Download: https://dev-cms.us-east-1.linodeobjects.com/Space_Shooter_Tutorial_b06d429cbc.zip
💾 Game Assets Only Download: https://dev-cms.us-east-1.linodeobjects.com/assets_443eec3449.zip

◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
https://tech-with-tim.teachable.com/p/the-fundamentals-of-programming-with-python

📸 Instagram: https://www.instagram.com/tech_with_tim
🌎 Website https://techwithtim.net
📱 Twitter: https://twitter.com/TechWithTimm
⭐ Discord: https://discord.gg/pr2k55t
📝 LinkedIn: https://www.linkedin.com/in/tim-ruscica-82631b179/
📂 GitHub: https://github.com/techwithtim
🔊 Podcast: https://anchor.fm/tech-with-tim

💵 One-Time Donations: https://www.paypal.com/donate/?token=m_JfrPK7DsK4PLk0CxNnv4VPutjqSldorAmgQIQnMozUwwQw93vdul-yhU06IwAuig15uG&country.x=CA&locale.x=
💰 Patreon: https://www.patreon.com/techwithtim
◾◾◾◾◾◾

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

⭐ Tags ⭐
- Tech With Tim
- Python Tutorials
- Pygame Tutorial
- Pyagame Space Shooter
- Python Pygame Tutorial
- Pyagame Tutorial Python

⭐ Hashtags ⭐
#python #pygame

Тэги:

#tech_with_tim #pygame_tutorial #pygame_space_invaders #pygame_space_invaders_tutorial #python_pygame #python_pygame_tutorial #python_space_invaders
Ссылки и html тэги не поддерживаются


Комментарии:

@tebogoditsele9432
@tebogoditsele9432 - 07.12.2022 19:15

How do we add a background music

Ответить
@aceofall6007
@aceofall6007 - 08.12.2022 17:14

Hi my code seems to encounter an error with the velocity in enemy.move(enemy_vel) is there anyone who can help

Ответить
@jonathanoyola112
@jonathanoyola112 - 18.12.2022 21:53

i need help. the enemies are shooting before they appear on screen, what do i do?

Ответить
@--U--_--0--0--2--0--
@--U--_--0--0--2--0-- - 20.12.2022 17:54

i have a problem in moving the red square up down and right in the beginning,, can anyone help?

Ответить
@mountainlion9002
@mountainlion9002 - 24.12.2022 22:54

thank you so much my brother Tech With Tim i'm using this for my final project

Ответить
@rakoahmed5439
@rakoahmed5439 - 28.12.2022 07:53

Great content! I was wondering how can I add some sound effects as well!?
Thanks so much for this amazing tutorial!

Ответить
@chrisandrade2425
@chrisandrade2425 - 29.12.2022 03:33

“For i in range (wave length)” what is I? Is it just a place holder or is “i” a convention?

Ответить
@MAA-op4gw
@MAA-op4gw - 15.01.2023 16:51

Have to be a master of debugging with the power of the Sharingan to get it to work. Respect if you got it to work in the end!

Ответить
@utkarshgupta4209
@utkarshgupta4209 - 24.01.2023 19:21

Thankyou sir loved this one

Ответить
@brandonxie3656
@brandonxie3656 - 19.02.2023 20:31

can someone help me find the source code?

Ответить
@VirtualGobllim47
@VirtualGobllim47 - 24.02.2023 03:18

window.blit(self.ship_img, (self.x, self.y))
TypeError: argument 1 must be pygame.Surface, not None

helppp

Ответить
@cole1803
@cole1803 - 13.03.2023 00:22

in _init_
self.mask = pygame.mask.from_surface(self.ship_img)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument 1 must be pygame.surface.Surface, not str
I do not know why this is wrong can someone help

Ответить
@noxzeuz
@noxzeuz - 13.03.2023 23:48

this was great, i actullay understand most of this :D, maybe you go a little fast for me, but i just have to slow down the speed of the vid! Great job!

Ответить
@austintaylor5683
@austintaylor5683 - 10.04.2023 00:25

I don't really understand why there were Laser methods within the Ship class instead of all of them being in the Laser Class

Ответить
@gabriellita7236
@gabriellita7236 - 10.04.2023 20:58

Thank you for this amazing tutorial

Ответить
@CFedits62
@CFedits62 - 21.05.2023 07:32

its broken now it cant find the files

Ответить
@akritirawat135
@akritirawat135 - 25.05.2023 14:16

in line 39 when i am trying to call main function , the balck window is opening but it does not close ?? plz give me any solution

Ответить
@foo9020
@foo9020 - 31.05.2023 20:25

When I press shoot while aligned with an enemy, the enemy just disappears instead of doing so after colliding with my laser, in fact my laser doesn't even show up. Does anyone know why that happens?

Ответить
@CHESSBOARD400
@CHESSBOARD400 - 22.06.2023 11:38

TypeError: function missing required argument 'size' (pos 2) i got this error can someone help me solve TY

Ответить
@varsharavisankar816
@varsharavisankar816 - 09.07.2023 17:17

i cant move the ship so which key i should use to move the ship

Ответить
@swamphonkey
@swamphonkey - 04.08.2023 04:32

Thanks!

Ответить
@eddiemeekin9180
@eddiemeekin9180 - 04.08.2023 19:11

Just finished your beginners oygame tutorial. Was so badly hoping you would have a tutorial for this (I feel this is the next step to that video) and obviously you pulled through! Dunno how I would have felt following a tutorial from somebody else. You are an Amazing tutor

Ответить
@durgadevi3261
@durgadevi3261 - 08.10.2023 08:33

Where we need to do this

Ответить
@howtocreateayuotubevideo-ig2up
@howtocreateayuotubevideo-ig2up - 20.10.2023 13:09

m

Ответить
@rikleigh03
@rikleigh03 - 23.10.2023 00:34

does anybody know how to add background music to the game and maybe even sound effects

Ответить
@lucanotti2246
@lucanotti2246 - 30.10.2023 08:53

Awesome tutorial man!

Ответить
@alexmckinley79
@alexmckinley79 - 31.10.2023 17:23

Thank you so much for this tutorial. Your projects are really helping me practice skills and get more confident.

Ответить
@SerpentSajjad
@SerpentSajjad - 07.11.2023 15:52

can you try doing the asteroids game

Ответить
@mattwilliams3304
@mattwilliams3304 - 13.11.2023 21:13

instructions unclear, gave my cat a borito

Ответить
@willisthehy
@willisthehy - 19.11.2023 13:19

i made the r button for reset or run = False

Ответить
@naveenkumar1853
@naveenkumar1853 - 04.01.2024 10:52

Hello

Ответить
@lukash72537
@lukash72537 - 04.01.2024 17:16

does anyone else have the problem if you put the cooldown = 10 and you spray bullets that you get an error message after a while ask chat gpt great guy fixed my problems :)

Ответить
@jantonisito
@jantonisito - 17.01.2024 06:29

Tiny tweak might be NOT to immediately remove enemy ship after you hit it (either with laser or player ship) because that removes also the enemy's laser beams and that is not how the space fight looks like in real life. That means that invisible ship cannot shoot, crash into player or score points.

Ответить
@bluidguy4007
@bluidguy4007 - 21.01.2024 23:45

Something I am having trouble with is even before the enemies come on screen on mine it's like a waterfall of lasers coming at me, whereas on his version they don't shoot until they come on screen; I'm wondering if anyone knows why that would be happening? I'm getting back into python and following some more tutorials because I love these game tutorials. They give you a good wide area of knowledge and examples.

Ответить
@MCXAVYT
@MCXAVYT - 05.04.2024 12:00

I can't do it because I don't know how to put it into my program (which I am using Thonny), can you reply and give me some feedback? It would really mean a lot to me!

Ответить
@sigma-b8j6g
@sigma-b8j6g - 06.04.2024 18:38

i wuvv u my pookie wookie i also goon to u my pepe is blue

Ответить
- 29.04.2024 02:45

Awesome, Tim! Kudos! Greetings from Brazil!

Ответить
@Tactical_gaming111
@Tactical_gaming111 - 02.07.2024 13:38

My enemies just spawn and disappears what do i do😢

Ответить
@Anish-ew8li
@Anish-ew8li - 07.07.2024 23:21

make it easier

Ответить
@Anish-ew8li
@Anish-ew8li - 07.07.2024 23:22

i used chatgpt dont use chatgpt it destroys innoccent code

Ответить
@Anish-ew8li
@Anish-ew8li - 09.07.2024 03:17

some errors are not errors

Ответить
@Tick89
@Tick89 - 03.08.2024 09:41

Can anyone tell me, why would i make a game in pygame when i can use the game engine?

Ответить
@TheSlimbee
@TheSlimbee - 09.09.2024 01:47

I prefervmy coding standards much shorter and it looks like space invaders

Ответить
@thiyagutenysen8058
@thiyagutenysen8058 - 12.10.2024 20:07

How did you create the assets?

Ответить
@ajiazhou
@ajiazhou - 10.11.2024 04:17

This is one of the best pygame tutorials online because he tells you what each step does

Ответить