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 | |
class Game: | |
beams = [] | |
scene=vp.canvas(title="Space fight") | |
# xyz | |
#vp.arrow(axis=vp.vector(1,0,0), color=vp.color.red) |
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 | |
# xyz | |
#vp.arrow(axis=vp.vector(1,0,0), color=vp.color.red) | |
vp.text(pos=vp.vector(1.5,0,0), text="x", | |
color=vp.color.red, height=0.1) | |
#vp.arrow(axis=vp.vector(0,1,0), color=vp.color.green) | |
vp.text(pos=vp.vector(0,1.5,0), text="y", | |
color=vp.color.green, height=0.1) | |
#vp.arrow(axis=vp.vector(0,0,1), color=vp.color.blue) |
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 random | |
import PySimpleGUI as sg | |
spieler = 1 | |
summe = 0 | |
rows = 6 # max. 26 | |
cols = 7 # max. 26 | |
gewinnt = 4 |
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 random | |
spieler = 1 | |
summe = 0 | |
rows = 6 # max. 25 | |
cols = 17 # max. 25 | |
gewinnt = 5 | |
spielzug = 0 | |
#feld = [ | |
# [0,0,0,0,0,0,0], | |
# [0,0,0,0,0,0,0], |
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
# gist.github.com/horstjens | |
import vpython as vp | |
import random | |
class Game: | |
scene = vp.canvas(width=1200, height=650, title="wall surfer") | |
dt = 0.1 | |
xlimit = 20 |
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 | |
import random | |
w,h = 1200,750 | |
turtle.setup(w,h) | |
colors = ["blue","red","green","yellow"] | |
goals = [] | |
stable = [] | |
y = h//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
# gist.github.com/horstjens | |
import vpython as vp | |
import random | |
class Game: | |
dt = 0.1 | |
xlimit = 20 | |
ylimit = 10 |
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
# Credit for this: Nicholas Swift | |
# as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2 | |
from warnings import warn | |
import heapq | |
class Node: | |
""" | |
A node class for A* Pathfinding | |
""" |
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 random | |
import vpython as vp | |
class Game: | |
size = 20 | |
class Ball(vp.sphere): | |
def __init__(self): | |
p = vp.vector(random.uniform(0, Game.size), | |
random.uniform(0, Game.size), |
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 | |
class Game: | |
player1 = None | |
player2 = None | |
fps = 30 # frames per second | |
dt = 1/fps # delta time in seconds | |
board_size = 10 | |
player_speed = 2 |