PyGame Beginner Tutorial in Python - Infinite Scrolling Background

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 97

  • @nazr763
    @nazr763 Рік тому +24

    I am Japanese. There are not many people in Japan who are uploading videos on making games in python, so this video is very helpful. Thanks a lot for your clear and detailed explanations!

  • @jermania7467
    @jermania7467 2 роки тому +17

    Good to see new content again. You do have some of the best python tutorials out here. Thanks!

  • @GamingGuruImMortaL
    @GamingGuruImMortaL 2 роки тому +6

    Finally pygame content is back!🤣🤣
    Bro you make one of the best pygame tutorials, please continue to do so in future.

  • @plexus2000
    @plexus2000 2 роки тому +2

    YES great to see your back i did all of the platformer

  • @DineshVaidyaOfficial
    @DineshVaidyaOfficial 2 роки тому +3

    Wow! nice to see you back sir! Also Liked!!

  • @Dexjet
    @Dexjet 2 роки тому +6

    Exceptional Tutorial as always. Thanks so much.

  • @gianlucagiuman6132
    @gianlucagiuman6132 2 роки тому +2

    Nice to see you again !!! i try to make smoothless the scroll downsizing the fps, but with no result ...

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      Thanks! Yes I had this problem as well, and when I looked into it online it seems to be one of the limitations of pygame. Normally in the game you would have more things on the screen so the background won't be as noticeable, but when it is the only thing on the screen it does look like it is a little jittery.

  • @BRO...21
    @BRO...21 2 роки тому +1

    Thank you very much, I like it and this is the best tutorial i have

  • @technobladed1
    @technobladed1 2 роки тому +2

    Thanks for the video helped me a lot!

  • @CharlieAngel-vy5zi
    @CharlieAngel-vy5zi 3 місяці тому +1

    Thanks very useful I am searching how to do parallax now

  • @ElaineFlorMS
    @ElaineFlorMS 2 роки тому +4

    Thanks so much for your tutorials. They are helping me a lot.
    Can you please maybe teach how to do a main menu with two different backgrounds? For example 1 bg in menu with buttons play, credits and exit and when the credits button been clicked another bg appears with the button to back to main menu. It will help me a lot with my game to college 😁

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому +1

      Glad to hear the tutorials are helping.
      I have a tutorial in my shooter game which has a main menu. It has play and exit, so you will need to add the credits option yourself but the tutorial explains the logic for the menu so you will be able to figure out how to add more options: ua-cam.com/video/wWLDUb71mFo/v-deo.html

  • @Ishaan_Garud
    @Ishaan_Garud 2 роки тому

    This helped me a lot
    I'll surely send you the Game I'm working one ❤️

  • @Varun_Squad
    @Varun_Squad Рік тому

    Thank you know I can tell my father how to create a scrolling background

  • @ming_z9157
    @ming_z9157 2 роки тому +2

    nice to see you again are you okay tho? your voice seems different stay healthy :D

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      Yea I'm all good, thanks! I don't know why it sounded different...I must be out of practice :)

  • @sportfrenz6149
    @sportfrenz6149 2 роки тому +2

    How do I make the background move with my player?

  • @MahmudShuaib
    @MahmudShuaib 2 роки тому +2

    Thanks Russ! Thanks

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      You're welcome!

    • @MahmudShuaib
      @MahmudShuaib 2 роки тому +1

      @@CodingWithRuss am learning so fast i need to slow down!

  • @KalifSSJ
    @KalifSSJ 10 місяців тому

    I from Polan
    bro Zajebista Robota🙂

  • @vietnguyenvan9216
    @vietnguyenvan9216 2 роки тому +2

    Next video, i hope you will do st about effect and shader

  • @JaJ-w3b
    @JaJ-w3b Рік тому +1

    I know you can scroll the opposite way by scroll += but it doesn't load the new image near as smoothly on the left, any tips? Thanks

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

    thanks from Algeria

  • @Mightbeola
    @Mightbeola Рік тому +1

    Thanks so much, love the content.
    I've figured how to do this vertically but would it be possible to do it in the opposite direction

    • @satyre5844
      @satyre5844 11 місяців тому

      how did you make it vertical?

  • @_Chop
    @_Chop 2 роки тому +1

    How can you change the Y coordinate of each individual image so each one is at a different height

  • @chaneychane9339
    @chaneychane9339 2 роки тому +2

    thank you so much!

  • @Jignesh_Editz
    @Jignesh_Editz 2 роки тому +3

    bro you are the best 😢 love from india can you me playlist on pythone 3d games ❤

  • @tyrashorts2756
    @tyrashorts2756 Рік тому

    Wow thanks alot for this awesome tutorial

  • @AdylKadyraliev
    @AdylKadyraliev Рік тому +1

    Hello quick question, if i need to do it for clouds for example like in stardew valley menu interface. Can i use only 1 image with 5-6 clouds and move it like in the video but ofcourse slowly. Ty for the video

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      Hello. Yes sure that would work as well and you could even have different clouds move at different speeds if you wanted to.

  • @bubbletae810
    @bubbletae810 19 днів тому

    Thank you so much! However, I need to do this in C, is it possible?

  • @ganth881
    @ganth881 Рік тому

    Hi! Apparently I am trying to combine this endless scrolling with your parallax scrolling. However I can't seem to get it work properly, it fails to blit the background layer in on time and keeps glitching

  • @jjero0000oo
    @jjero0000oo 2 роки тому +2

    Russ, can you make a tutorial on a background which follows the player?

    • @navkd1854
      @navkd1854 Рік тому

      look at the parallax background tutorial, that shows the background moving with controls of the user

  • @Nightmare-dd4bp
    @Nightmare-dd4bp 2 роки тому +2

    Thanks

  • @quantamlegend79
    @quantamlegend79 Рік тому +1

    It worked

  • @Floffffff
    @Floffffff 11 місяців тому

    I am trying to make my program working but the -= operator isn't doing anything. How can I fix?

  • @krentor1
    @krentor1 Рік тому +1

    is there a way or tut how to add ground on this scrolling bcgr that ground would scroll slower , or how to implement 2 or 3 different scrolling surface or assets?

    • @paleo_ferns
      @paleo_ferns 11 місяців тому

      did you figure out a solution?

    • @krentor1
      @krentor1 Місяць тому

      I lost my code all ness gonna start all over🎉thanks

  • @pug6436
    @pug6436 Рік тому

    or use modulus operator for the position

  • @harshitkhanna4086
    @harshitkhanna4086 2 роки тому +1

    Understood complete

  • @Gehtmansparrow
    @Gehtmansparrow 2 роки тому +1

    which programm do u use?

  • @navkd1854
    @navkd1854 Рік тому +1

    hello, how do you make the screen scroll gradually faster

    • @CodingWithRuss
      @CodingWithRuss  Рік тому +2

      Instead of scroll -= 5 you could do something like scroll -= scroll_speed. Then you can gradually increase the scroll_speed variable using a timer or a counter so your scrolling will be sped up

    • @navkd1854
      @navkd1854 Рік тому +1

      @@CodingWithRuss thank you!

  • @ibuki634
    @ibuki634 2 роки тому

    how can i add words, bgm or other img on it? the bg still looping but the words and img on it are still

  • @yurabohm2561
    @yurabohm2561 Рік тому

    hi, thank you for you for this tutorial. I attempted to implement it for Y-axis scrolling, but it only functions in one direction (scrolling upwards). However, when I tried it for the opposite direction, it appears as if the image is being dragged (similar to what happens at the 9:13 mark in the video). Do you have any advice to offer that could assist me?

    • @CodingWithRuss
      @CodingWithRuss  Рік тому +1

      The problem is likely to be the same as what I demonstrated in the video. It's just happening on the vertical axis instead of horizontal. It sounds like the second image isn't coming in behind the first and you end up with this dragging effect. Check that you're passing the right coordinates for the second image to come in at the right location.

    • @yurabohm2561
      @yurabohm2561 Рік тому

      thanks for answer. it was just a " - " what I needed hahaha xD

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

      @@yurabohm2561 Where? haha

  • @KidsOnKet
    @KidsOnKet 2 роки тому +1

    Any chance this is doable with height as well as width?

    • @CodingWithRuss
      @CodingWithRuss  2 роки тому

      Yea it can be applied vertically in the same way

  • @Floffffff
    @Floffffff 11 місяців тому

    What if i want to make it scroll vertically? Should I just swap width with height?

    • @CodingWithRuss
      @CodingWithRuss  11 місяців тому +1

      Yea pretty much. Same logic but on the y axis instead

    • @Floffffff
      @Floffffff 11 місяців тому

      @@CodingWithRuss perfect, thank you so much

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

      @@Floffffff How did you do that?

  • @ushabothra54
    @ushabothra54 Рік тому

    After writing entire code on VSCODE it is showing fault about bg = pygame.image.load(" BG.png").convert()
    Please Sir if possible solve my problem.....Thanks a lot.

  • @reddy423
    @reddy423 Рік тому

    Is it possible to somehow impement it in def function ?

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      Yes, sure. You could put it into a function or even a class if you like.

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

    good

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

      thanks

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

      @@CodingWithRuss hi man you've helped me a lot i didn't expect you to see my comment really thank you for your effort really appreciate your content

  • @trinimafia001
    @trinimafia001 Рік тому

    trying to do this to get it to scroll vertically but it jus scrolls horizontally...

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      To scroll vertically you would need to change it to move along the y axis instead of the x axis

  • @froggy12patel58
    @froggy12patel58 Рік тому +1

    Cool😂

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

    sir sir pls tell me why the buttonmodule is not downloading using pip sir pls tell me sir i have less time pls pls sir a humble request from me

  • @scratchasmr-yash4958
    @scratchasmr-yash4958 Рік тому

    It is only scrolling perfectly towards right but not towards left 🤔

    • @CodingWithRuss
      @CodingWithRuss  Рік тому

      It will scroll left as well but you have to adjust the code so the background images are drawn on the left otherwise you will get a smudging looking effect

  • @dongiannisiliadis9018
    @dongiannisiliadis9018 10 місяців тому

    Hold that like

  • @Valorpoker
    @Valorpoker 11 місяців тому

    Your videos are great, could you leave your codes written here, hugs.

  • @official_Liume
    @official_Liume Рік тому

    9:24

  • @jordiwang
    @jordiwang Рік тому

    BAD tutorial, now I perfectly understand why you have a few likes. IT says Beginner tutorial but then you just assume we already know what frames rates and clocks are and what they do. Really bad....

    • @navkd1854
      @navkd1854 Рік тому +1

      that's basic knowledge of computers buddy. those arent necessarily coding terms.

    • @meditair
      @meditair Рік тому

      if you only know the basics you are a beginner so if you dont know it you just nothing not even a beginner