Add cast with one tower and two walls

This commit is contained in:
Florian Festi 2013-07-20 13:10:51 +02:00
parent 234698aa88
commit 831b071c1b
1 changed files with 35 additions and 0 deletions

35
castle.py Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/python
from boxes import *
class Castle(Boxes):
def __init__(self):
Boxes.__init__(self, 800, 600)
s = FingerJointSettings(self.thickness, relative=False,
space = 10, finger=10, height=10,
width=self.thickness)
p = FingerJointEdge(self, s)
p.char = "p"
self.addPart(p)
P = FingerJointEdgeCounterPart(self, s)
P.char = "P"
self.addPart(P)
def render(self, t_x=70, t_h=250, w1_x=300, w1_h=120, w2_x=100, w2_h=120):
self.moveTo(0,0)
self.rectangularWall(t_x, t_h, edges="efPf", move="right", callbacks=
[lambda: self.fingerHolesAt(t_x*0.5, 0, w1_h, 90),])
self.rectangularWall(t_x, t_h, edges="efPf", move="right")
self.rectangularWall(t_x, t_h, edges="eFPF", move="right", callbacks=
[lambda: self.fingerHolesAt(t_x*0.5, 0, w2_h, 90),])
self.rectangularWall(t_x, t_h, edges="eFPF", move="right")
self.rectangularWall(w1_x, w1_h, "efpe", move="right")
self.rectangularWall(w2_x, w2_h, "efpe", move="right")
self.ctx.stroke()
self.surface.finish()
c = Castle()
c.render()