#!/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(): pge.record() placeBox([0.4, 0.4], 0.1, red).fix() placeBoarders(boarder, wood_dark)
#!/usr/bin/env python import pge, sys print("starting triangle") pge.batch() # this works # pge.interactive () # and this fails (the code is incomplete) 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 def placeBoarders(thickness, color): print("placeBoarders") e1 = pge.box(0.0, 0.0, 1.0, thickness, color).fix() e2 = pge.box(0.0, 0.0, thickness, 1.0, color).fix() e3 = pge.box(1.0 - thickness, 0.0, thickness, 1.0, color).fix() e4 = pge.box(0.0, 1.0 - thickness, 1.0, thickness, color).fix() return e1, e2, e3, e4 def placeBall(x, y, r): return pge.circle(x, y, r, metal)