Code: Alles auswählen
class Gegner:
def __init__(self,x,y,klass,name,kraftpunkte,max_kraftpunkte):
self.x=x
self.y=y
self.klass=klass
self.name=name
self.kp=kraftpunkte
self.m_kp=max_kraftpunkte
gegner.append((x,y))
gegner2.append(self)
ges_einheiten.append((x,y))
ges_einheiten2.append(self)
self.update()
def update(self):
if self.klass=="Schuetze":
for (a,b) in [(1,15),(2,14),(2,15),(2,16),(3,13),(3,14),(3,15),(3,16),(3,17),
(4,15),(5,15),(6,15),(7,13),(7,14),(7,15),(7,16),(7,17),
(8,10),(8,11),(8,12),(8,15),(8,18),(8,19),(8,20),(9,8),(9,9),
(9,15),(9,21),(9,22),(10,7),(10,8),(10,9),(10,10),(10,11),(10,12),
(10,13),(10,14),(10,15),(10,16),(10,17),(10,18),(10,19),(10,20),
(10,21),(10,22),(10,23),(11,15),(12,14),(12,15),(12,16),(13,13),
(13,14,),(13,16),(14,12),(14,14),(14,16),(14,22),(15,11),(15,14),
(15,16),(15,17),(15,18),(15,19),(15,20),(15,21),(15,22),(16,10),
(16,13),(16,14),(16,16),(16,22),(17,5),(17,6),(17,7),(17,8),(17,10),
(17,12),(17,13),(17,16),(17,20),(17,21),(17,22),(18,4),(18,9),
(18,10),(18,13),(18,16),(18,20),(19,4),(19,6),(19,10),(19,12),
(19,15),(19,21),(19,24),(19,25),(20,4),(20,10),(20,14),(20,22),
(20,23),(20,24),(20,25),(21,5),(21,9),(21,10),(21,25),(22,6),
(22,7),(22,8),(22,10),(22,11),(22,12),(22,13),(22,14),(22,15),
(22,16),(22,17),(22,18),(22,19),(22,20),(22,25),(23,21),(23,22),
(23,23),(23,24),(23,25)]:
window.put("black",(self.x*30+a,self.y*30+b))
for (a,b) in [(14,15),(16,21),(21,24),(22,24)]:
window.put("brown3",(self.x*30+a,self.y*30+b))
for (a,b) in [(14,13),(15,15),(16,17),(17,17),(16,18),(17,18),(18,18),(19,18),
(16,19),(17,19),(18,19),(19,19),(20,19),(21,19),(16,20),(19,20),
(20,20),(21,20),(20,21),(21,21),(22,21),(21,22),(22,22),(21,23),(22,23)]:
window.put("red",(self.x*30+a,self.y*30+b))
for (a,b) in [(15,13),(15,12),(16,12),(16,11),(17,11),(18,11),(19,11),(20,11),(21,11),
(18,12),(20,12),(21,12),(19,13),(20,13),(21,13),(17,14),(18,14),(19,14),
(16,15),(17,15),(18,15),(21,14),(20,15),(21,15),(19,16),(20,16),(21,16),
(18,17),(19,17),(20,17),(21,17),(20,18),(21,18)]:
window.put("red3",(self.x*30+a,self.y*30+b))
for (a,b) in [(18,5),(19,5),(20,5),(18,6),(20,6),(21,6),(18,7),(19,7),(20,7),(21,7),
(19,8),(20,8),(21,8),(19,9),(20,9),(13,15)]:
window.put("khaki2",(self.x*30+a,self.y*30+b))
window.put("red",(self.x*30+18,self.y*30+8))
elif self.klass=="Speertraeger":
for (a,b) in [(13,3),(12,4),(13,4),(14,4),(11,5),(12,5),(13,5),(14,5),(15,5)]:
window.put("gray35",(self.x*30+a,self.y*30+b))
for (a,b) in [(13,6),(13,7),(13,8),(13,9),(13,10),(13,11),(13,12),(13,17),(13,18),
(13,19),(13,20),(13,21),(13,22),(13,23)]:
window.put("brown4",(self.x*30+a,self.y*30+b))
for (a,b) in [(12,14),(12,15),(12,16),(13,13),(13,14,),(13,16),(14,12),(14,14),
(14,16),(14,22),(15,11),(15,14),(15,16),(15,17),(15,18),(15,19),
(15,20),(15,21),(15,22),(16,10),(16,13),(16,14),(16,16),(16,22),
(17,5),(17,6),(17,7),(17,8),(17,10),(17,12),(17,13),(17,16),
(17,20),(17,21),(17,22),(18,4),(18,9),(18,10),(18,13),(18,16),
(18,20),(19,4),(19,6),(19,10),(19,12),(19,15),(19,21),(19,24),
(19,25),(20,4),(20,10),(20,14),(20,22),(20,23),(20,24),(20,25),
(21,5),(21,9),(21,10),(21,25),(22,6),(22,7),(22,8),(22,10),
(22,11),(22,12),(22,13),(22,14),(22,15),(22,16),(22,17),(22,18),
(22,19),(22,20),(22,25),(23,21),(23,22),(23,23),(23,24),(23,25),]:
window.put("black",(self.x*30+a,self.y*30+b))
for (a,b) in [(14,15),(16,21),(21,24),(22,24)]:
window.put("brown3",(self.x*30+a,self.y*30+b))
for (a,b) in [(14,13),(15,15),(16,17),(17,17),(16,18),(17,18),(18,18),(19,18),
(16,19),(17,19),(18,19),(19,19),(20,19),(21,19),(16,20),(19,20),
(20,20),(21,20),(20,21),(21,21),(22,21),(21,22),(22,22),(21,23),(22,23)]:
window.put("red",(self.x*30+a,self.y*30+b))
for (a,b) in [(15,13),(15,12),(16,12),(16,11),(17,11),(18,11),(19,11),(20,11),(21,11),
(18,12),(20,12),(21,12),(19,13),(20,13),(21,13),(17,14),(18,14),(19,14),
(16,15),(17,15),(18,15),(21,14),(20,15),(21,15),(19,16),(20,16),(21,16),
(18,17),(19,17),(20,17),(21,17),(20,18),(21,18)]:
window.put("red3",(self.x*30+a,self.y*30+b))
for (a,b) in [(18,5),(19,5),(20,5),(18,6),(20,6),(21,6),(18,7),(19,7),(20,7),(21,7),
(19,8),(20,8),(21,8),(19,9),(20,9),(13,15)]:
window.put("khaki2",(self.x*30+a,self.y*30+b))
window.put("red",(self.x*30+18,self.y*30+8))
elif self.klass=="Kaempfer":
for (a,b) in [(7,17),(8,7),(8,8),(8,9),(8,10),(8,11),(8,12),(8,16),(8,18),(9,5),(9,6),
(9,12),(9,15,),(9,19),(10,4),(10,11),(10,14),(10,18),(10,25),(10,26),
(11,3),(11,10),(11,13),(11,17),(11,24),(11,26),(12,3),(12,10),(12,12),
(12,14),(12,16),(12,23),(12,26),(13,2),(13,10),(13,11),(13,15),(13,22),
(13,26),(14,2),(14,10),(14,12),(14,16),(14,17),(14,21),(14,26),(15,2),
(15,10),(15,13),(15,18),(15,19),(15,20),(15,25),(16,2),(16,8),(16,9),
(16,10),(16,12),(16,14),(16,18),(16,24),(17,2),(17,4),(17,5),(17,6),(17,7),
(17,11),(17,13),(17,15),(17,19),(17,23),(18,2),(18,3),(18,6),(18,9),(18,12),
(18,15),(18,19),(18,24),(19,5),(19,12),(19,15),(19,18),(19,25),(20,5),
(20,12),(20,14),(20,17),(20,18),(20,19),(20,20),(20,21),(20,26),(21,5),
(21,12),(21,13),(21,17),(21,22),(21,27),(22,6),(22,9),(22,12),(22,13),
(22,17),(22,23),(22,27),(23,7),(23,11),(23,12),(23,16),(23,24),(23,27),
(24,8),(24,9),(24,10),(24,12),(24,16),(24,25),(24,27),(25,13),(25,14),
(25,15),(25,26),(25,27)]:
window.put("black",(self.x*30+a,self.y*30+b))
for (a,b) in [(9,7),(9,8),(9,9),(9,10),(9,11),(10,5),(10,6),(10,7),(10,8),(10,9),(10,10),
(11,4),(11,5),(11,6),(11,7),(11,8),(11,9),(12,4),(12,5),(12,6),(12,7),
(12,8),(12,9),(13,3),(13,4),(13,5),(13,6),(13,7),(13,8),(13,9),(14,3),
(14,4),(14,5),(14,6),(14,7),(14,8),(14,9),(15,3),(15,4),(15,5),(15,6),
(15,7),(15,8),(15,9),(16,3),(16,4),(16,5),(16,6),(16,7),(17,3)]:
window.put("gray45",(self.x*30+a,self.y*30+b))
for (a,b) in [(8,17),(9,16),(9,17),(9,18),(10,15),(10,16),(10,17),(11,14),(11,15),(11,16),
(12,15),(14,11),(15,11),(15,12),(16,11)]:
window.put("brown2",(self.x*30+a,self.y*30+b))
for (a,b) in [(19,16),(16,20),(17,20),(18,20),(19,20)]:
window.put("gold3",(self.x*30+a,self.y*30+b))
for (a,b) in [(12,13),(13,12),(13,13),(13,14),(14,13),(14,14),(14,15),(15,14),(15,15),
(15,16),(15,17),(16,15),(16,16),(16,17),(17,16),(17,17),(17,18),(18,17),
(18,18),(17,8),(17,9),(17,10),(18,8),(18,10),(18,11),(19,9),(19,10),(19,11),
(20,9),(20,10),(20,11),(21,9),(21,10),(21,11),(22,8),(22,10),(22,11),(23,8),
(23,9),(23,10)]:
window.put("khaki2",(self.x*30+a,self.y*30+b))
for (a,b) in [(18,7),(19,6),(19,8),(20,6),(20,8),(21,6),(21,8),(22,7),(16,19),(19,19),
(17,14),(18,13),(18,14),(18,16),(19,13),(19,14),(19,17),(20,13),(20,15),
(20,16),(21,14),(21,15),(21,16),(22,14),(22,15),(22,16),(23,13),(23,14),
(23,15),(24,13),(24,14),(24,15)]:
window.put("red",(self.x*30+a,self.y*30+b))
for (a,b) in [(19,7),(20,7),(21,7),(11,25),(12,24),(12,25),(13,23),(13,24),(13,25),
(14,22),(14,23),(14,24),(14,25),(15,21),(15,22),(15,23),(15,24),(16,21),
(16,22),(16,23),(17,21),(17,22),(18,21),(18,22),(18,23),(19,21),(19,22),
(19,23),(19,24),(20,22),(20,23),(20,24),(20,25),(21,23),(21,24),(21,25),
(21,26),(22,24),(22,25),(22,26),(23,25),(23,26),(24,26)]:
window.put("red3",(self.x*30+a,self.y*30+b))
elif self.klass=="Magier":
for (a,b) in [(17,3),(18,3),(16,4),(18,4),(15,5),(17,5),(14,6),(17,6),(14,7),(17,7),
(13,8),(18,8),(13,9),(18,9),(13,10),(14,10),(15,10),(16,10),(17,10),
(18,10),(14,11),(16,11),(18,11),(14,12),(17,12),(19,12),(15,13),
(17,13),(19,13),(13,14),(16,14),(19,14),(12,15),(16,15),(20,15),
(11,16),(15,16),(20,16),(10,17),(15,17),(21,17),(9,18),(14,18),(21,18),
(8,19),(13,19),(22,19),(7,20),(13,20),(23,20),(6,21),(12,21),(24,21),
(5,22),(12,22),(25,22),(6,23),(7,23),(11,23),(24,23),(8,24),(9,24),
(11,24),(20,24),(21,24),(22,24),(23,24),(10,25),(16,25),(17,25),(18,25),
(19,25),(10,26),(11,26),(12,26),(13,26),(14,26),(15,26)]:
window.put("black",(self.x*30+a,self.y*30+b))
for (a,b) in [(15,11),(17,11),(15,12),(16,12),(16,13)]:
window.put("khaki2",(self.x*30+a,self.y*30+b))
for (a,b) in [(14,14),(15,14),(13,15),(14,15),(15,15),(12,16),(13,16),(14,16),(11,17),
(12,17),(13,17),(14,17),(10,18),(11,18),(12,18),(13,18),(9,19),(10,19),
(11,19),(12,19),(8,20),(9,20),(10,20),(11,20),(12,20),(7,21),(8,21),
(9,21),(10,21),(11,21),(6,22),(7,22),(8,22),(9,22),(10,22),(11,22),(8,23),
(9,23),(10,23),(10,24),(18,12),(18,13),(17,14),(18,14),(17,15),(18,15),
(19,15),(17,16),(18,16),(19,16),(18,17),(19,17),(20,17),(18,18),(19,18),
(20,18),(18,19),(19,19),(20,19),(21,19),(19,20),(20,20),(21,20),(22,20),
(19,21),(20,21),(21,21),(22,21),(23,21),(19,22),(20,22),(21,22),(22,22),
(23,22),(24,22),(19,23),(20,23),(21,23),(22,23),(23,23),(19,24)]:
window.put("red3",(self.x*30+a,self.y*30+b))
for (a,b) in [(16,16),(16,17),(17,17),(15,18),(16,18),(17,18),(15,19),(16,19),(17,19),
(15,20),(16,20),(17,20),(18,20),(15,21),(16,21),(17,21),(18,21),(15,22),
(16,22),(17,22),(18,22),(16,23),(17,23),(18,23),(16,24),(17,24),(18,24)]:
window.put("red2",(self.x*30+a,self.y*30+b))
for (a,b) in [(17,4),(16,5),(15,6),(16,6),(15,7),(16,7),(14,8),(15,8),(16,8),(17,8),
(14,9),(15,9),(16,9),(17,9),(14,19),(14,20),(13,21),(14,21),(13,22),
(14,22),(12,23),(13,23),(14,23),(15,23),(12,24),(13,24),(14,24),(15,24),
(11,25),(12,25),(13,25),(14,25),(15,25)]:
window.put("red",(self.x*30+a,self.y*30+b))
elif self.klass=="Waiser":
for (a,b) in [(14,4),(15,4),(16,4),(13,5),(17,5),(12,6),(14,6),(16,6),(18,6),(12,7),
(18,7),(12,8),(18,8),(13,9),(18,9),(11,10),(12,10),(14,10),(15,10),
(16,10),(17,10),(10,11),(12,11),(14,11),(16,11),(18,11),(10,12),(11,12),
(14,12),(16,12),(19,12),(9,13),(14,13),(16,13),(17,13),(19,13),(8,14),
(15,14),(18,14),(19,14),(20,14),(7,15),(14,15),(21,15),(6,16),(13,16),
(21,16),(5,17),(12,17),(22,17),(4,18),(11,18),(22,18),(3,19),(10,19),
(23,19),(2,20),(9,20),(23,20),(3,21),(8,21),(24,21),(4,22),(5,22),(7,22),
(24,22),(6,23),(25,23),(5,24),(25,24),(4,25),(26,25),(3,26),(26,26),
(4,27),(5,27),(6,27),(7,27),(8,27),(9,27),(20,27),(21,27),(22,27),(23,27),
(24,27),(25,27),(10,28),(11,28),(12,28),(13,28),(14,28),(15,28),(16,28),
(17,28),(18,28),(19,28)]:
window.put("black",(self.x*30+a,self.y*30+b))
for (a,b) in [(14,5),(15,5),(16,5),(13,6),(15,6),(17,6),(13,7),(14,7),(15,7),(16,7),
(17,7),(13,8),(14,8),(15,8),(16,8),(17,8),(14,9),(15,9),(16,9),(17,9),
(15,11),(15,12),(15,13)]:
window.put("khaki2",(self.x*30+a,self.y*30+b))
for (a,b) in [(11,11),(17,11),(17,12),(18,12),(18,13)]:
window.put("gold3",(self.x*30+a,self.y*30+b))
for (a,b) in [(13,10),(13,11),(13,12),(13,13),(13,14),(14,14),(13,15),(12,12),(12,13),
(12,14),(12,15),(12,16),(11,13),(11,14),(11,15),(11,16),(11,17),(10,13),
(10,14),(10,15),(10,16),(10,17),(10,18),(9,14),(9,15),(9,16),(9,17),(9,18),
(9,19),(8,15),(8,16),(8,17),(8,18),(8,19),(8,20),(7,16),(7,17),(7,18),(7,19),
(7,20),(7,21),(6,17),(6,18),(6,19),(6,20),(6,21),(6,22),(5,18),(5,19),
(5,20),(5,21),(4,19),(4,20),(4,21),(3,20),
(16,14),(17,14),(15,15),(16,15),(17,15),(18,15),(19,15),(20,15),(16,16),
(17,16),(18,16),(19,16),(20,16),(16,17),(17,17),(18,17),(19,17),(20,17),
(21,17),(17,18),(18,18),(19,18),(20,18),(21,18),(17,19),(18,19),(19,19),
(20,19),(21,19),(22,19),(18,20),(19,20),(20,20),(21,20),(22,20),(18,21),
(19,21),(20,21),(21,21),(22,21),(23,21),(19,22),(20,22),(21,22),(22,22),
(23,22),(19,23),(20,23),(21,23),(22,23),(23,23),(24,23),(20,24),(21,24),
(22,24),(23,24),(24,24),(20,25),(21,25),(22,25),(23,25),(24,25),(25,25),
(21,26),(22,26),(23,26),(24,26),(25,26)]:
window.put("red3",(self.x*30+a,self.y*30+b))
for (a,b) in [(14,16),(15,16),(13,17),(14,17),(15,17),(12,18),(13,18),(14,18),(15,18),
(16,18),(12,19),(13,19),(14,19),(15,19),(16,19),(12,20),(13,20),(14,20),
(15,20),(16,20),(17,20),(13,21),(14,21),(15,21),(16,21),(17,21),(13,22),
(14,22),(15,22),(16,22),(17,22),(18,22),(14,23),(15,23),(16,23),(17,23),
(18,23),(14,24),(15,24),(16,24),(17,24),(18,24),(19,24),(15,25),(16,25),
(17,25),(18,25),(19,25),(15,26),(16,26),(17,26),(18,26),(19,26),(20,26),
(16,27),(17,27),(18,27),(19,27)]:
window.put("red2",(self.x*30+a,self.y*30+b))
for (a,b) in [(11,19),(10,20),(11,20),(9,21),(10,21),(11,21),(12,21),(8,22),(9,22),(10,22),
(11,22),(12,22),(7,23),(8,23),(9,23),(10,23),(11,23),(12,23),(13,23),(6,24),
(7,24),(8,24),(9,24),(10,24),(11,24),(12,24),(13,24),(5,25),(6,25),(7,25),
(8,25),(9,25),(10,25),(11,25),(12,25),(13,25),(14,25),(4,26),(5,26),(6,26),
(7,26),(8,26),(9,26),(10,26),(11,26),(12,26),(13,26),(14,26),(10,27),(11,27),
(12,27),(13,27),(14,27),(15,27)]:
window.put("red",(self.x*30+a,self.y*30+b))
elif self.klass=="Drachenreiter":
for (a,b) in [(21,1),(22,1),(23,1),(24,1),(25,1),(4,2),(5,2),(18,2),(19,2),(20,2),(26,2),
(3,3),(6,3),(17,3),(27,3),(2,4),(7,4),(11,4),(12,4),(16,4),(25,4),(26,4),
(2,5),(4,5),(7,5),(10,5),(13,5),(15,5),(24,5),(26,5),(27,5),(28,5),(1,6),
(8,6),(10,6),(13,6),(14,6),(23,6),(27,6),(28,6),(0,7),(3,7),(4,7),(9,7),
(11,7),(12,7),(21,7),(22,7),(26,7),(28,7),(1,8),(2,8),(5,8),(10,8),(11,8),
(13,8),(20,8),(25,8),(6,9),(11,9),(14,9),(19,9),(24,9),(7,10),(11,10),
(14,10),(18,10),(23,10),(8,11),(12,11),(13,11),(17,11),(22,11),(9,12),
(13,12),(16,12),(21,12),(10,13),(13,13),(15,13),(16,13),(17,13),(18,13),
(19,13),(20,13),(21,13),(22,13),(23,13),(11,14),(12,14),(13,14),(14,14),
(24,14),(25,14),(10,15),(26,15),(10,16),(20,16),(21,16),(22,16),(23,16),
(24,16),(27,16),(9,17),(22,17),(25,17),(28,17),(9,18),(22,18),(26,18),
(28,18),(9,19),(12,19),(22,19),(26,19),(28,19),(9,20),(11,20),(12,20),
(22,20),(23,20),(26,20),(27,20),(8,21),(9,21),(11,21),(12,21),(15,21),
(16,21),(17,21),(18,21),(19,21),(20,21),(23,21),(25,21),(26,21),(8,22),
(11,22),(12,22),(14,22),(18,22),(21,22),(23,22),(24,22),(25,22),(9,23),
(10,23),(12,23),(14,23),(18,23),(21,23),(23,23),(11,24),(14,24),(18,24),
(21,24),(23,24),(10,25),(14,25),(17,25),(20,25),(23,25),(10,26),(13,26),
(17,26),(20,26),(23,26),(11,27),(12,27),(18,27),(19,27),(21,27),(22,27)]:
window.put("black",(self.x*30+a,self.y*30+b))
elif self.klass=="Schwertkaempfer":
for (a,b) in [(12,4),(13,4),(14,4),(20,4),(21,4),(22,4),(11,5),(15,5),(19,5),(22,5),
(10,6),(12,6),(14,6),(16,6),(18,6),(22,6),(10,7),(16,7),(17,7),(21,7),
(10,8),(16,8),(20,8),(11,9),(15,9),(19,9),(12,10),(13,10),(14,10),(18,10),
(12,11),(13,11),(17,11),(18,11),(10,12),(11,12),(12,12),(16,12),(19,12),
(10,13),(15,13),(16,13),(19,13),(10,14),(14,14),(16,14),(19,14),(9,15),
(11,15),(14,15),(16,15),(19,15),(8,16),(12,16),(13,16),(14,16),(16,16),
(19,16),(7,17),(9,17),(11,17),(13,17),(14,17),(15,17),(19,17),(6,18),
(10,18),(18,18),(7,19),(9,19),(11,19),(17,19),(8,20),(11,20),(12,20),
(13,20),(14,20),(15,20),(16,20),(10,21),(16,21),(10,22),(12,22),(13,22),
(14,22),(16,22),(9,23),(12,23),(14,23),(17,23),(8,24),(11,24),(15,24),
(18,24),(8,25),(11,25),(15,25),(18,25),(7,26),(10,26),(16,26),(19,26),
(7,27),(8,27),(9,27),(10,27),(16,27),(17,27),(18,27),(19,27)]:
window.put("black",(self.x*30+a,self.y*30+b))
for (a,b) in [(12,5),(13,5),(14,5),(11,6),(13,6),(15,6),(11,7),(12,7),(13,7),(14,7),
(15,7),(11,8),(12,8),(13,8),(14,8),(15,8),(12,9),(13,9),(14,9),(10,15),
(9,16),(10,16),(11,16),(10,17)]:
window.put("khaki2",(self.x*30+a,self.y*30+b))
for (a,b) in [(12,17),(11,18)]:
window.put("gold3",(self.x*30+a,self.y*30+b))
for (a,b) in [(20,5),(21,5),(19,6),(20,6),(21,6),(18,7),(19,7),(20,7),(17,8),(18,8),
(19,8),(16,9),(17,9),(18,9),(15,10),(16,10),(17,10),(14,11),(15,11),
(16,11),(13,12),(14,12),(15,12),(11,13),(12,13),(13,13),(14,13),(11,14),
(12,14),(13,14),(12,15),(13,15),(8,17),(7,18),(8,18),(9,18),(8,19)]:
window.put("gray45",(self.x*30+a,self.y*30+b))
for (a,b) in [(16,17),(12,18),(13,18),(14,18),(15,18),(16,18),(17,18),(12,19),(13,19),
(14,19),(15,19),(16,19)]:
window.put("red",(self.x*30+a,self.y*30+b))
for (a,b) in [(17,12,),(18,12),(17,13),(18,13),(15,14),(17,14),(18,14),(15,15),(17,15),
(18,15),(15,16),(17,16),(18,16),(17,17),(18,17),(11,21),(12,21),(13,21),
(14,21),(15,21),(11,22),(15,22),(10,23),(11,23),(15,23),(16,23),(9,24),
(10,24),(16,24),(17,24),(9,25),(10,25),(16,25),(17,25),(8,26),(9,26),
(17,26),(18,26)]:
window.put("red3",(self.x*30+a,self.y*30+b))
lbl.update()
class Curser:
def __init__(self):
self.x=0
self.y=0
self.pos2=1
self.pos3="o"
self.menue="main"
self.akp=0
self.running=0
def update(self):
for (a,b) in [(3,2),(4,2),(5,2),(6,0),(7,1),(6,2),(5,0),(4,0),(3,0),(2,0),
(1,1),(0,2),(0,3),(0,4),(0,5),(2,5),(0,6),(1,7),(2,6),(2,4),
(2,3),(22,0),(23,0),(24,0),(25,0),(26,0),(27,1),(28,2),(28,3),
(28,4),(28,5),(28,6),(27,7),(26,6),(26,5),(26,4),(26,3),(25,2),
(24,2),(23,2),(22,2),(21,1),(27,21),(28,22),(28,23),(28,24),
(28,25),(28,26),(27,27),(26,28),(25,28),(24,28),(23,28),(22,28),
(21,27),(22,26),(23,26),(24,26),(25,26),(26,25),(26,24),(26,23),
(26,22),(1,21),(2,22),(2,23),(2,24),(2,25),(3,26),(4,26),(5,26),
(6,26),(7,27),(6,28),(5,28),(4,28),(3,28),(2,28),(1,27),(0,26),
(0,25),(0,24),(0,23),(0,22)]:
window.put("black",(self.x*30+a,self.y*30+b))
for (a,b) in [(1,6),(1,5),(1,4),(1,3),(1,2),(2,2),(2,1),(3,1),(4,1),(5,1),(6,1),
(22,1),(23,1),(24,1),(25,1),(26,1),(26,2),(27,2),(27,3),(27,4),(27,5),(27,6),
(1,22),(1,23),(1,24),(1,25),(1,26),(2,26),(2,27),(3,27),(4,27),(5,27),(6,27),
(22,27),(23,27),(24,27),(25,27),(26,27),(26,26),(27,26),(27,25),(27,24),(27,23),(27,22)]:
window.put("gold3",(self.x*30+a,self.y*30+b))
fname.configure(text=sp.gitter[(self.x,self.y)].fill)
if (self.x,self.y) not in ges_einheiten:
ename.configure(text="-")
kp_prozent=0
eozwe=0
for einheit in einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
ename.configure(text=einheit.name+" ("+str(einheit.kp)+"/"+str(einheit.m_kp)+")")
kp_prozent=100.0/einheit.m_kp*einheit.kp
eozwe=1
for einheit in gegner2:
if (einheit.x,einheit.y)==(self.x,self.y):
ename.configure(text=einheit.name+" ("+str(einheit.kp)+"/"+str(einheit.m_kp)+")")
kp_prozent=100.0/einheit.m_kp*einheit.kp
eozwe=2
if self.akp==0 and eozwe==0:
pass
if self.akp==0 and eozwe==1:
for x in range(2,kp_prozent/100*263):
for y in range(2,28):
window2.put("gray30",(x,y))
if self.akp==0 and eozwe==2:
for x in range(266,kp_prozent/100*263+262):
for y in range(2,28):
window2.put("gray30",(x,y))
if self.akp==1 and eozwe==0:
for x in range(2,263):
for y in range(2,28):
window2.put("black",(x,y))
if self.akp==1 and eozwe==1:
for x in range(2,kp_prozent/100*263):
for y in range(2,28):
window2.put("gray30",(x,y))
for x in range(kp_prozent/100*264+2,263):
for y in range(2,28):
window2.put("black",(x,y))
if self.akp==1 and eozwe==2:
for x in range(2,263):
for y in range(2,28):
window2.put("black",(x,y))
for x in range(266,kp_prozent/100*263+262):
for y in range(2,28):
window2.put("gray30",(x,y))
if self.akp==2 and eozwe==0:
for x in range(266,525):
for y in range(2,28):
window2.put("black",(x,y))
if self.akp==2 and eozwe==1:
for x in range(266,525):
for y in range(2,28):
window2.put("black",(x,y))
for x in range(2,kp_prozent/100*263):
for y in range(2,28):
window2.put("gray30",(x,y))
if self.akp==2 and eozwe==2:
for x in range(266,kp_prozent/100*263+262):
for y in range(2,28):
window2.put("gray30",(x,y))
for x in range(kp_prozent/100*263+262,525):
for y in range(2,28):
window2.put("black",(x,y))
self.akp=eozwe
lbl.update()
lbl2.update()
def action(self, event):
taste=event.keysym
if taste=="Up" and not self.running:
if self.menue=="main":
if self.y!=0:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.y=self.y-1
self.update()
elif self.menue=="e":
if self.y!=0:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.y=self.y-1
self.update()
self.towards.append((self.x,self.y))
elif self.menue=="e2" and self.pos2!=1:
self.pos2=self.pos2-1
elif taste=="Down" and not self.running:
if self.menue=="main":
if self.y!=9:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.y=self.y+1
self.update()
elif self.menue=="e":
if self.y!=9:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.y=self.y+1
self.update()
self.towards.append((self.x,self.y))
elif self.menue=="e2" and self.pos2!=10:
self.pos2=self.pos2+1
elif taste=="Right" and not self.running:
if self.menue=="main":
if self.x!=9:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.x=self.x+1
self.update()
elif self.menue=="e":
if self.x!=9:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.x=self.x+1
self.update()
self.towards.append((self.x,self.y))
elif taste=="Left" and not self.running:
if self.menue=="main":
if self.x!=0:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.x=self.x-1
self.update()
elif self.menue=="e":
if self.x!=0:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.x=self.x-1
self.update()
self.towards.append((self.x,self.y))
elif taste=="Return" and not self.running:
if self.menue=="main":
if (self.x,self.y) in einheiten:
for einheit in einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y) and einheit.act==1:
self.einh=einheit
self.menue="e"
for feld in sp.gitter.values():
if (feld.x,feld.y)==(self.x,self.y):
feld=feld
feld.fa("blue")
self.einh.update()
self.towards=[]
elif (self.x,self.y) not in einheiten:
for einheit in einheiten2:
einheit.act=1
einheit.update()
elif self.menue=="e":
self.running=1
if self.towards!=[]:
self.einh.go(self.towards)
if self.towards==[]:
for feld in sp.gitter.values():
if (feld.x,feld.y)==(self.x,self.y):
feld.far=None
feld.update()
self.einh.update()
self.update()
self.running=0
self.menue="e2"
elif self.menue=="e2":
self.einh.act=0
self.menue="main"
self.pos2=1
self.einh=None
elif taste=="BackSpace" and not self.running:
if self.menue=="e":
for feld in sp.gitter.values():
if (feld.x,feld.y)==(self.x,self.y):
feld.update()
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
(self.x,self.y)=(self.einh.x,self.einh.y)
for feld in sp.gitter.values():
if (feld.x,feld.y)==(self.x,self.y):
feld.far=None
feld.update()
for einheit in einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.menue="main"
self.update()
elif taste=="m":
try:
sp.update((self.x,self.y))
for einheit in ges_einheiten2:
if (einheit.x,einheit.y)==(self.x,self.y):
einheit.update()
self.update()
except:
(self.x,self.y)=(0,0)
self.update()
class Curser2:
def __init__(self,x,y):
self.x=x
self.y=y
def on(self):
for (a,b) in [(0,0),(1,0),(0,1),(2,1),(3,1),(0,2),(4,2),(5,2),(0,3),(6,3),(7,3),(0,4),
(8,4),(9,4),(0,5),(10,5),(11,5),(0,6),(12,6),(13,6),(0,7),(14,7),(15,7),
(0,8),(16,8),(17,8),(0,9),(14,9),(15,9),(0,10),(12,10),(13,10),(0,11),
(10,11),(11,11),(0,12),(8,12),(9,12),(0,13),(6,13),(7,13),(0,14),(4,14),
(5,14),(0,15),(2,15),(3,15),(0,16),(1,16)]:
window.put("gray15",(self.x+a,self.y+b))
for (a,b) in [(1,1),(1,2),(2,2),(3,2),(1,3),(2,3),(3,3),(4,3),(5,3),(1,4),(2,4),(3,4),
(4,4),(5,4),(6,4),(7,4),(1,5),(2,5),(3,5),(4,5),(5,5),(6,5),(7,5),(8,5),
(9,5),(1,6),(2,6),(3,6),(4,6),(5,6),(6,6),(7,6),(8,6),(9,6),(10,6),(11,6),
(1,7),(2,7),(3,7),(4,7),(5,7),(6,7),(7,7),(8,7),(9,7),(10,7),(11,7),(12,7),
(12,7),(1,8),(2,8),(3,8),(4,8),(5,8),(6,8),(7,8),(8,8),(9,8),(10,8),(11,8),
(12,8),(13,8),(14,8),(15,8),(1,9),(2,9),(3,9),(4,9),(5,9),(6,9),(7,9),(8,9),
(9,9),(10,9),(11,9),(12,9),(13,9),(1,10),(2,10),(3,10),(4,10),(5,10),(6,10),
(7,10),(8,10),(9,10),(10,10),(11,10),(1,11),(2,11),(3,11),(4,11),(5,11),
(6,11),(7,11),(8,11),(9,11),(1,12),(2,12),(3,12),(4,12),(5,12),(6,12),(7,12),
(1,13),(2,13),(3,13),(4,13),(5,13),(1,14),(2,14),(3,14),(1,15)]:
window.put("gold3",(self.x+a,self.y+b))
lbl.update()
def off(self):
for (a,b) in [(0,0),(1,0),(0,1),(2,1),(3,1),(0,2),(4,2),(5,2),(0,3),(6,3),(7,3),(0,4),
(8,4),(9,4),(0,5),(10,5),(11,5),(0,6),(12,6),(13,6),(0,7),(14,7),(15,7),
(0,8),(16,8),(17,8),(0,9),(14,9),(15,9),(0,10),(12,10),(13,10),(0,11),
(10,11),(11,11),(0,12),(8,12),(9,12),(0,13),(6,13),(7,13),(0,14),(4,14),
(5,14),(0,15),(2,15),(3,15),(0,16),(1,16),
(1,1),(1,2),(2,2),(3,2),(1,3),(2,3),(3,3),(4,3),(5,3),(1,4),(2,4),(3,4),
(4,4),(5,4),(6,4),(7,4),(1,5),(2,5),(3,5),(4,5),(5,5),(6,5),(7,5),(8,5),
(9,5),(1,6),(2,6),(3,6),(4,6),(5,6),(6,6),(7,6),(8,6),(9,6),(10,6),(11,6),
(1,7),(2,7),(3,7),(4,7),(5,7),(6,7),(7,7),(8,7),(9,7),(10,7),(11,7),(12,7),
(12,7),(1,8),(2,8),(3,8),(4,8),(5,8),(6,8),(7,8),(8,8),(9,8),(10,8),(11,8),
(12,8),(13,8),(14,8),(15,8),(1,9),(2,9),(3,9),(4,9),(5,9),(6,9),(7,9),(8,9),
(9,9),(10,9),(11,9),(12,9),(13,9),(1,10),(2,10),(3,10),(4,10),(5,10),(6,10),
(7,10),(8,10),(9,10),(10,10),(11,10),(1,11),(2,11),(3,11),(4,11),(5,11),
(6,11),(7,11),(8,11),(9,11),(1,12),(2,12),(3,12),(4,12),(5,12),(6,12),(7,12),
(1,13),(2,13),(3,13),(4,13),(5,13),(1,14),(2,14),(3,14),(1,15)]:
window.put("black",(self.x+a,self.y+b))
lbl.update()
def load(fname,big):
global dates
fname="D:\\Water Circle\\"+fname+".txt"
datei=file(fname,"r")
text=datei.read()
datei.close()
dates1=text.splitlines()
dates=[]
dates_l=[]
for i in dates1:
if i in ["0","1","2","3","4","5","6","7","8","9","10",
"11","12","13","14","15","16","17","18","19","20",
"21","22","23","24","25","26","27","28","29","30",
"31","32","33","34","35","36","37","38","39","40",
"41","42","43","44","45","46","47","48","49","50",
"51","52","53","54","55","56","57","58","59","60",
"61","62","63","64","65","66","67","68","69","70",
"71","72","73","74","75","76","77","78","79","80",
"81","82","83","84","85","86","87","88","89","90",
"91","92","93","94","95","96","97","98","99","100",
"101","102","103","104","105","106","107","108","109",
"110","111","112","113","114","115","116","117","118",
"119","120"]:
dates.append(int(i))
else:
dates.append(i)
for i in range(len(dates)/big):
for i in range(big):
dates_l.append(dates.pop(0))
dates.append(dates_l)
dates_l=[]
root=Tk()
root.title("Water Circle _1_")
window=PhotoImage(width=1024, height=674)
lbl=Label(root,image=window,bg="black")
ename=Label(root,width=20,fg="red",bg="gray20",
font=("Comic Sans MS",15,"normal"))
window2=PhotoImage(width=527,height=30)
lbl2=Label(root,image=window2,bg="black")
fname=Label(root,width=21,fg="red",bg="gray20",
font=("Comic Sans MS",15,"normal"))
lbl.pack()
ename.pack(side=LEFT)
lbl2.pack(side=LEFT)
for x in [0,1,263,264,265,525,526]:
for y in range(30):
window2.put("gray15",(x,y))
for x in range(528):
for y in [0,1,28,29]:
window2.put("gray15",(x,y))
for x in range(775,1022):
for y in [0,1,672,673]:
window.put("gray15",(x,y))
for x in [773,774,1022,1023]:
for y in range(674):
window.put("gray15",(x,y))
fname.pack(side=LEFT)
einheiten=[]
einheiten2=[]
gegner=[]
gegner2=[]
ges_einheiten=[]
ges_einheiten2=[]
sp=Spielfeld(10,10)
c=Curser()
root.bind("<KeyPress>", c.action)
root.focus_force()
load("Game_save_f",3)
for (x,y,n) in dates:
sp.set((x,y),n)
load("Game_save_e",6)
for (x,y,h,n,kp,max_kp) in dates:
e=Einheit(x,y,h,n,kp,max_kp)
load("Game_save_g",6)
for (x,y,h,n,kp,max_kp) in dates:
e=Gegner(x,y,h,n,kp,max_kp)
c.update()
PlaySound("D:\\Water Circle\\sound.wav",1)
#root.mainloop()