Game Development in Python 3 With PyGame - 9 - Drawing

preview_player
Показать описание


In this PyGame tutorial, we cover how you can draw various shapes, built into PyGame.

Examples shown here are drawing individual pixels, lines, circles, rectangles, and just about any polygon you can think of.

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

I've just watched 9 videos of this series in less than 24 hours. Thank you so much for making game development easy.
Respect from India...

ishanpandy
Автор

Oh no, he uses light editor!!!!
**sad dracula noises**

prajjwal
Автор

So many videos in such s short time!!!! Thankyou !!

dziiredusk
Автор

Really thank you, I was looking for such tutorial.

olaffifty-four
Автор

Hey man! thx for the videos, one question, how i can rotate a rectangle?

Автор

look at this interesting shape i've drawn using for loops and pixelarrays:
for i in range(100, 150):
pixAr[i][100]=blue

for i in range(100, 200):
pixAr[100][i]=blue

for i in range(50, 100):
pixAr[i][200]=blue

for i in range (50, 150):
pixAr[i][150]=blue

for i in range (100, 150):
pixAr[50][i]=blue

for i in range (150, 200):
pixAr[150][i]=blue

qwertzuiop
Автор

can you maybe show us how you can maybe spawn random coins in between the blocks .. but instead of avoided the coins we have to grab them fot extra points?
also i wish i could keep the highscore in the game is there a way to do that ?
thanks anyway . you are awesome

supernerdglenn
Автор

My code gets an error in this line:

if event.type == pygame.QUIT():
TypeError: 'int' object is not callable

I don't see what is the problem. What am I doing wrong?

inesborges
Автор

Here is a question about challenge of last video.
To move thing, I have to use the code
thing_starty += thing_speed
But when I try to do the challenge,
I use a for loop to create multiple block at the same time
For I in range (num_of_thing):
Things(all parameter)
Things_starty += things_speed
Num_of_thing is a variable and the initial value is 1.
The problem is when num_of_thing is 2,
Things_starty run two times and speed of thing increase.
Should I create a class of instance things?
Or how could I solve this?

tcchan
Автор

Hey sentdex, could you do some videos on sprites please? Pygame is really challenging me to learn more and grow as a novice coder. I am using Class and Group for the first time in a program. I've been running into a lot of "object has no attribute" errors trying to add Class and Group to the code used in vids 1-8. It would be cool if you could cover sprites, collisions, and sprite list updates. I appreciate your hard work. Thanks!

TheMrZachHill
Автор

Hello! First of all, I'd like to thank you for doing such a great work teaching us about PyGame, you explain everything the easiest way so, thanks, but my problem is with the last video's challenge :P, I can't get 2 simultaneus blocks to appear, can someone help me? I've tried defining a function outside the loop that says: for thing in range(dodged): things(blah blah blah), and switching the positions of the variable and the function (in and out of the Game_Loop()).

GusTheWolfgang
Автор

Hi... I have a question. Could I draw a math function with pygame.draw? and How?

alvarosuarez
Автор

Is it possible to pygame.gameDisplay.fill a image instead of a colour? if not what else could be done?

mr.jalapeno
Автор

+sentdex I want to change 'things' into a circle not a block, how can I do that? Already Thanks!

pjendebros
Автор

my code is saying something is wrong with the while loop for some reason please help

nikolasa
Автор

Hey, I hope I'am not to late to the party but I have a question.

If I want to make a square that is angeled so that it is not parallell to the x and y axis. How do I do that?

theodorstaffas
Автор

Hi, thanks for sharing the videos.
I have updated my OS recently and my pygame stopped working and its giving out the below error. Please help me fix this and I am using pycharm for my dev environment.

ImportError: dlopen(/Library/Python/2.7/site-packages/pygame/base.so, 2): Library not loaded:
Referenced from:
Reason: unsafe use of @executable_path in with restricted binary

vijay
Автор

I wish you would explain how to install and run pygame, i use sublime text

Chaudharys
Автор

In one of your videos you mentioned that it's weird that RGB settings for black color is 0, 0, 0.

A thought just came to my mind - look above yourself... way above. What is there? The Universe, the space. There's obviously nothing in the space and it's... not white. ; )

It seems that nothing...ness is black, and 0, 0, 0 for black now looks all right.

damianwojakowski
Автор

final got here after watching these videos :)

shengtatsai
visit shbcf.ru