Creating an Environment for our Object - Intermediate Python Programming p.14

preview_player
Показать описание
Welcome to part 14 of the intermediate Python programming tutorial series. In this tutorial, we're going to be creating the PyGame environment for our object.

Рекомендации по теме
Комментарии
Автор

Thank you for putting out python content for beginners and intermediates. Really appreciate it! Can't wait to finish your beginner series before I start your intermediate series.

ambermeows
Автор

i've learned so much python programming for you....I really hope you keep doing this. I like it when you discuss specific modules and how they work. I really wish I could find someone like you who can do the same for BioPython (for those of us that need python to manipulate DNA sequences and large alignment files etc.).

Lowzenza
Автор

I can't run it on pycharm, is there a way to fix that?(it instantly closes the pygame window)

aceaspect
Автор

Hey sentdex, really happy you are taking these OOP videos in real world scenarios not just "monster X and monster Y" examples. If I may suggest something, there are some methods from pygame you are using, it would be great if you compare these methods to the ones you are creating, ex: if event.type == pygame.QUIT: what is pygame.QUIT exactly? why is QUIT uppercase, is it the same as the methods we are creating etc.

Overall I really want to congratz you on doing these awesome tutorials, and I really think you are a gem in our Python community. Hoping to see a laracast-like site for our python community from you. This way can at least support you a bit.

TuxGnome
Автор

sir pygame.QUIT is not working, it gives error that QUIT is not define... but the code is running still, i get blob on screen but, can you just give me solution that how to get ride of that error??

jankipatel
Автор

Awesome tutorial ! thank you so much man. i cant wait for the rest of the OOP parts ... keep them coming :)

abdulhananzaroo
Автор

thank you for this wonderful video. i have a question thought. in the part where you limit the blob s movements the self. x and y in the if statements are highlighted by a yellow line. so this code is it only limited to pygame or id have to import something to make it work in vscode

Sukuna_FF
Автор

when you def the Blob class you use capital B and when you draw_environment(blob) is not capital B but b, i did it your way and i also change and used Blob in draw_environment and it works either way, this confuses me, so def draw_environment(Blob) inherites from class Blob wright?

eftimiebudescu
Автор

here its showing object takes no parameters
can anyone help me

athilalthaf
Автор

what do you do if you can't get pictures on your game I have tried so hard but not working good video and way

buildforce
Автор

excellent video series...cant wait for the rest

naushinmirza
Автор

I know I ask a lot but, why didn't we use pygame.init() here ?

mkdevelops
Автор

I get this error help pls!!




Traceback (most recent call last):
File "C:/Users/santi/Desktop/Python/Test.py", line 60, in <module>
main()
File "C:/Users/santi/Desktop/Python/Test.py", line 50, in main
green_snake = Snake(GREEN)
File "C:/Users/santi/Desktop/Python/Test.py", line 21, in __init__
self.x = random.randrange(range(0, WIDTH))
File "C:\Users\santi\AppData\Local\Programs\Python\Python35\lib\random.py", line 180, in randrange
istart = _int(start)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'range'

santiagopardal
Автор

Is it normal to have variables such as WIDTH and HEIGHT inside a class that are dependent on outside assignment? What if you were writing the class to it's own file. It seems like a weird dependency when creating an instance of the class. Just wondering about best practice and if this is normal or just for the demo.

bespin
Автор

Why we didn't create Blob variables explicitly in class Blob?

eazye
Автор

Hello sir, I've been struggling with Object Oriented Programming for a while now, up until this point, I don't feel like I can go further without understanding this, so I thought I should ask some question that probably seems silly to most here:
what's the difference between class, function and method that you defined?
what's the difference between instance and object?

I did spend quite some time reading explanation on stackoverflow but none of the answer seems to explain it at a fundamental level, it's more like "A method is implicitly passed the object on which it was called." or another answer of that sort, perhaps it's a good explanation but I don't understand a single thing in that sentence, maybe you can provide a more metaphoric explanation? :/

Finally, love your videos, been a little lost in direction after learning intro to python from coursera. Thank you :)

jiahueichan
Автор

if __name__ == '__main__':
main()


if have zero idea what this line does... could you please explain?

Автор

pygame isn't installing for me....please help!

srisu
Автор

what is this for?:

if __name__ == '__main__':
main()

couldn't jus do:

main()

??

l.f.velasco
Автор

Even if you're my favorite python resource, I think you're missing the point of teaching Objects by diving too deep into the pygame example

isabellez