What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-01 06:25:53
player to walk on the surface
def gravity_check(self): hits = pygame.sprite.spritecollide(player ,ground_group, False) if self.vel.y > 0: if hits: &nb... Add solution -
Python 2022-02-01 02:21:45
how to make a pygame window
import pygame pygame.init() back = (192,192,192) gameDisplay = pygame.display.set_mode((800,600)) pygame.display.set_caption('A bit Racey') gameDisplay.fill(back) clock = pygame.time.Clock() running = True while running: for event in pygame.event.get(... Add solution -
Other 2022-01-31 21:45:43
pygame rect
# make the x position, y position, width and the height of the rectangle x_pos = 20 y_pos = 20 width = 50 height = 50 # make the rectangle variable rectangle = pygame.Rect(x_pos, y_pos, width, height) # now add this to a surface, add a colour and the re... Add solution -
Python 2022-01-31 10:06:35
how to make window pygame
import pygame pygame.init() back = (192,192,192) gameDisplay = pygame.display.set_mode((800,600)) pygame.display.set_caption('A bit Racey') gameDisplay.fill(back) clock = pygame.time.Clock() running = True while running: for event in pygame.event.get(... Add solution -
Other 2022-01-31 05:37:03
how to make a game in pygame for beginners
import pygame pygame.init() screen = pygame.display.set_mode((400, 300)) done = False is_blue = True x = 30 y = 30 while not done: &nbs... Add solution -
-
Python 2022-01-29 12:30:57
display text in pygame
import pygame pygame.init() window = pygame.display.set_mode((500, 500)) def set_text(string, coordx, coordy, fontSize): #Function to set text font = pygame.font.Font('freesansbold.ttf', fontSize) #(0, 0, 0) is black, to make black text te... Add solution -
Python 2022-01-25 11:25:22
timer pythongame
import pygame pygame.init() screen = pygame.display.set_mode((128, 128)) clock = pygame.time.Clock() counter, text = 10, '10'.rjust(3) pygame.time.set_timer(pygame.USEREVENT, 1000) font = pygame.font.SysFont('Consolas', 30) while True: for e in pyga... Add solution