How to Code an Infinite Scrolling Background in Python for Endless Games!

preview_player
Показать описание
This video uses Python and the PyGame module to demonstrate how to create an endless infinite game background that will scroll forever in your Python games!

Pygame is a great module for building simple games in python, and makes having an infinite background really easy! This is great tutorial for python and PyGame beginners or people familiar with Object oriented programming already, but new to the PyGame module!

If you have any questions or want to see something specific in the future, be sure to let me know about it in the comments below and I'll get right back to you! Be sure to leave a like on the video and subscribe to the channel to stay up to date with all our future content!

Thanks so much for watching and good luck with your code!

Timestamps:
00:00 Introduction
01:31 Pygame setup
5:00 Loading an Image and Drawing it
11:37 Moving the Background Image
17:20 Outro
Рекомендации по теме
Комментарии
Автор

Thank you for the tutorial, very helpful and well explained!

gabriel_felippe
Автор

Hello, could you maybe help me or tell me how to make that after a certain distance the background stops scrolling and you hit a wall or something like that? I need such functionality but horizontally not vertically as I am making a freefall simulation. Nice video and keep up the good work!

krzysztofdymanowski
Автор

hello ...nice ..i code it with you ..all went perfect... now ....how we draw a human thing toon to moving it in this game and some obstacles, how we jump the obstacles with the toon mabe put some coins on the way to colect it ( do like an example on each thing and we can play around after create more (multiplicate the objects etc )
...and a sugestion ....(not that is any bad but you coding is fast ....some of us we starters and )if you can go more slow on explaining the code and typyng so we can keep up better (because the way it is we have to pause the video :D ) ...thanks and keep up the good work

MaxStudioCG
Автор

I actually had to use `>=` instead of `>` for resetting the scroll. Otherwise there was a slight flickering effect.

marcopleines
Автор

L❤ve this but I'm waiting pygame console rpg game or maybe simulation live city or) space. You are very cool, thanks 😊

itstart
Автор

can you include the image? i couldn't find the same one you have in your project? 🤥

kylebaker
welcome to shbcf.ru