Skip to content

Instantly share code, notes, and snippets.

View Daverare24's full-sized avatar

David Ogah Daverare24

  • Dave Programming
  • Nigeria
View GitHub Profile
@Daverare24
Daverare24 / gist:85c4fae466d817ca1357225f309b0fb8
Created October 25, 2025 11:40
Color Sprite Pygame programm
import pygame
import random
# Initialize pygame
pygame.init()
# Screen settings
WIDTH, HEIGHT = 600, 400
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Sprite Color Change Event")
import pygame
pygame.init()
# Constants
MOVEMENT_SPEED = 3
SURFACE_COLOR = (255, 0, 0) # red
COLOR1 = (0, 0, 0) # black
COLOR2 = (0, 255, 255) # cyan