PYTHON PYGAME NOTES -----> FOR YOU Click for newer version of pygame notes (better) BASIC PYGAME STARTING :- import pygame pygame. init() screen = pygame.display. set_mode ( ( WIDTH , HEIGHT ) ) BASIC REQUIRED CODE :- There must be following code to get a screen running = True while running : for event in pygame.event. get (): if event.type == QUIT : running = False pygame.display. update () DRAWING WITH PYGAME SHOW MORE pygame.draw. rect ( surface ,( r,g,b ),( x-coordinate , y-coordinate , width , height )) # Doing the same thing with pygame.Rect rect = pygame. rect ( x-coordinate , y-coordinate , width , height ) pygame.draw. rect ( surface ,( r,g,b ), rect ) # RESIZING A RECTANGLE rect. inflate ( width , height ) # if you give -ve width or height the recta...
IT IS EASY TO FORGET BUT HARD TO REMEMBER EVERYTHING . BUT THE THING IS WHY YOU NEED TO REMEMBER WHEN WE ARE WITH YOU.
Comments
Post a Comment