shuvit 2 years ago
parent
commit
2130b097c9
3 changed files with 48 additions and 15 deletions
  1. 7
    2
      scripts/FSM.py
  2. 41
    2
      scripts/StatesCamera.py
  3. 0
    11
      scripts/StatesTeam.py

+ 7
- 2
scripts/FSM.py View File

@@ -159,7 +159,9 @@ class CameraFSM(Char):
159 159
         self.owner = owner
160 160
         
161 161
         state_list = [
162
-        'Example']
162
+        'Example',
163
+        'Zamboni',
164
+        'GameOn']
163 165
         
164 166
         for s in state_list:
165 167
             self.FSM.AddState(s, getattr(StatesGame, s)(self.FSM))
@@ -180,7 +182,10 @@ class PuckFSM(Char):
180 182
         self.owner = owner
181 183
         
182 184
         state_list = [
183
-        'Example']
185
+        'Example', 
186
+        'Invisible', 
187
+        'Possessed', 
188
+        'NotPossessed']
184 189
         
185 190
         for s in state_list:
186 191
             self.FSM.AddState(s, getattr(StatesGame, s)(self.FSM))

+ 41
- 2
scripts/StatesCamera.py View File

@@ -14,7 +14,8 @@ class State(object):
14 14
         print('Executing')
15 15
     def Exit(self):
16 16
         print('Exiting')
17
-#====================================             
17
+#==================================== 
18
+            
18 19
 class Example(State):
19 20
     def __init__(self,FSM):
20 21
         super(Example, self).__init__(FSM)    
@@ -30,4 +31,42 @@ class Example(State):
30 31
         #self.FSM.ToTransition('toNewState')
31 32
     
32 33
     def Exit(self):
33
-        pass
34
+        pass
35
+
36
+#====================================   
37
+
38
+class GameOn(State):
39
+    def __init__(self,FSM):
40
+        super(GameOn, self).__init__(FSM)    
41
+        
42
+    def Enter(self):
43
+        self.FSM.stateLife = 1
44
+        super(GameOn, self).Enter()        
45
+        
46
+    def Execute(self):
47
+        self.FSM.stateLife += 1
48
+        #o = self.FSM.owner
49
+        #g = o.me['game']
50
+        #self.FSM.ToTransition('toNewState')
51
+    
52
+    def Exit(self):
53
+        pass
54
+
55
+#====================================  
56
+
57
+class Zamboni(State):
58
+    def __init__(self,FSM):
59
+        super(Zamboni, self).__init__(FSM)    
60
+        
61
+    def Enter(self):
62
+        self.FSM.stateLife = 1
63
+        super(Zamboni, self).Enter()        
64
+        
65
+    def Execute(self):
66
+        self.FSM.stateLife += 1
67
+        #o = self.FSM.owner
68
+        #g = o.me['game']
69
+        #self.FSM.ToTransition('toNewState')
70
+    
71
+    def Exit(self):
72
+        pass                

+ 0
- 11
scripts/StatesTeam.py View File

@@ -131,17 +131,9 @@ class Chase(State):
131 131
         if g.a_team == t:
132 132
             if t.possession == 1:
133 133
                 self.possession = 1
134
-            #print('this is the a_team', self.FSM.owner)
135 134
         if g.b_team == t:
136 135
             if t.possession == 1:
137 136
                 self.possession = 2
138
-            #print('this is the b_team', self.FSM.owner)  
139
-        #print('posession', g.team_possession)          
140
-
141
-        #if the opposite team gains possesion
142
-
143
-
144
-        #self.FSM.ToTransition('tooOffence')
145 137
     
146 138
     def Exit(self):
147 139
         pass
@@ -157,9 +149,6 @@ class Defense(State):
157 149
         
158 150
     def Execute(self):
159 151
         self.FSM.stateLife += 1
160
-        #o = self.FSM.owner
161
-        #g = o.me['game']
162
-        #self.FSM.ToTransition('tooOffence')
163 152
     
164 153
     def Exit(self):
165 154
         pass

Loading…
Cancel
Save