PyGame Scrolling Shooter Game Beginner Tutorial in Python - PART 1 | Creating the Player

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024
  • In this Python tutorial I code a Scrolling Shooter Game using the PyGame module. I'm going to cover the initial game setup and how to create the player
    Code & assets on my website: codingwithruss....
    Alternative link: github.com/rus...
    Credits for assets used:
    mtk.itch.io/gr...
    erayzesen.itch...
    secrethideout....
    soundbible.com...
    soundimage.org...
    Check out my other PyGame tutorials:
    Space Invaders coding tutorial: • Pygame Space Invaders ...
    Flappy Bird coding tutorial: • PyGame Flappy Bird Beg...

Комментарии • 447

  • @r.e.4873
    @r.e.4873 7 месяцев назад +5

    Props to you for not only teaching people how to make an actually interesting game, but also taking an object-oriented approach right from the start. This really stands out from the crowd as a tutorial. I just hope the code isn't outdated by now with updates to python / pygame.

  • @green_quadrix
    @green_quadrix 3 года назад +82

    woah! this is by far the coolest and educational tutorials on pygame i've ever had! you're awesome! thanks a million!🤩😊

  • @phoenixninja8872
    @phoenixninja8872 2 года назад +10

    Man I can't thank you enough for this tutorial series. I'm using the game logic as a foundation for my A level CS project but I've changed the player and enemy sprites and eventually when the enemy engages in a battle with enemies, im gonna make it so that the game loads up a CS Multiple choice question and some more jazz. I got 7 weeks left to code, document and submit it and this series is honestly gonna be a lifesaver. Thank you so very much.

    • @Ray-sb8qi
      @Ray-sb8qi 2 года назад +1

      howd it go mate

  • @cosmo8874
    @cosmo8874 3 года назад +11

    Following along with this series and adding my own ideas to my project as I go along. Already I can see that with the first video you are clear and concise when explaining difficult concepts, and you have really helped me so much. Thank you so much for posting quality content like this!

    • @CodingWithRuss
      @CodingWithRuss  3 года назад +1

      Thanks! I'm glad you're finding it useful. Hope to see a demo of your project when you finish it :)

  • @jesterc.6763
    @jesterc.6763 3 года назад +7

    Thank you so much my Guy!! this is awesome. Imagine a project like this would cost thousands of dollars to learn in post secondary institutions, but here we are, the universe has blessed us a Man that willingly share his knowledge for FREE to idiots like me to potentially make it in life. THANK YOU.

  • @ratnadeephalder2745
    @ratnadeephalder2745 3 года назад +21

    Never thought making a difficult game like that could be explained so easily, thanks a lot 😭♥️

    • @CodingWithRuss
      @CodingWithRuss  3 года назад +3

      Thanks! I'm glad it actually makes sense :D

  • @opst1x89
    @opst1x89 3 года назад +8

    This helped me so much!!! had some problems with using classes but you cleared it for me! you went right to the point and it is explanied so good! best tutorial ever!

    • @CodingWithRuss
      @CodingWithRuss  3 года назад +1

      Thanks! Much appreciated. I'm glad the videos are helpful :)

  • @jgartz8392
    @jgartz8392 3 года назад +10

    Great tutorial. Ill be following this series to make my own but Ill add some of my own ideas to my game. You are good at explaining whats going on and that makes it easy to follow. Thanks

  • @lucasdahl1118
    @lucasdahl1118 3 года назад +1

    BY FAR ONE OF THE BEST CHANNELS FOR PYTHON CONTENT, IF NOT THE GREATEST!

  • @Dash-mio
    @Dash-mio 3 года назад +1

    one of the best tutorials on pygame in yt

  • @CodingWithRuss
    @CodingWithRuss  3 года назад +8

    Part 2 uploaded, in which I add in keyboard controls to move the character: ruclips.net/video/7WsE1Vy1Krg/видео.html

  • @serratedhumor8468
    @serratedhumor8468 2 года назад +2

    The way you explain everything. perfect. thank you!

  • @atakankorkmaz2
    @atakankorkmaz2 3 года назад +2

    Great video man. This is definitely the most educational pygame video i've ever seen. The way you explained OOP was perfect.

    • @CodingWithRuss
      @CodingWithRuss  3 года назад +1

      Thanks a lot! Glad you found it helpful

  • @chetnajadwal1975
    @chetnajadwal1975 2 года назад +3

    Great explanation, I understand all the small, big and hard concepts. This channel deserves more subscriber's. 😀

  • @anypuppet
    @anypuppet 3 года назад +5

    This is fantastic!😃Looking forward to follow along.

  • @rutgersmit3383
    @rutgersmit3383 3 года назад +1

    I've seen you previous platformer, but this tutorial is even better!
    Thank you for these tutorials!

    • @CodingWithRuss
      @CodingWithRuss  3 года назад +1

      Thanks, I worked on improving the previous platformer and added extra features to make this one

  • @daniela.3524
    @daniela.3524 Год назад +1

    i love how you explain python basics like oop. i'm just getting started and the way you explain it and show how it works makes me understand it better than in my udemy course ^^
    thanks and keep up the good work!

  • @trailsanddales4356
    @trailsanddales4356 3 года назад +1

    Nice to see your channel growing. Great work

  • @tonyburn
    @tonyburn 2 года назад +1

    Fantastic! I always believe anything can be explained, if its explained correctly and you sir have nailed it! You have talked OOP, that can be quite complex, and explained it in a way that can be understood. I agree with all the other comments here. This tut is one of the best I have seen and is worth a sub alone, so I have. Thank you. :)

  • @matthewhook3375
    @matthewhook3375 3 года назад +4

    Awesome, love your tutorials. Cant wait to follow along with this one! Many thanks for sharing with us.

  • @SS-id4hg
    @SS-id4hg 3 года назад +6

    AMAZING! Thanks for the videos!!!

  • @CodingIsFun
    @CodingIsFun 3 года назад +2

    Very cool tutorial. Thanks for sharing your knowledge! 👍

  • @decidev
    @decidev 3 года назад +1

    This looks like a realy cool series! I'll do it later!

  • @thelittledragon5595
    @thelittledragon5595 2 года назад +1

    tysm for these tutorials
    you explain these the absolute best and its so easy to understand

  • @soulEaterDex
    @soulEaterDex Год назад +1

    Really enjoying it short burst of information easy to understand

  • @Ask_Think_Learn
    @Ask_Think_Learn 18 дней назад +1

    Your absolutely awesome
    You've explained oop in such easy!!!

  • @LimbieV
    @LimbieV 3 года назад +3

    You make it sound like magic, but the achievable kind. Thank you so much for the tutorial !

  • @VivekKumar-yf8tb
    @VivekKumar-yf8tb 3 года назад +1

    Woah!!!!! One of the best tutorials ever on pygame THANK YOU VERY MUCH BROTHER ❤️

  • @varnikaaarora9219
    @varnikaaarora9219 3 года назад +1

    Thank you SO MUCH!! I was having trouble with classes and you cleared it all up for me!

  • @Peachwarrior-f9r
    @Peachwarrior-f9r Год назад +1

    by far this is the most advance thing i coded but when you say it, it feels a lot easier

    • @CodingWithRuss
      @CodingWithRuss  Год назад +2

      Glad to hear it's making sense. It's the most advanced thing I coded too 😅

  • @asy42699
    @asy42699 9 месяцев назад

    you explain better than a person in a paid course

  • @itcode2803
    @itcode2803 3 года назад +1

    WOOOOOOW CANT WAIT FOR PART TWO

  • @jonsantos6056
    @jonsantos6056 3 года назад +2

    Cheers for the clear tutorial mate!

  • @rafy-ivanmorales3077
    @rafy-ivanmorales3077 2 года назад

    I'm a new student trying to learn, so I can become a programmer with python and I have a project on how to make a port scan.
    So far I already make a port scan with Python3, and it scans fine, give a date and everything working good so far.
    I see on your video tutorial, it is very good.
    I would like to ask for your advice if you can and guide me on how I will add this 3
    in a Python script, I have:
    2. System should look for all the ports between the range of 1 to 1025
    3. If the Ports is open, it should create a file and add an entry for port number
    4. In case of any exception for instance “host is not available”, “host name could not be resolved” or
    due to any other error, you need to write that exception into the same file.
    Thank you and Merry Christmas.

  • @simex4274
    @simex4274 3 года назад +1

    Nice man. You know how to explain everything

  • @wajahatalibasharat6923
    @wajahatalibasharat6923 2 года назад +1

    good work and thank you so much, Greetings from Egypt

  • @jedicubing4771
    @jedicubing4771 2 года назад +2

    So I am not doing the exact same things as you right now, I am making my own project with help of this one. So one question, you scaled up the image at 9:41 however I want to scale down my image. I thought you could use decimals like 0.5 however, this makes my lengths float values. So how would I do it?

    • @CodingWithRuss
      @CodingWithRuss  2 года назад

      Yea you have to be careful with that. You could use int() to turn the floats into integers.

  • @star_t1
    @star_t1 3 года назад +2

    Finally tutorial came out :)

    • @CodingWithRuss
      @CodingWithRuss  3 года назад +1

      Part 2 coming soon :)

    • @star_t1
      @star_t1 3 года назад +2

      @@CodingWithRuss Glad to hear that. Your tutorial helped me to make a game (it's like platformer and flappy bird)

  • @avtar7406
    @avtar7406 3 года назад +1

    You teach really gratifying ,your great waiting for your next vedios.

  • @7guitarlover
    @7guitarlover 3 года назад +1

    this is awesome ! Thanks Russ !

  • @agustingomez9875
    @agustingomez9875 3 года назад +1

    What a tutorial!! Super!! Thanks a ton! Subbed immediately

  • @khargos7602
    @khargos7602 8 месяцев назад +1

    Woo!! Onto the next one.

    • @CodingWithRuss
      @CodingWithRuss  8 месяцев назад +1

      This was my favourite game to make. It had a bunch of little features that I hadn't made before so it was fun to figure them out. Hope you like it too.

  • @NoobNe_23
    @NoobNe_23 2 года назад +1

    SO GOOD I DID THE WHOLE THING

  • @ThiagoCosta-th1cs
    @ThiagoCosta-th1cs 3 года назад +1

    You're awesome, dude! Thank you very much!

    • @CodingWithRuss
      @CodingWithRuss  3 года назад +1

      Thanks! Glad you liked it

    • @ThiagoCosta-th1cs
      @ThiagoCosta-th1cs 3 года назад

      @@CodingWithRuss Did you read the book "Python crash course"?

  • @ahmedal-ebrashy3691
    @ahmedal-ebrashy3691 3 года назад +1

    I found it very useful, thank you.

  • @Anon3527bober
    @Anon3527bober Год назад +1

    that needs more views

  • @Mr.monidria
    @Mr.monidria 3 года назад +2

    its help me learn pygame a lot

  • @athethird
    @athethird 3 года назад +1

    thankyou dude, good job! I've learned a lot from you :D

  • @AbdulRahman-w6s
    @AbdulRahman-w6s 2 месяца назад +1

    million wows. great tutorial .

  • @dilemmaedits
    @dilemmaedits 2 года назад

    Fantastic Video till now!

  • @FRAMEDSKATEKREW69
    @FRAMEDSKATEKREW69 Год назад +1

    Well looks like a found a new lil project to try!

  • @Ibrahim-uz6sr
    @Ibrahim-uz6sr 3 года назад +1

    Im so exited to make this thanks bro

  • @duongvanphi862
    @duongvanphi862 3 года назад +2

    This is amazing!

  • @MuhammadAshraf-lo7pp
    @MuhammadAshraf-lo7pp 3 года назад +1

    Love and huge respect for you brother....Respect from Pakistan...My online teachers....Much respect for you all....

    • @CodingWithRuss
      @CodingWithRuss  3 года назад

      Thank you! I'm glad the videos are useful :)

  • @sksahil4374
    @sksahil4374 3 года назад +1

    i am being your fan.great video

  • @ryzen6284
    @ryzen6284 Год назад +2

    Thanks 🙏

  • @buymicheats
    @buymicheats 3 года назад +4

    Having problems getting the character files into the code. i have them all in a file called player and when I enter their specific name it will not input that image?

    • @eliasbegashaw1707
      @eliasbegashaw1707 3 года назад

      you need to edit the file player onto the programming language you use

    • @animevideos9213
      @animevideos9213 3 года назад

      @@eliasbegashaw1707 What do you mean by that Can you plss explain me in detail I have everytime I put full path of images it's shows an error plss help 🙏🙏🙏

  • @luqigongchang6213
    @luqigongchang6213 2 года назад +1

    thanks mate tNice tutorials was a big help

  • @semtx13
    @semtx13 3 года назад +1

    Sweet! I look forward to coding this. How often will these videos come out?

  • @BeRaikwal
    @BeRaikwal 3 года назад +1

    YOOOOOOOOOOO!!!!!!!!! AMAZING TUTORIALS AS ALWAYSS!!! 😎🤩😌

  • @sonicfan88321
    @sonicfan88321 2 года назад +1

    as someone who's spent the better part of a year coding to pep8 standards, your code annoys me
    But otherwise, great video series. Loved following along and trying to keep up

  • @Lapisdolphin
    @Lapisdolphin 7 месяцев назад

    wow this is so cool! How long did you spend making this set of videos?😃😃😃

  • @MJ-qk8nr
    @MJ-qk8nr 3 года назад +1

    Just subscribed. Amazing

  • @tragillsantos
    @tragillsantos 7 месяцев назад +1

    i think im finally getting it thanks man if u ever do decide to put out a course im interested

    • @CodingWithRuss
      @CodingWithRuss  7 месяцев назад

      Thanks, glad to hear you found it useful! And funnily enough, I do have a course :). There's a demo of it on this video plus the first 6 or so parts are free to view as a demo: ruclips.net/video/qSBmjSsscI4/видео.html

    • @tragillsantos
      @tragillsantos 7 месяцев назад

      @@CodingWithRuss and again thank you

  • @GAMEOLOGIST
    @GAMEOLOGIST 3 года назад +1

    Awesome tutorial 😍

  • @anirudhasahu3035
    @anirudhasahu3035 2 года назад +4

    your explaination and the game is totally amazing🤩😊
    can u give the link to download these images
    or how to get these types of images

    • @CodingWithRuss
      @CodingWithRuss  2 года назад +1

      Thanks! Yes the images are on the github repo in the video description

  • @adityagarg6734
    @adityagarg6734 3 года назад +2

    great job bro!!!!

  • @brhvoicu
    @brhvoicu 3 года назад +1

    Hello there! I am here to learn pygame and i just noticed that you don;t have an icon. To do that just put the next code:
    icon = pygame.display.image.load("imagename.png")
    pygame.display.set_icon(icon)

  • @lucasgardner6189
    @lucasgardner6189 3 года назад

    Hey, I burned through your original platformer series last night and I decided to try to make something of my own. I have a quick question though, when I try to set my window, I keep getting a error that says "video system not initialized." I have double and triple checked my code and it is IDENTICAL to yours at the 04:12 timestamp in this video. Any thoughts? I've googled all over the place to no avail. Thanks for your time

    • @CodingWithRuss
      @CodingWithRuss  3 года назад

      Hi Lucas, I've had some weird errors like that too sometimes even though the code is the same that I've used on other games. Maybe download the code from the link in the description and see if that runs OK?

    • @lucasgardner6189
      @lucasgardner6189 3 года назад +1

      @@CodingWithRuss thanks for the reply, I finally figured it out. For some reason I overlooked the fact that pygame.QUIT needed a colon instead of an open parenthesis. I'm really enjoying building my first game and you're helping me out quite a lot. Thanks again!

  • @valuecoast
    @valuecoast 2 года назад

    don't give up!, there are more difficult programs then tNice tutorials one

  • @FireBlender
    @FireBlender 2 года назад +1

    thanks it's really good

  • @miguelmondragon1366
    @miguelmondragon1366 Год назад +1

    Nice tutorial

  • @josebatista6259
    @josebatista6259 2 года назад

    Amazing class!

  • @tomdent2961
    @tomdent2961 2 года назад +4

    how do you get python

  • @aakash2333
    @aakash2333 3 года назад +1

    Thank you very much sir. Clearly understand.
    Sir please make the playlist for Super Mario game

    • @CodingWithRuss
      @CodingWithRuss  3 года назад

      Thanks! Glad you liked it. Super Mario would be pretty interesting to remake for sure!

  • @muchiitv9912
    @muchiitv9912 2 года назад +3

    Def:😁😁😁😁 class:💀💀💀💀💀💀

  • @dr_frankenmiller2607
    @dr_frankenmiller2607 2 года назад +1

    Thank you Russ all your awesome content walking us thru such cool Pygame builds, Hey Russ let's build Mario World 3 one these days the game engine and the level editor I want that game on MacBook so much the music the music baby Yoshi, are we allowed to build that game on RUclips w/o upsetting anyone?

  • @kieuvantube
    @kieuvantube 3 года назад +1

    That amazing I like it

  • @chinraymond311
    @chinraymond311 3 года назад +2

    is there any tutorial that teach how to import images cause i having problem with it

  • @1_and_only_Crjase
    @1_and_only_Crjase 3 года назад +1

    well explained 👍

  • @inaayaa7144
    @inaayaa7144 3 года назад +2

    I'm having a problem in the code, it says
    AttributeError: 'Soldier' object has no attribute 'draw'
    please help me fix this problem,
    thank you.

    • @nonstalgic6476
      @nonstalgic6476 2 месяца назад

      ik this is 3 years later but if ‘Soldier’ is an image then it can’t have the attribute ‘draw’

  • @abrarmasumabir3809
    @abrarmasumabir3809 3 года назад +1

    You are awesome!

  • @engineerstrange7381
    @engineerstrange7381 3 года назад +2

    ❤️❤️❤️❤️❤️❤️❤️thank you so much

  • @dhruvpaidukle835
    @dhruvpaidukle835 3 года назад

    Helped me alot thanks

  • @tryserve
    @tryserve Год назад +1

    what did u use to import images and where did u put the images?

  • @kshawn2579
    @kshawn2579 Год назад

    Bro You are the best! but still why is your popularity so low? 😐😐☹☹

  • @HansuTycoon
    @HansuTycoon 3 года назад +1

    very good!

  • @kartikeyamaney4871
    @kartikeyamaney4871 3 года назад

    can you teach panda 3d too
    cause you are the best game developer I know on youtube and
    thanks for this amazing tutorial

  • @why7636
    @why7636 3 года назад +2

    What do I do with the assets

  • @yeonve
    @yeonve 3 года назад +1

    THANK YOU SO MUCH YOUR THE BEST I SUBSCRIBE 🙏🙏🙏🙏

    • @CodingWithRuss
      @CodingWithRuss  3 года назад

      Thank you, glad you like the tutorial! :)

  • @mlisaglisa9049
    @mlisaglisa9049 3 года назад +1

    i can't connect images to my work. how do i fix it.
    line 15, in that is what pop up

  • @saadedi75
    @saadedi75 3 года назад

    thanks for all

  • @okami3d
    @okami3d 2 года назад +1

    thanks helpful vid

  • @shockz6970
    @shockz6970 3 года назад +1

    Nice Video! Just one small problem. For line 15, I put in the same code (just with my own png), and it can't find the file. I also typed img = pygame.image.load('insert my png'), and it still can't find the png. Is there a way to troubleshoot?

    • @andrewgilmore9181
      @andrewgilmore9181 3 года назад +1

      you have to put all the images that you want to use in a file named 'img' , then you put that file into the projet file

    • @shockz6970
      @shockz6970 3 года назад

      @@andrewgilmore9181 Oh, now that makes sense :) Thanks!

  • @vakogrigolia8138
    @vakogrigolia8138 3 года назад +2

    it says FileNotFoundError: No such file or directory.

  • @alphacentury7095
    @alphacentury7095 2 года назад +1

    Thats amazing👏🏻👍🏼👍🏼 Will it run in VS Code ......?

    • @CodingWithRuss
      @CodingWithRuss  2 года назад

      Thanks! Yes, it doesn't matter which editor you use.

  • @danielfajardo4558
    @danielfajardo4558 2 года назад

    Dw bro ADHD helps out so much with soft soft i find. day dreaming always gives new ideas so when i snap back i got that vision ready

  • @ghettofilms2792
    @ghettofilms2792 3 года назад +4

    I'm gonna lose my mind, I've looked at hundreds of tutorials and explanations but I don't understand anything about the images one bit. Can you please explain to me how to do it. Thank you in advance!

    • @ghettofilms2792
      @ghettofilms2792 3 года назад +3

      when I import the file into pygame and use the pygame.image.load ('filename.png') it says "FileNotFoundError: No such file or directory" please help :)

    • @cmb8860
      @cmb8860 3 года назад

      @@ghettofilms2792 I think you need the file path ex. '/Users/user/Desktop/textures/png/Idle__001.png'

    • @opst1x89
      @opst1x89 3 года назад

      @@ghettofilms2792 listen you need to create a folder with your game script in python and in that folder you need to have your images and everything, after that before launching your game you need to type in the terminal cd "YOUR FOLDER PATH HERE" for example cd "assets/png.png" something like that. this will tell python to look at that folder

    • @ghettofilms2792
      @ghettofilms2792 3 года назад

      @@opst1x89 oh ok I’ll try that. Tysm :)

    • @papafranku5780
      @papafranku5780 3 года назад

      Did it work? If not, I always have my sprites in the same folder as my python file. This must work

  • @thundertitans
    @thundertitans 7 месяцев назад

    Hi! I had a question about the image. I think you need the image for the character to already be saved, so where would I find this?

    • @CodingWithRuss
      @CodingWithRuss  7 месяцев назад

      Hello, the images are all available to download from my github. I've linked it in the video description

  • @thepandaboySTanimations
    @thepandaboySTanimations 2 года назад +1

    Thanks :)