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-03 09:22:09
how to make a text input box python pygame
import pygame as pg pg.init() screen = pg.display.set_mode((640, 480)) COLOR_INACTIVE = pg.Color('lightskyblue3') COLOR_ACTIVE = pg.Color('dodgerblue2') FONT = pg.font.Font(None, 32) class InputBox: def __init__(self, x, y, w, h, text=''): ... Add solution -
Python 2022-02-02 23:31:25
make a pong game in python
#The best python pong game without pygame! import turtle a_wins = False b_wins = False # Set up the screen turtle.Screen() wn = turtle.Screen() wn.title("Ping Pong game by Timothy") wn.bgcolor("black") wn.setup(width=800, height=600... Add solution