Skip to content

Instantly share code, notes, and snippets.

@M1ke
Created September 20, 2025 14:55
Show Gist options
  • Select an option

  • Save M1ke/87715178da727935b776c357bc902fbd to your computer and use it in GitHub Desktop.

Select an option

Save M1ke/87715178da727935b776c357bc902fbd to your computer and use it in GitHub Desktop.
Run with "pgzero splatcat.py"
import random as r
# Rum with "pgzero splatcat.py"
WIDTH = 800
HEIGHT = 600
cats = ["cat1", "cat2", "cat3", "cat4", "kitten"]
meows = [sounds.meow1, sounds.meow2, sounds.meow3, sounds.meow4]
currentcats = []
splatcats = []
def draw():
screen.fill((255, 255, 255))
for splatcat in splatcats:
splatcat.draw()
for cat in currentcats:
cat.draw()
def update():
if(r.randint(1, 300)==1):
cat_sprite = cats[4]
meow_sound = r.choice(meows)
x = r.randint(100, 700)
y = r.randint(100, 200)
new_cat = Actor(cat_sprite, pos =(x, y))
currentcats.append(new_cat)
meow_sound.play()
cat_sprite2 = cats[4]
meow2s = r.choice(meows)
x2 = r.randint(100, 700)
y2 = r.randint(100, 200)
nc2 = Actor(cat_sprite2, pos =(x2, y2))
currentcats.append(nc2)
meow2s.play()
catspr3 = cats[4]
meow3s = r.choice(meows)
x3 = r.randint(100, 700)
y3 = r.randint(100, 200)
nc3 = Actor(catspr3, pos =(x3, y3))
currentcats.append(nc3)
meow3s.play()
for cat in currentcats:
cat.y += 3
cat.angle+=5
def on_mouse_down(pos):
newsplatcats = []
for cat in currentcats:
if cat.collidepoint(pos):
cat.image = r.choice(cats)
splatcats.append(cat)
sounds.splat.play()
for splatcat in newsplatcats:
currentcats.remove(splatcat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment