What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-11 23:08:04
pygame python
# Be sure to install pygame via pip import pygame import sys # initialize it pygame.init() # configurations frames_per_second = 30 window_height = 600 window_width = 400 # colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) BLUE = (0, 0, 255) # creating... Add solution -
Python 2021-10-11 09:11:03
"pygame" surface creation
import pygame from pygame.locals import * import sys pygame.init() displaysurface = pygame.display.set_mode((300, 300)) mySurface = pygame.Surface((50, 50)) mySurface.fill((0,255,0)) mySurface2 = pygame.Surface((100, 50)) mySurface2.fill((0,255,0)... Add solution -
Python 2021-10-04 02:33:03
jump logic in pygame
import pygame pygame.init() win = pygame.display.set_mode((500, 500)) pygame.display.set_caption("My First Game") clock = pygame.time.Clock() x = 0 y = 300 width = 40 height = 60 vel = 5 j_vel = 10 ## The Velocity of the jump run = True isJump =... Add solution -
Other 2021-10-01 12:53:07
pygame tutorial
# To install pygame, type 'pip install pygame' in the # windows powershell or the os terminal # To create a blank screen as a setup for a game, use: import pygame import sys pygame.init() clock = pygame.time.Clock() FPS = 30 # How many times the scre... Add solution -
Other 2021-10-01 10:24:05
pygame simple game
1 # Simple pygame program 2 3 # Import and initialize the pygame library 4 import pygame 5 pygame.init() 6 7 # Set up the drawing window 8 screen = pygame.display.set_mode([500, 500]) 9 10 # Run until the user asks to quit 11 running = True 12... Add solution -
Python 2021-10-01 04:27:02
python pygame tutorial coderslegacy
#Setting up FPS FPS = 60 FramePerSec = pygame.time.Clock() #Creating colors BLUE = (0, 0, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLACK = (0, 0, 0) WHITE = (255, 255, 255) #Other Variables for use in the program SCREEN_... Add solution -
Python 2021-09-21 17:49:03
how to make text change lines pygame
import pygame pygame.init() SIZE = WIDTH, HEIGHT = (1024, 720) FPS = 30 screen = pygame.display.set_mode(SIZE, pygame.RESIZABLE) clock = pygame.time.Clock() def blit_text(surface, text, pos, font, color=pygame.Color('black')): words = [word.split(... Add solution