|
@@ -1,14 +1,21 @@
|
1
|
1
|
#!/usr/bin/env python
|
2
|
2
|
# -*- coding: utf-8 -*-
|
3
|
3
|
|
|
4
|
+#erstellt von Alexander Teubert und Michelle Piras /MT2016
|
|
5
|
+
|
|
6
|
+#MAZE GAME
|
|
7
|
+#klassisches Labyrinth Spiel. Du musst das Ziel finden. Die Waende sind nicht begehbar. Mit Hilfe der Pfeiltasten bewegst du dich fort.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+#IMPORTIEREN
|
4
|
11
|
import random
|
5
|
12
|
import Tkinter as tk
|
6
|
13
|
import sys
|
7
|
14
|
|
8
|
|
-
|
|
15
|
+#IMPLEMENTIERUNG IN TKINTER
|
9
|
16
|
class Application(tk.Frame):
|
10
|
17
|
|
11
|
|
- def __init__(self, width=21, height=21, size=10):
|
|
18
|
+ def __init__(self, width=21, height=21, size=10):
|
12
|
19
|
tk.Frame.__init__(self)
|
13
|
20
|
self.maze = Maze(width, height)
|
14
|
21
|
self.size = size
|
|
@@ -94,7 +101,7 @@ class Application(tk.Frame):
|
94
|
101
|
if self.maze.maze[y][x] == 1:
|
95
|
102
|
return 'black'
|
96
|
103
|
|
97
|
|
-
|
|
104
|
+#GENERIERUNG DES LABYRINTHS
|
98
|
105
|
class Maze(object):
|
99
|
106
|
|
100
|
107
|
def __init__(self, width=21, height=21, exit_cell=(19,1), start_cell=(1,19)):
|