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
@horstjens
horstjens / turtlerace2.py
Created March 21, 2023 17:24
turtle race
View turtlerace2.py
import turtle
import random
screen = turtle.getscreen()
screen.setup(width=1.0, height=0.9, startx=0, starty=0)
width = 1000
height = 500
screen.setworldcoordinates(0,0,width, height)
@horstjens
horstjens / cannon_turtle3.py
Last active March 14, 2023 16:15
cannon game using turtle graphic
View cannon_turtle3.py
import turtle
import math
import random
screen = turtle.getscreen()
screen.setup(width=1.0, height=0.9, startx=0, starty=0)
#width, height = screen.window_width(), screen.window_height()
width = random.randint(20000,50000)
height = width
screen.setworldcoordinates(0,0,width, height)
View orzlib1.py
class Game:
"""containers for everything"""
monsters = {}
#items = {}
locations = {}
player = None
current_room = None
class Location:
View minesweeper1.py
import PySimpleGUI as sg
import random
#sg.theme("Material1")
#sg.theme_element_background_color(color = "#000000")
#sg.theme_background_color(color="#FFFFFF")
#sg.theme_button_color(color="#FFFFFF")
class Game:
View jojofuadventure1.py
import adventurelib as adv
class Game:
current_room = None
player_inventory = adv.Bag()
bedroom = adv.Room("""
This is a bedroom. It's big and comfortable
""")
@horstjens
horstjens / tictactoe_flet.py
Last active February 20, 2023 15:32
tictactoe_flet
View tictactoe_flet.py
import flet as ft
import random
class Game:
game_turn = 1
player = "Player One"
char = "X"
View tictactoe.py
player1 = "Spieler1"
player2 = "Spieler2"
def display():
for y, line in enumerate(board):
print(f"{line[0]}|{line[1]}|{line[2]}")
if y < 2:
print("-+-+-")
View flet_zahlenraten2.py
import flet as ft
import random
class Game:
versuch = 1
log = []
def main(page: ft.Page):
secret = random.randint(1,1000)
View flet_zahlenraten.py
import flet as ft
import random
def main(page):
secret = random.randint(1,1000)
versuch = 1
def add_clicked(e):
#page.add(ft.Checkbox(label=new_task.value))
zahl = int(eingabe.value)
eingabe.value = ""
View puzzle_with_turtle.py
import turtle
"""
crocodile puzzle
move and rotate tiles
"""
import random
def paint_head(size=100, big=20, medium=15, small=7):