Game Development in Python 3 With PyGame - 4 - Adding Boundaries

preview_player
Показать описание
In this PyGame with Python 3 tutorial video, we cover how to add boundaries to our game, so we can stop the player from going off of the screen.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

I have learned more from your videos than from 2 books that I read regarding python. please keep the videos going!!!

bigal
Автор

All your vids are so well done. Keep up the good work. I feel I'm actually understanding what I'm seeing with these tutorials.

Klainn
Автор

Almost 3 years Thank you so much for these videos. I've tried to learn so many times to learn different languages, and I've found that the only way for me to learn them is by making games (the first one from a tutorial, then try to make my own from there before branching off into more difficult parts of the language). Although this series seems to be long, you're doing a good job with it and are keeping me interested in learning python. Thanks for making such clear tutorials!

trilliante
Автор

Good tutorials so far. I'm considering creating a game and have been through one tutorial series that helped me learn how python works etc. I ran into a snag this week when I was unable to make it a distributable exe to share with friends and family to get their input on what I'm looking to do. I've just started with you and glad you're working in a windows environment instead of make since I think that interfered a bit with what I could and couldn't do. Will keep going. Thanks again, great work!

harri
Автор

Love this series! You are an amazing teacher! Thank you so much!

deadlock
Автор

sentdex, another great videos series!

TheMrZachHill
Автор

Thanks for the video, you Helped me a lot in python game programming !

sanghashankar
Автор

I am having so much fun haha. Making a game starring a pig for my wife.

ianrees
Автор

Hey, huge thanks for doing these videos first of all! Secondly, I have made a background ( to look like a road) and I wanted to have boundaries that didn't mean crashed so I put:

if x < 211:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT:
x_change = 0

if x > 956:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RIGHT:
x_change = 0

My dimensions are slightly different to yours but anyway - once I run it and hold the left arrow it will stop at x = 211 but then if you keep tapping the left key it will still move to the left and vice versa to the right! Can you help? Or suggest a better way to just stop them from keeping on moving?
Thanks again!

jivegaming
Автор

i get indentation errors when i use tab to move the code block to the right. i couldn't really solve it myself, so for now i'll just continue with the sample code from sentdex' page. i did some googling, and found out, that the python style-guide doesn't recommend the use of tabs for indentation at all. anyways i don't really feel, like i know what i'm doing, when it comes to indentation. any tips to improve in that area?

oliverludwig
Автор

Please help-
How do you make an image rotate when you enter a key?
and how do you make an image point towards the mouse cursor?

jargon
Автор

for some reason my car start moving left if i hover the mouse on the screen @sentdex

kixgamer
Автор

my code isn't working. When I click run, no error messages come up but a black screen comes up. Then when I click exit, my white screen with my car on it comes up for about a second then disappears.

lucabrodribb
Автор

Bro I m using python IDLe 3.8 in that if I m running your code my output screen is going black and then i hve to minimize it and when i maximize it again i m able to see that car but my car is not moving left or right . I have copied you code exactly the same but still it is not wrking . Help me out bro

garvitgarg
Автор

Hey man. How would I go about just not letting my "car" go throught the boundery ?
Cant really find a clear answer on the inernet :/

jousireischig
Автор

When I move towards the left my car crashes early and when I move towards the right, my car goes off screen before it crashes.
My car is dimensioned differently, is that the problem?

colemilne
Автор

is there  a way to make a custom background in this game?

SwayyAllTheWayy
Автор

never mind i figured it out. i had one Exit and the other EXIT. they have to be the same

backwoodsbaker
join shbcf.ru