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
@horstjens
horstjens / client1.py
Last active March 21, 2025 14:30
chat
import socket
def start_client():
# Create a socket object
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('localhost', 12345))
print("Connected to server.")
while True:
# Send a message to the server
@horstjens
horstjens / character_chooser1.py
Created March 3, 2025 17:31
freesimplegui character chooser
import FreeSimpleGUI as sg
#sg.popup_ok("hallo")
database = {
"player": {
"name":"player",
"filename":"player1.png",
"attack":15,
"defense":21,
@horstjens
horstjens / cannon_lukas.py
Last active February 28, 2025 15:56
freesimplegui cannon game
import FreeSimpleGUI as sg
import math
import random
col_player_1_r=sg.Column(layout=[
[sg.Multiline(default_text="history:\n",
autoscroll=True,
key="history",
disabled=True,
size=(50,10))]
@horstjens
horstjens / freesimplegui_cannon.py
Last active February 21, 2025 15:22
kanone mit freesimplegui
import FreeSimpleGUI as sg
import math
import random
col_rechts=sg.Column(layout=[
[sg.Multiline(default_text="history:\n",
autoscroll=True,
key="history",
disabled=True,
size=(50,10))]
@horstjens
horstjens / conway001.py
Created January 18, 2025 10:40
conway game of life
# conways game of life
# see https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
startfield="""
...X............
.......XXX.....X
...............X
...............X
................
@horstjens
horstjens / schulnoten.py
Created January 16, 2025 15:55
turtle line diagram
import turtle
# diagramme mit turtle grafik
# französisch-Noten
noten = [2,2,1,5,5,4,2,3,1,1]
# Liniengrafik
WIDTH = 1200
HEIGHT = 800
import pygame
import random
import math
class Game:
W, H = 1500, 751
FPS = 60
scrollspeed = -2
@horstjens
horstjens / shooter4.py
Created November 11, 2024 17:23
pygame shooter
import pygame
import random
import math
class Game:
W, H = 1500, 751
FPS = 60
scrollspeed = -2
@horstjens
horstjens / pygame_shooter3.py
Last active November 4, 2024 17:56
pygame shooter
import pygame
import random
class Game:
W, H = 1500, 751
FPS = 60
scrollspeed = -2
stargroup = pygame.sprite.Group()
@horstjens
horstjens / cookie_clicker002.py
Created October 15, 2024 14:46
cookie_clicker