Python Pygame Tutorial - Scrolling Background With Player

  Рет қаралды 28,986

code.Pylet

code.Pylet

Күн бұрын

Пікірлер: 79
@dominikzander1563
@dominikzander1563 6 жыл бұрын
Wow you put so much effort in doing examples and stuff like that you deserved lot more subs. Really good Video.
@Rage2gether
@Rage2gether 7 жыл бұрын
Hi I am from Vienna thank you for making these videos I just found your channel :)
@codePylet
@codePylet 7 жыл бұрын
+FuLongable Italy! I love Italy, we went there for our honeymoon. We went to Sienna numerous times, it really is a gorgeous little city! Thank you for your kind words by the way 😁
@Rage2gether
@Rage2gether 7 жыл бұрын
:)
@notapewdiepiebot3819
@notapewdiepiebot3819 5 жыл бұрын
How would you add objects that can be interacted with when you reach certain points of the background?
@that_awesome_maker
@that_awesome_maker 7 жыл бұрын
Great Videos man! keep making videos like these
@highgr6744
@highgr6744 6 жыл бұрын
how do i replace the circle with my sprite
@hornypoet
@hornypoet 4 жыл бұрын
as normal delete the draw function and other circle functions and replace them with the player IMG function and and the where you want it to be (x, y) simple ;)
@riyamandal7667
@riyamandal7667 2 жыл бұрын
Just blit it properly using screen.blit()
@jordivanveen7520
@jordivanveen7520 4 жыл бұрын
Nice guide, I was wondering something. What does the ':' do in for example this line of code: "if playerPosX > stageWidth - circleRadius: playerPosX = stageWidth - circleRadius". I've never seen that operator before.
@doviledasilvamonteiro8439
@doviledasilvamonteiro8439 4 жыл бұрын
it is not an operator. its just two lines attached in one. normally one would write: if playerPosX > stageWidth - circleRadius: playerPosX = stageWidth - circleRadius
@Light_of_the_dark
@Light_of_the_dark 2 жыл бұрын
how come when I did import sys it didn't work
@kanybol1845
@kanybol1845 4 жыл бұрын
I know you might not see this but how would you do this with sprites
@hippy6669
@hippy6669 6 жыл бұрын
Hi there, really good tutorial. Exactly what I was looking for.
@luis456ish
@luis456ish 5 жыл бұрын
Can someone help me please I do not know how to speak English very well so I do not understand very well some parts (I'm using google translator) my doubt is: in the video it is taught as the side scolling using movement on the x axis how would I make for the ball or the sprite to be to axis Y move up and down the screen?
@MrMa-og5hk
@MrMa-og5hk 7 жыл бұрын
I can not find the image file, moutains.png. can u pls let me know where can I download? thanks
@raz8657
@raz8657 7 жыл бұрын
u can get the moutains.png in the 2 link of code pylet after clicking the link.u will found seamless click it download the image.
@DeerhunterCZ
@DeerhunterCZ 7 жыл бұрын
As always a great video, thanks! And I am from Wellington, Somerset :)
@codePylet
@codePylet 7 жыл бұрын
+DeerhunterCZ I don't why but I always want to say Somerset in a farmer's voice!? I've never been to Somerset but for some reason I feel it has been cut off from mainstream English weather and has it's own Mediterranean climate instead. Going to Devon in August camping and that always reminds me of custard and rice pudding :O
@joshuabaker2833
@joshuabaker2833 4 жыл бұрын
@@codePylet nice to hear you like camping ever beem to Glastonbury Tor
@tylermartin4481
@tylermartin4481 5 жыл бұрын
Hey, I'm creating my major project at the present moment, I've followed the tutorial and used the document provided and I'm receiving an issue the drawing of the circle. The error states "integer argument expected, got float". you changed it to circlePosX from playerPosX. PlayerPosX works but circlePosX gets halfway across the screen and then encounters an error
@RummanNaser
@RummanNaser 5 жыл бұрын
The same thing happens to me
@eraghubi
@eraghubi 4 жыл бұрын
me too
@hehehaha3676
@hehehaha3676 7 жыл бұрын
Hey. I really enjoyed your coding challange video. Can you pls make more?
@codePylet
@codePylet 7 жыл бұрын
+Hány Inger Hi Hány, yes of course! Im working on a new video now but busy with life too so might be awhile. In the mean time if you need help just ask :)
@hehehaha3676
@hehehaha3676 7 жыл бұрын
Thx :D
@warzenschwein1057
@warzenschwein1057 4 жыл бұрын
thx for this video I looked for something this but every other video I found didn't work so thank you
@genericnpc2979
@genericnpc2979 5 жыл бұрын
How would i replace the Circle with an image out of one of my classes? (especially in terms of the variables)
@shakedbukai8079
@shakedbukai8079 5 жыл бұрын
i have this problem as well...
@genericnpc2979
@genericnpc2979 5 жыл бұрын
@@shakedbukai8079 I ended up doing it differently with the code found here programarcadegames.com/python_examples/f.php?file=platform_scroller.py
@raz8657
@raz8657 7 жыл бұрын
i can not see my circle
@AlvaroMartinez98
@AlvaroMartinez98 6 жыл бұрын
Everything works just fine, but my image isn't scaled correctly.. I cant see the floor of the image, it seems to be too large and the ground doesn't come up to the screen, any idea how to fix this?
@AlvaroMartinez98
@AlvaroMartinez98 6 жыл бұрын
Update: I used resizeimage.net to resize the image (resize, not crop) to my display size... Looks just fine now
@MahmudShuaib
@MahmudShuaib 2 жыл бұрын
will 500 fps affect the performance on the game?
@fabianconcha1994
@fabianconcha1994 4 жыл бұрын
Hey man, can you help me? I'm programming a videogame to my final proyect and I wanna know how can I replace the circle with a image?
@zairhyxezhyckatienza4789
@zairhyxezhyckatienza4789 4 жыл бұрын
Yep, you can with what you call "Sprites".
@alansimic2433
@alansimic2433 7 жыл бұрын
when i pass the third tree, the game freezes and it says: pygame.draw.circle(DS, WHITE, (circlePosX, playerPosY - circleRadius), circleRadius,0) TypeError: integer argument expected, got float Ive read your code and rewatched the video 20 times but dont know what went wrong.
@shrekthetroll7826
@shrekthetroll7826 7 жыл бұрын
change what's in the brackets to (int(circlePosX),playerPosY - circleRadius), circleRadius,0)
@alansimic2433
@alansimic2433 7 жыл бұрын
already tried but then the background scrolls the other way
@codePylet
@codePylet 7 жыл бұрын
Which version of pygame are you using?
@onefilm2709
@onefilm2709 7 жыл бұрын
thanks man you did help me :)
@alansimic2433
@alansimic2433 7 жыл бұрын
1.9.3
@uppedkestrel0672
@uppedkestrel0672 5 жыл бұрын
I can't get the code to work when I have circlePosX in the pygame.draw.circle(DS, WHITE, (circlePosX, playerPosY - 25), circleRadius, 0) If I used playerPosX on the other hand, it scrolls when the player gets to the centre, but the player moves faster than the background scrolling. Any advice? The error I get is: "pygame.draw.circle(DS, WHITE, (circlePosX, playerPosY - 25), circleRadius, 0) TypeError: integer argument expected, got float"
@RummanNaser
@RummanNaser 5 жыл бұрын
This happened to me as well, did you fix it?
@naramsettysaisantosh4813
@naramsettysaisantosh4813 6 жыл бұрын
Hey there are no images in your Google drive
@raz8657
@raz8657 7 жыл бұрын
can u say how to install pygame plase
@pythondeveloper6315
@pythondeveloper6315 5 жыл бұрын
In cmd: pip install pygame
@mariagabrielamendes8213
@mariagabrielamendes8213 3 жыл бұрын
Hi every one, can somebody help me? I need to make my player jump using the same code of the video.
@LogicQuest-u3e
@LogicQuest-u3e 5 жыл бұрын
Okay I can't just load image by typing "mountains.png". Where do I suppose to place png file?
@RummanNaser
@RummanNaser 5 жыл бұрын
The same folder as the python file I believe
@maniksingh6680
@maniksingh6680 4 жыл бұрын
LightningKhrizz same folder as the python file or just type the whole path ( r”C:/ ...”)
@andrewschroeder5485
@andrewschroeder5485 7 жыл бұрын
Hey! Great tutorial. But why does it freeze if the events() (line 40) line is not included? When I get rid of it it doesn't work :p
@codePylet
@codePylet 7 жыл бұрын
+Andrew Schroeder Good question. It's because pygame needs to communicate with the platform's window system. If you don't want to include the events() function then you don't have to buy you must include pygame.event.pump() instead to stop your program from crashing. Pump() and reading the event queue (I'm guessing) stops the program entering an infinite loops when an event occurs like pressing the X to close the window.
@Guimel6901
@Guimel6901 5 жыл бұрын
What means HW variable?
@codePylet
@codePylet 4 жыл бұрын
HALF WIDTH
@vasnot
@vasnot 6 жыл бұрын
how do you get the smooth movement?
@codePylet
@codePylet 6 жыл бұрын
Try increase the frame rate or use smaller graphics. :)
@itstagh1902
@itstagh1902 2 жыл бұрын
replaced the circle with an image and it broke everything
@superideias4146
@superideias4146 4 жыл бұрын
I need to know how to use pygame in notepad ++ HELLPPP PLS ;-;
@ganeshreddy3211
@ganeshreddy3211 5 жыл бұрын
thank you sir
@vetherhax546
@vetherhax546 6 жыл бұрын
Thank you for turourial =)
@tcgvsocg1458
@tcgvsocg1458 3 жыл бұрын
Continue
@naramsettysaisantosh4813
@naramsettysaisantosh4813 6 жыл бұрын
Plz respond fast
@codePylet
@codePylet 7 жыл бұрын
Where do you come from? I'm from a village in England called Binbrook goo.gl/g7RcDu
@huero117
@huero117 7 жыл бұрын
code.Pylet hello!! i'm from san luis potosi mexico goo.gl/maps/V9qq4dsfSfF2
@codePylet
@codePylet 7 жыл бұрын
+rafael gonzalez A city slicker huh!? Please to meet you Rafael
@huero117
@huero117 7 жыл бұрын
excuse me, what is a city slicker??
@codePylet
@codePylet 7 жыл бұрын
+rafael gonzalez A city slicker is someone who lives in a city environment and doesn't understand what it is like to live else where :0. I prefer village life, too many people in cities. A city reminds me of a giant termites nest lol please don't be insulted, I'm just joking.
@huero117
@huero117 7 жыл бұрын
jajaja, don't worry, in fact, San Luis is not a big city... we have only the Centro to walk and some squares, (we call Centro the center of the city). Let me guess, Are you an external developer? or, are you from there?
@pythondeveloper6315
@pythondeveloper6315 5 жыл бұрын
Its not good
@szilagyipetihu
@szilagyipetihu 6 жыл бұрын
1200 subscribers? wtf is wrong with you youtube
PyGame Beginner Tutorial in Python - Infinite Scrolling Background
12:35
Coding With Russ
Рет қаралды 52 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Python Pygame Tutorial - Sprite Sheets
14:01
code.Pylet
Рет қаралды 32 М.
Python Pygame Tutorial - Scrolling Background Image
10:30
code.Pylet
Рет қаралды 36 М.
Menus - Pygame Tutorial
7:37
DaFluffyPotato
Рет қаралды 178 М.
Python Pygame - IMPORTANT: Convert Your Images!
4:09
code.Pylet
Рет қаралды 10 М.
OpenAI's o1 just hacked the system
26:31
AI Search
Рет қаралды 25 М.
Python / Pygame Tutorial: Animations with sprites
14:25
Clear Code
Рет қаралды 124 М.
Can Singaporeans Solve MATH Questions for $100?
18:13
WONJON
Рет қаралды 1,8 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН