PyGame Beginner Tutorial in Python - 3D Background Effect with Parallax Scrolling

preview_player
Показать описание
In this video I will explain how to use parallax background to create a 3D background effect.
I am going to show how to setup the different layers correctly and how to control their individual scroll speeds to give the impression of depth to the background.

Code and assets on github:

Check out my other PyGame tutorials:

Credits for background images:
Рекомендации по теме
Комментарии
Автор

I think this would be really cool for a turn based rpg. Have the character enter the instance and when a mob approaches it enters a battle sequence!! Cheers!

MSTennis
Автор

Wow...
Python has so much potential...

SkyFly
Автор

Thanks a lot. Amazing tutorial.
I am a new in pygame, but not in python. So I implemented the Parallax logic to my code and it looks terrific.
I decreased scroll step from 5 to 0.8 and increased x range for the endless effect.
P.S. found nice background images on craftpix.

drewnash
Автор

Really Awesome. Thank You very much...

DineshVaidyaOfficial
Автор

A nice way for creating a 3D effect. Was a bit hard for me to do it myself, but I followed the tutorial and got the required output. (still waiting for the discord server)

ToujoursIris
Автор

I hope you will be back soon, you are making great staff.

UnleashedEntomber
Автор

I found your channel recently and your content is amazing!
Could you please do a game with full screen so we can learn how to handle that every user might have a different screen size 😅

ferasalatrash
Автор

Hi, how would you locate and move sprites behind the first layer?

alexany
Автор

Actually I tried to apply the endless scrolling with this parallex logic, but its not continous as compared to a single image

zhedwlp
Автор

Hi. Do you have a snake game in pygame?

anameter
Автор

So I make this, do I also code my game in here? I’m still not sure if I’m supposed to use one box of code for my whole game or if I’m breaking it into parts

ghguyrur
Автор

How would one do an endless scroller? Currently when we hit the last image in the list, we get nothing else. I guess there is a way to wrap these images around

xavierbourguignon
Автор

i see that it draws 5 times, i do wonder if it can loop infinately
for x in range(5):

AG_GabryGunner
Автор

I notice a bit of jitter while scrolling. Have you found a solution for this? Perhaps this approach might not be the best way of doing parallax effects?

uthmanjimmy
Автор

you guys know how to make the image in a infinit loop.

half-eye
Автор

Hello! I am new to programming and am attempting to code a something in Pygame, however I am struggling a lot. Would it be possible if I could contact you somehow and ask for some help?

Doubletrouble