This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import random | |
import math | |
class Game: | |
W, H = 1500, 751 | |
FPS = 60 | |
scrollspeed = -2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import random | |
import math | |
class Game: | |
W, H = 1500, 751 | |
FPS = 60 | |
scrollspeed = -2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import random | |
class Game: | |
W, H = 1500, 751 | |
FPS = 60 | |
scrollspeed = -2 | |
stargroup = pygame.sprite.Group() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import random | |
import os.path | |
W, H = 1280, 720 | |
class TextSprite(pygame.sprite.DirtySprite): | |
def __init__(self, pos, color, textsize, text, age_max, anchor="center" ): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vpython as vp | |
import random | |
#import math | |
# description: a world with vertical cylinders (axis = vp.vec(0,0,1), base of all cylinders is at world position z=0 | |
# the base of the cylinder has a location label (white text) | |
# the top of each cylinder has a value label (green text) | |
# problem: finding out pixel_pos of location labels (at the base of a cylinder) and the value labels( at the top of a cylinder) | |
# the pixel pos is not the world coordinates, but the coordinate in pixels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle | |
# turtle bounces from screen edge | |
#w, h = 600,400 | |
#turtle.setup(w*2, h*2) | |
screen = turtle.Screen() | |
screen.setup(1.0, 0.9) | |
w, h = screen.window_width()/2, screen.window_height()/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import random | |
import os.path | |
# done: ufo more pretty, triangular windows | |
# done: ufo change colors | |
# TODO: impact on asteroid changes speed of asteroid | |
# TODO: asteroid shall change color to indicate loosing hitpoints | |
W, H = 1280, 720 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tic tac toe spiel für 2 spieler, eingabekontrolle | |
# sieg ermittlung | |
# Horst JENS, 2024 08 | |
def gewonnen(): | |
feld = spielfeld.replace("-+-+-\n","") | |
feld = feld.replace("|","") | |
feld = feld.replace("\n","") | |
print(feld) | |
# 012 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FreeSimpleGUI as sg | |
import random | |
import matplotlib | |
matplotlib.use('TkAgg') | |
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg | |
#import numpy as np | |
import matplotlib.pyplot as plt | |
# format mini language https://docs.python.org/3/library/string.html#formatspec | |
class Pokemon: |
NewerOlder