#!/usr/bin/env python import pge, sys from pygame.locals import * print "starting exampleBoxes" # pge.batch () pge.interactive () t = pge.rgb (1.0/2.0, 2.0/3.0, 3.0/4.0) wood_light = pge.rgb (166.0/256.0, 124.0/256.0, 54.0/256.0) wood_dark = pge.rgb (76.0/256.0, 47.0/256.0, 0.0) red = pge.rgb (1.0, 0.0, 0.0) green = pge.rgb (0.0, 1.0, 0.0) blue = pge.rgb (0.0, 0.0, 1.0) blue_dark = pge.rgb (0.1, 0.1, 0.8) steel = pge.rgb (0.5, 0.5, 0.5) copper = pge.rgb (0.5, 0.3, 0.2) gold = pge.rgb (0.8, 0.6, 0.15) ball_size = 0.02 boarder = 0.01 white = pge.rgb (1.0, 1.0, 1.0) gap = 0.01 captured = None sides = [] yellow = pge.rgb (0.8, 0.6, 0.15) fps_text = None last_fps = 0
#!/usr/bin/env python import pge, sys, time from pygame.locals import * print "starting breakout" # pge.batch () pge.interactive() pge.record() t = pge.rgb(1.0 / 2.0, 2.0 / 3.0, 3.0 / 4.0) wood_light = pge.rgb(166.0 / 256.0, 124.0 / 256.0, 54.0 / 256.0) wood_dark = pge.rgb(76.0 / 256.0, 47.0 / 256.0, 0.0) red = pge.rgb(1.0, 0.0, 0.0) green = pge.rgb(0.0, 1.0, 0.0) blue = pge.rgb(0.0, 0.0, 1.0) dark_red = pge.rgb(166.0 / 255.0, 25.0 / 255.0, 50.0 / 255.0) dark_green = pge.rgb(25.0 / 255.0, 100.0 / 255.0, 50.0 / 255.0) dark_blue = pge.rgb(25.0 / 255.0, 50.0 / 255.0, 150.0 / 255.0) steel = pge.rgb(0.5, 0.5, 0.5) copper = pge.rgb(0.5, 0.3, 0.2) gold = pge.rgb(0.8, 0.6, 0.15) ball_size = 0.02 boarder = 0.01 white = pge.rgb(1.0, 1.0, 1.0) gap = 0.01 blocks = [] winner = False loser = False
#!/usr/bin/env python3 import pge, sys, time from pygame.locals import * print("starting snooker") # pge.batch () pge.interactive () pge.record () t = pge.rgb (1.0/2.0, 2.0/3.0, 3.0/4.0) wood_light = pge.rgb (166.0/256.0, 124.0/256.0, 54.0/256.0) wood_dark = pge.rgb (76.0/256.0, 47.0/256.0, 0.0) red = pge.rgb (1.0, 0.0, 0.0) green = pge.rgb (0.0, 1.0, 0.0) blue = pge.rgb (0.0, 0.0, 1.0) ball_size = 0.02 boarder = 0.01 white = pge.rgb (1.0, 1.0, 1.0) gap = 0.01 captured = [] sides = [] slowdown = 5 simulatedtime = 6 def myquit (e): print("goodbye") sys.exit (0)
#!/usr/bin/env python import pge, sys print "starting boxes" pge.batch() wood_light = pge.rgb(166.0 / 256.0, 124.0 / 256.0, 54.0 / 256.0) wood_dark = pge.rgb(76.0 / 256.0, 47.0 / 256.0, 0.0) red = pge.rgb(1.0, 0.0, 0.0) blue = pge.rgb(0.0, 0.0, 1.0) boarder = 0.01 def placeBoarders(thickness, color): print "placeBoarders" pge.box(0.0, 0.0, 1.0, thickness, color).fix() pge.box(0.0, 0.0, thickness, 1.0, color).fix() pge.box(1.0 - thickness, 0.0, thickness, 1.0, color).fix() pge.box(0.0, 1.0 - thickness, 1.0, thickness, color).fix() def placeBox(p, w, c): return pge.box(p[0], p[1], w, w, c) def main(): pge.record() placeBox([0.4, 0.4], 0.1, red).fix() placeBoarders(boarder, wood_dark)
#!/usr/bin/env python import pge, sys # import pgemacro print "starting exampleBoxes" pge.batch () t = pge.rgb (1.0/2.0, 2.0/3.0, 3.0/4.0) wood_light = pge.rgb (166.0/256.0, 124.0/256.0, 54.0/256.0) wood_dark = pge.rgb (76.0/256.0, 47.0/256.0, 0.0) red = pge.rgb (1.0, 0.0, 0.0) metal = pge.rgb (0.5, 0.5, 0.5) ball_size = 0.04 boarder = 0.01 white = pge.rgb (1.0, 1.0, 1.0) gap = 0.01 # pge.finish () # sys.exit (0) def play_wood (o): print "play_wood - wants to play bounce.wav" pge.play ("/home/gaius/Sandpit/cluedo/sounds/bounce.wav") def play_crack (o): print "play_crack - wants to play crack-single.wav" pge.play ("/home/gaius/Sandpit/penguin-tower/sounds/crack-single.wav") def play_bounce (o):
#!/usr/bin/env python import pge, sys print "starting boxes" pge.batch () wood_light = pge.rgb (166.0/256.0, 124.0/256.0, 54.0/256.0) wood_dark = pge.rgb (76.0/256.0, 47.0/256.0, 0.0) red = pge.rgb (1.0, 0.0, 0.0) blue = pge.rgb (0.0, 0.0, 1.0) boarder = 0.01 def placeBoarders (thickness, color): print "placeBoarders" pge.box (0.0, 0.0, 1.0, thickness, color).fix () pge.box (0.0, 0.0, thickness, 1.0, color).fix () pge.box (1.0-thickness, 0.0, thickness, 1.0, color).fix () pge.box (0.0, 1.0-thickness, 1.0, thickness, color).fix () def placeBox (p, w, c): return pge.box (p[0], p[1], w, w, c) def main (): placeBox ([0.4, 0.4], 0.1, red).fix () placeBoarders (boarder, wood_dark) placeBox ([0.47, 0.7], 0.1, blue) pge.gravity () pge.run (3.0)