Game Development in Python 3 With PyGame - 6 - Drawing Objects / moving objects

preview_player
Показать описание
In this Python game development tutorial, we cover how to draw objects on the screen, as well as move them to give the appearance that our car is driving.

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

pretty neat little series....i have binged this one....better than GOT tbh...

abhinavgv
Автор

You should add smaller squares but multiple ones at the same time, so you would’ve added thing_ num which represents how many squares

Nick-lxfo
Автор

Is there any way to have the blocks randomly generate (As they are in the video) but keep them from overlapping? I have two vehicles (What I am using instead of blocks) moving down the screen but every so often they will overlap since I have one moving at a faster speed, the only solution I have found results in the loop breaking.

SnowyGlory
Автор

can i changethe speed of the block during each loop

aking
Автор

I haven't been able to try it out myself yet, but could all these methods you are writing be used within imported classes?
Like I have a class defined in a python script named Obstacles.py... can I use pygame functions and so on inside Obstacles.py since they are called within my main script?

erggish
Автор

This is an interesting series. Well done presentation. I like it. The audio is very low, and mid-roll ads are not serving you well. The ads kick in every few minutes and are significantly louder than the content. The constant RUDE interruptions are making it hard, it's a shame to harm what would otherwise be awesome content. Thanks, I hate being critical, I understand you want to get something for your effort. I will try to stick with it.

jerril
Автор

How could you put the block as an image

clearydavid
Автор

HI, so im getting this error

gameDisplay.blit(myImg, (x, y))
AttributeError: 'NoneType' object has no attribute 'blit'

this is how i defined my display surface

gameDisplay = pygame.display.set_mode((800, 600))
gameDisplay =

please help me this looks perfectly fine and it should work but i dont know why its giving me this error

ssaammii
Автор

For some reason only one block gets generated and nothing else happens. Any help?

TheSuperboss
Автор

When i try to run, it says invalid syntax and highlights the def in def car(x, y). HELP!

barrelofmonkeys
Автор

Late to the party; however, for some reason even though I have the exact same game logic as you I will randomly get hit and the block can occasionally pass over me, also it's waiting for a key event before generating any more blocks.

Edit: I did a bad; I put my logic inside the event handler :p.

Logic is still giving me an issue for some reason though.

christophernaron
Автор

can you add your own picture and make it move?

feuggstrix
Автор

There ıs no change when thing_starty is changed. it was -600 and ı made it 500 but game still works in a similar way. why did he make thing_starty equal to -600 ?

mustafakarakas
Автор

i keep getting this "TypeError: tuple indices must be integers or slices, not tuple" when i place this [ ] into the idle. how to fix this idk. plz help

hasnainjaffer
Автор

i copied what you did but when i run it it says there is nothing like import pygame

mrbagri
Автор

sentdex  hey, is there any way of me changing the blocks to another img file

i want 2 planes to crash into each other

meljoshuamoo
Автор

Please help me! The pygame.draw.rect doesn't work it says in the module that rect argument is invalid! Wtf

SuperWillisFilms
Автор

Can you show me what to do to replace the rectangles with pictures for the obstacle please because i am new to coding and want make a game Thanks

amaan
Автор

How can I put my own image in for the obstacles? Rather than they just being black rectangles?

mxdern
visit shbcf.ru