Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
teaching python/pygame to children

Horst JENS horstjens

💭
teaching python/pygame to children
View GitHub Profile
View breakout.py
import PySimpleGUI as sg
import random
import time
RESOLUTIONS = ["640x400","800x600","1024x800", "1024x960","1200x1024"]
WIDTH, HEIGHT = 800,600
MIN_TILES = 10
MAX_TILES = 200
HELPTEXT = """catch the ball
User cursor keys to move left - right"""
View catch_me.py
import PySimpleGUI as sg
import random
import time
RESOLUTIONS = ["100x100", "200x200", "320x200", "400x400", "600x600", "640x400","800x600","1024x800", "1024x960","1280x1024"]
WIDTH, HEIGHT = 400,400
MIN_TILES = 10
MAX_TILES = 50
TX = 40
TY = 40
View daedalus.py
import PySimpleGUI as sg
import random
import time
RESOLUTIONS = ["640x400","800x600","1024x800", "1024x960","1200x1024"]
WIDTH, HEIGHT = 800,600
MIN_TILES = 10
MAX_TILES = 200
HELPTEXT = """Escape from the labyrinth. Reach the yellow goal.
You are the green rect.
@horstjens
horstjens / game_of_life.py
Last active Jun 27, 2022
Conway's Game of Life with Python and PySimpleGUI
View game_of_life.py
import PySimpleGUI as sg
import random
import time
#from matplotlib.colors import hex2color
RESOLUTIONS = ["100x100", "200x200", "320x200", "400x400", "600x600", "640x400","800x600","1024x800", "1024x960","1280x1024"]
WIDTH, HEIGHT = 400,400
MIN_TILES = 10
MAX_TILES = 50
TX = 40
@horstjens
horstjens / paint.py
Last active Jun 21, 2022
pysimplegui paint
View paint.py
import PySimpleGUI as sg
import random
import time
#from matplotlib.colors import hex2color
RESOLUTIONS = ["100x100", "200x200", "320x200", "400x400", "600x600", "640x400","800x600","1024x800", "1024x960","1280x1024"]
WIDTH, HEIGHT = 400,400
MIN_TILES = 10
MAX_TILES = 50
TX = 40
View draft3.py
import PySimpleGUI as sg
import random
import time
RESOLUTIONS = ["100x100", "200x200", "320x200", "400x400", "600x600", "640x400","800x600","1024x800", "1024x960","1280x1024"]
WIDTH, HEIGHT = 400,400
MIN_TILES = 10
MAX_TILES = 50
TX = 40
TY = 40
@horstjens
horstjens / lab1.py
Last active Jun 13, 2022
labyrinth1
View lab1.py
import PySimpleGUI as sg
import random
import time
WIDTH, HEIGHT = 800,600
HELPTEXT = """Escape from the labyrinth. Reach the yellow goal.
You are the green rect.
user cursor keys to navigate. """
View tower_of_hanoi.py
import PySimpleGUI as sg
import random
import time
WIDTH, HEIGHT = 600,200
HELPTEXT = """GOAL: move all discs from stack 1 (left) to stack 3 (right)
RULES:
1.) Move only one disk at a time.
2.) You can only remove a disk from the top of a stack and place it on the top of another.
View popup_catcher.py
import PySimpleGUI as sg
import random
import time
duration = 60
colors = ["black","white","grey","yellow","blue","red","green","orange","pink","cyan","purple"]
words = ["clack","clock","clonk","ding","dong","dang","clickety-click","cookie","cuckoo"]
start_time = time.time()
end_time = start_time + duration
@horstjens
horstjens / chest4.py
Last active Jun 20, 2022
doors_chest1
View chest4.py
"""minigames for temple of doors:
opening a chest, guessing a number with hint system
using PySimpleGUI as GUI
"""
import PySimpleGUI as sg
import random
# graph window
WIDTH = 600