Skip to content

Instantly share code, notes, and snippets.

View horstjens's full-sized avatar
💭
teaching python/pygame to children

Horst JENS horstjens

💭
teaching python/pygame to children
View GitHub Profile
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:
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
import flet as ft
import random
class Game:
game_turn = 1
player = "Player One"
char = "X"
player1 = "Spieler1"
player2 = "Spieler2"
def display():
for y, line in enumerate(board):
print(f"{line[0]}|{line[1]}|{line[2]}")
if y < 2:
print("-+-+-")
import flet as ft
import random
class Game:
versuch = 1
log = []
def main(page: ft.Page):
secret = random.randint(1,1000)
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 = ""
import turtle
"""
crocodile puzzle
move and rotate tiles
"""
import random
def paint_head(size=100, big=20, medium=15, small=7):
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
import pygame
import random
class Player:
number = 1
images = []
def __init__(self, pos=None, color="#222222"):
self.number = Player.number
""" Sprite Sample Program """
import random
import arcade
# --- Constants ---
SPRITE_SCALING_PLAYER = 2.0
SPRITE_SCALING_COIN = 2.0
SPRITE_SCALING_PLATFORM = 0.5
PLATFORM_COUNT = 10