|
@@ -1 +1,83 @@
|
1
|
|
-jizhjhj
|
|
1
|
+
|
|
2
|
+# Authors : Kai Zhang , Milad Shirvani Filabadi, Yuan Wei
|
|
3
|
+
|
|
4
|
+#einfaches Ping-Pong Spiel basier auf GUI(Tkinter)
|
|
5
|
+
|
|
6
|
+#08.11.2017
|
|
7
|
+
|
|
8
|
+#Stage 1 - eine leere seite erstellen
|
|
9
|
+
|
|
10
|
+#Stage 2 - Ball und Paddles zeichnen
|
|
11
|
+
|
|
12
|
+#Stage 3 - Ball Bewegen
|
|
13
|
+
|
|
14
|
+#Stage 4 - Horizontal seite als Wand
|
|
15
|
+
|
|
16
|
+#Stage 5 - Paddles Bewegen
|
|
17
|
+
|
|
18
|
+#Stage 6 - Paddles Bewegen mit Tastatur Tasten (WS,Linke Seite) und (OL, rechte seite)
|
|
19
|
+# Q Taste als Speil beenden
|
|
20
|
+
|
|
21
|
+#Stage 7 - Wenn Ball trifft Paddle dann zurück wenn nicht dann Weg von Speilraum
|
|
22
|
+
|
|
23
|
+#Stage 8 - Eine Punktsystem erstellen
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+# import tkinter
|
|
27
|
+
|
|
28
|
+#from tkinter import *
|
|
29
|
+
|
|
30
|
+#root=tk()
|
|
31
|
+
|
|
32
|
+#root.title("Pong")
|
|
33
|
+
|
|
34
|
+#c=Canvas(root,with300,height=200,bg="white")
|
|
35
|
+import Tkinter as tk
|
|
36
|
+
|
|
37
|
+from Tkinter import *
|
|
38
|
+
|
|
39
|
+class Pong(Frame):#Parameter definieren
|
|
40
|
+
|
|
41
|
+ #winfo_screenwidth = 1000
|
|
42
|
+
|
|
43
|
+ #winfo_screenheight =800
|
|
44
|
+
|
|
45
|
+ player1 = 0
|
|
46
|
+
|
|
47
|
+ player2 = 0
|
|
48
|
+
|
|
49
|
+ ballX=50
|
|
50
|
+
|
|
51
|
+ ballY=50
|
|
52
|
+
|
|
53
|
+ ball = 0
|
|
54
|
+
|
|
55
|
+ paddle1 = 0
|
|
56
|
+
|
|
57
|
+ paddle2 = 0
|
|
58
|
+
|
|
59
|
+ paddle1X = 2
|
|
60
|
+
|
|
61
|
+ paddle1Y = 2
|
|
62
|
+
|
|
63
|
+ paddle2X = 0
|
|
64
|
+
|
|
65
|
+ paddle2Y = 2
|
|
66
|
+
|
|
67
|
+ canvas = 0
|
|
68
|
+
|
|
69
|
+ ballDX = 2
|
|
70
|
+
|
|
71
|
+ ballDY = -2
|
|
72
|
+
|
|
73
|
+ winHEIGHT = 0;
|
|
74
|
+
|
|
75
|
+ winWIDTH = 0;
|
|
76
|
+
|
|
77
|
+ paddleSpeed = 15
|
|
78
|
+
|
|
79
|
+ player1Points = 0
|
|
80
|
+
|
|
81
|
+ player2Points = 0
|
|
82
|
+
|
|
83
|
+ textLabel = 0
|