What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-16 04:45:09
how to make a player move in pygame
so let's move the palyer horizontally left right # IF YOU HAVE MADE THE SCRIPT FOR MAKING SCREEN THE JUST COPY # THE SYNTAX OF THE MOVE SCRIPT # BUT MAKE SURE YOU SEE THE DEF PLAYER import pygame # initialize pygame pygame.init() screen = pygame.dis... Add solution -
Python 2022-02-12 00:20:20
pygame boilerplate
#!/usr/bin/env python2 import pygame import random WIDTH = 360 HEIGHT = 480 FPS = 30 # Define Colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) ## initialize pygame and create window pygame.ini... Add solution -
Python 2022-02-11 08:05:09
how to make a screen with pygame
import pygame # The background color can be whatever you want background_colour = (255,255,255) (width, height) = (300, 200) screen = pygame.display.set_mode((width, height)) pygame.display.set_caption('Tutorial 1') screen.fill(background_colour) pygame.... 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 -
Python 2021-11-21 18:20:13
how to make a backround color in pygame
#getting pygame and another library we need for setup import pygame, sys #setup(for starting the pygame i'm pretty sure) pygame.init() #making the screen width = 1280 height = 960 screen=pygame.display.set_mode((width,height)) #this is the color I want... Add solution