Тёмный
No video :(

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

Coding With Russ
Подписаться 50 тыс.
Просмотров 33 тыс.
50% 1

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:
github.com/rus...
Check out my other PyGame tutorials:
Space Invaders coding tutorial: • Pygame Space Invaders ...
Flappy Bird coding tutorial: • PyGame Flappy Bird Beg...
Credits for background images:
jesse-m.itch.i...

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 52   
@2MSTennis
@2MSTennis 2 года назад
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!
@drewnash132
@drewnash132 Год назад
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.
@xaviergo9645
@xaviergo9645 Год назад
where can i copy the code?
@ToujoursIris
@ToujoursIris 2 года назад
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)
@CodingWithRuss
@CodingWithRuss 2 года назад
Thanks! And good to see you again :)
@ToujoursIris
@ToujoursIris 2 года назад
@@CodingWithRuss Yea, we have summer break now so I can watch your videos :)
@atharvkumar2564
@atharvkumar2564 2 года назад
Yeah
@xaviergo9645
@xaviergo9645 Год назад
where can i copy the code?
@SkyFly19853
@SkyFly19853 2 года назад
Wow... Python has so much potential...
@ghazalareeba126
@ghazalareeba126 Год назад
Just what I needed ❤
@CodingWithRuss
@CodingWithRuss Год назад
Glad it helped
@fbushphone
@fbushphone 2 месяца назад
Elegant thanks for sharing
@CodingWithRuss
@CodingWithRuss Месяц назад
Thanks!
@UnleashedEntomber
@UnleashedEntomber 2 года назад
I hope you will be back soon, you are making great staff.
@CodingWithRuss
@CodingWithRuss 2 года назад
I've been working on a new game, it should be ready soon :)
@floridaadventurediving144
@floridaadventurediving144 Год назад
Great tutorial Russ!
@CodingWithRuss
@CodingWithRuss Год назад
Thanks!
@idiedlastmonth
@idiedlastmonth Год назад
Absolutely wonderful!
@CodingWithRuss
@CodingWithRuss Год назад
Thanks!
@plexus2000
@plexus2000 2 года назад
Oh that looks great
@ferasalatrash7372
@ferasalatrash7372 2 года назад
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 😅
@CodingWithRuss
@CodingWithRuss 2 года назад
Thanks! Glad you like it. Yes that's something I'd like to look at because I've noticed sometimes the games I make are too big or too small on other people's screens
@coderunner743
@coderunner743 2 года назад
Super explanation and awesome effect
@DineshVaidyaOfficial
@DineshVaidyaOfficial 2 года назад
Really Awesome. Thank You very much...
@alexany4619
@alexany4619 6 месяцев назад
Hi, how would you locate and move sprites behind the first layer?
@user-zh2ed1wl5p
@user-zh2ed1wl5p 9 месяцев назад
Actually I tried to apply the endless scrolling with this parallex logic, but its not continous as compared to a single image
@uthmanjimmy1377
@uthmanjimmy1377 Месяц назад
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?
@CodingWithRuss
@CodingWithRuss Месяц назад
I've noticed jittering in a few of my pygame projects where I have continuously moving images and spent a while trying to troubleshoot them but could never figure it out. Not really sure what causes it.
@uthmanjimmy1377
@uthmanjimmy1377 Месяц назад
@@CodingWithRuss Good to know! Thanks for your speedy reply!
@AG06_GabryGunner
@AG06_GabryGunner Год назад
i see that it draws 5 times, i do wonder if it can loop infinately for x in range(5):
@CodingWithRuss
@CodingWithRuss Год назад
Yes it would be possible to do. I have another video where I explain how to create an infinite scrolling background so the method in there can be combined with this one to give an infinitely scrolling parallax background. This is the other video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ARt6DLP38-Y.html
@xavierbourguignon37220
@xavierbourguignon37220 10 месяцев назад
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
@CodingWithRuss
@CodingWithRuss 10 месяцев назад
To achieve that, you can combine the parallax logic with the endless scrolling logic from this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ARt6DLP38-Y.html
@frazomania
@frazomania 5 месяцев назад
@@CodingWithRuss wow great so helpful, do you not understand that it has a delay like it doesnt work like that
@anameter4715
@anameter4715 2 года назад
Hi. Do you have a snake game in pygame?
@evagok3698
@evagok3698 Год назад
Completed! jehhueeheyy!
@CodingWithRuss
@CodingWithRuss Год назад
Wow you're getting through them quick. I will need to make more :)
@evagok3698
@evagok3698 Год назад
@@CodingWithRuss I will be doing your all videos about python because I think they are really nice and you are very good at sharing your knowledge. Thanks a lot. Ohh also after making that platform game some people tried it and 6 years old a child like it very much and I felt super proud. I just followed all your tutorials and I had change to write the code and I learn a bit of course. Thank you for me feeling good. I really appreciate that.
@onr28
@onr28 11 месяцев назад
Is there a way to make this infinite?
@CodingWithRuss
@CodingWithRuss 11 месяцев назад
Yes, you can combine it with this video to create an infinite parallax background: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ARt6DLP38-Y.html
@ghguyrur7
@ghguyrur7 Год назад
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
@CodingWithRuss
@CodingWithRuss Год назад
You can split your project into different files and this background effect can be one of those parts. You can then import it into your main game and use it there.
@ghguyrur7
@ghguyrur7 Год назад
@@CodingWithRussyou’re amazing and you’ve me helped so much
@walti3202
@walti3202 Год назад
peak
@half-eye3006
@half-eye3006 Год назад
you guys know how to make the image in a infinit loop.
@CodingWithRuss
@CodingWithRuss Год назад
This video shows how to make an infinite background, so you can apply the same logic here by modifying the code a little bit: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ARt6DLP38-Y.html
@half-eye3006
@half-eye3006 Год назад
@@CodingWithRuss i managed to make it, thank you brother
@CodingWithRuss
@CodingWithRuss Год назад
@@half-eye3006 Nice one
@shadowace159
@shadowace159 11 месяцев назад
@@half-eye3006 Hello, I'm trying to make the same thing. Did you have to make a scroll variable for each background? Or is there a less redundant way to do things?
@half-eye3006
@half-eye3006 11 месяцев назад
@@shadowace159 scroll variable for each background i did that
@Doubletrouble192
@Doubletrouble192 2 года назад
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?
Далее
I made Games with Python for 10 Years...
28:52
Просмотров 318 тыс.
The Beauty of Parallax
10:23
Просмотров 284 тыс.
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Просмотров 901 тыс.
How I make science animations
43:39
Просмотров 719 тыс.
Making a Game with Java with No Experience
8:41
Просмотров 224 тыс.