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

КОМЕНТАРІ • 34

  • @programmingwithnick
    @programmingwithnick  8 місяців тому +3

    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

  • @Tims_Projects
    @Tims_Projects 9 місяців тому +1

    Great work Nick, brings back memories when the game came out on an arcade machine in the local pub.

  • @Flave44
    @Flave44 7 місяців тому +2

    Thank you bro! Very good tutorial!
    I used this to make a school project!

  • @paulthomas1052
    @paulthomas1052 8 місяців тому +1

    Fantastic coding exercise - I learnt lots of new tricks. Such a great game too ! Thanks.

  • @bLedq
    @bLedq 5 місяців тому +1

    Its funny how overexcited youre are but also very helpful you explain everything from ground up. Good stuff!

  • @marcoantonioramirezsolis6275
    @marcoantonioramirezsolis6275 6 місяців тому

    Thanks for your tutorials, Nick. You rock and with your teaching method, I have retaken my career in game development. You rock :D

  • @sebascongo3084
    @sebascongo3084 2 місяці тому

    This is amazing tutorial, congratulations bro 👌👌

  • @vittalikb4930
    @vittalikb4930 3 місяці тому

    Great video thank you for your work

  • @minhbaby3243
    @minhbaby3243 9 місяців тому

    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é.

  • @kennethjones2849
    @kennethjones2849 3 місяці тому

    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.

  • @StarFury2
    @StarFury2 9 місяців тому

    Welcome back Nick! Will there be a C++ version of this?

  • @gianlucagiuman6132
    @gianlucagiuman6132 6 місяців тому

    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 :)

  • @foofoo17
    @foofoo17 9 місяців тому

    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.

    • @programmingwithnick
      @programmingwithnick  9 місяців тому

      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!

    • @foofoo17
      @foofoo17 9 місяців тому

      @@programmingwithnick I meant the laser sprite when it should be destroyed once it reaches the edge of the frame we have drawn

    • @programmingwithnick
      @programmingwithnick  9 місяців тому +1

      Good catch! You are right! We need to destroy it a bit earlier now that we have the frame. Thanks for letting me know.

    • @justcode194
      @justcode194 4 місяці тому

      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()])"

  • @NumK__
    @NumK__ 9 місяців тому +1

    Raylib version of this would be great

  • @goodlookinouthomie1757
    @goodlookinouthomie1757 2 місяці тому

    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 🙄

  • @lamyaalhajri_1026
    @lamyaalhajri_1026 7 місяців тому

    Hello how can I add a python file ?

  • @sonicdasher5656
    @sonicdasher5656 6 місяців тому +1

    How can I make this go on forever until I loose all 3 lives?

  • @happygofishing
    @happygofishing 9 місяців тому +1

    Is pygame more featureful than rsylib python bindings

    • @programmingwithnick
      @programmingwithnick  9 місяців тому

      Yes, pygame has many more features which make game development faster.

    • @happygofishing
      @happygofishing 9 місяців тому

      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

    • @StarFury2
      @StarFury2 9 місяців тому

      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.

  • @flamzy284
    @flamzy284 4 місяці тому

    Day 1:
    1:00:00

  • @user-yz1tn5be1i
    @user-yz1tn5be1i 4 місяці тому

    there's no download scammer.

    • @programmingwithnick
      @programmingwithnick  4 місяці тому

      Can you see the link to the github repository? The code is there, free to download for everyone.