shuvit 2 years ago
parent
commit
c33314e94c

+ 1
- 1
assets/kits/ramps.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:92a772b123cff55f15673ad964a9aa95951a3b8c4171fcb805d6af254ef47235
2
+oid sha256:29696d65de25e271a669c8ce0dbe78f9ffb5b606969c5d8c9294b3d649c3113b
3 3
 size 24216420

+ 2
- 2
assets/ramps.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:f878d18446af524cb524aa77eb95a0fa831fbbf3a4c59a3f4e08e99c9efff9a5
3
-size 22712684
2
+oid sha256:ad2104b41387da0af0e55284115b7a356ec7b1e2c2bc467822b4dfe144d7fcfc
3
+size 44324752

+ 2
- 2
assets/user2.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:7f296d335d33a398eacf246006a46611d5759987055d3862532a79254d8d6029
3
-size 7121688
2
+oid sha256:9f55ffabdb22c80211d3a4fceb4f1e549c0b265c63163c66eaa5bc5ad3fe4174
3
+size 542792

+ 74
- 1
scripts/StatesPlayer.py View File

@@ -1,5 +1,5 @@
1 1
 import bge
2
-
2
+dict = bge.logic.globalDict
3 3
 #====================================     
4 4
 
5 5
 State = type("State", (object,), {})
@@ -64,12 +64,82 @@ class Walk(State):
64 64
         
65 65
     def Enter(self):
66 66
         self.FSM.stateLife = 1
67
+        o = self.FSM.owner
68
+    
69
+        # if self.FSM.owner['stance']:
70
+        #     self.FSM.owner.applyRotation([0,0,3], True)
71
+        #     self.FSM.owner['stance'] = False
72
+        #     o['requestAction'] = 'fak_offboard' 
73
+        #     print('request fak offboard')            
74
+        # else:
75
+        #     o['requestAction'] = 'reg_offboard'                 
76
+        #     print('request reg offboard')            
77
+            #o['requestAction'] = 'fak_offboard'                          
78
+        
79
+        
80
+
81
+        
82
+
67 83
         super(Walk, self).Enter()        
68 84
         
69 85
     def Execute(self):
70 86
         self.FSM.stateLife += 1
87
+        o = self.FSM.owner
88
+        #print('walking')
89
+        if self.FSM.stateLife == 2:
90
+            if self.FSM.owner['stance']:
91
+                self.FSM.owner.applyRotation([0,0,3], True)
92
+                self.FSM.owner['stance'] = False
93
+                o['requestAction'] = 'fak_offboard' 
94
+                print('request fak offboard')            
95
+            else:
96
+                o['requestAction'] = 'reg_offboard'                 
97
+                print('request reg offboard') 
98
+        if self.FSM.stateLife > 5:
99
+            o['requestAction'] = 'reg_idle'                 
100
+
101
+        self.check_onboard()
102
+        self.check_jump()
103
+
71 104
         #self.FSM.ToTransition('toLand')
105
+    def check_onboard(self):
106
+        if dict['walk'] == 0:
107
+            self.FSM.ToTransition('toRoll')
108
+        if dict['yBut'] == 1 and dict['last_yBut'] == 0:
109
+            print('do the onboard')
110
+
111
+
112
+    def check_jump(self):
113
+        o = self.FSM.owner
114
+        #limit fall speed
115
+        if o.linearVelocity.z < -10:
116
+            o.linearVelocity.z = -10
117
+        if dict['xBut'] == True or dict['kb_space'] == 1: 
118
+            if dict['last_xBut'] == 0:
119
+                #killact(3)
120
+                #killact(4)
121
+                #killact(5)
122
+                #killact(6)
123
+                #killact(7)      
124
+                #if STANCE == 0:  
125
+                o['requestAction'] ='reg_jump'  
126
+                    #print('jump') 
127
+                #if STANCE == 1:
128
+                    #own['requestAction'] ='fak_jump'             
129
+                    #print('jump')
130
+                JUMPHEIGHT = 1100
131
+                force = [ 0.0, 0.0, JUMPHEIGHT]
132
+                # use local axis
133
+                local = False
134
+                # apply force -- limit jump speed
135
+                if o.linearVelocity.z < 10:
136
+                    o.applyForce(force, local)
137
+                    o.linearVelocity.z += 5
138
+                    #o.linearVelocity.x = linvel.x
139
+                    #o.linearVelocity.y = linvel.y
140
+                    #own['walk_jump_timer'] = 6
72 141
         
142
+
73 143
     def Exit(self):
74 144
         pass
75 145
 
@@ -85,6 +155,9 @@ class Roll(State):
85 155
         
86 156
     def Execute(self):
87 157
         self.FSM.stateLife += 1
158
+        if dict['walk'] == 1:
159
+            self.FSM.ToTransition('toWalk')
160
+        print('rolling')
88 161
         #self.FSM.ToTransition('toLand')
89 162
         
90 163
     def Exit(self):

+ 2
- 2
scripts/actionPlayer.py View File

@@ -175,7 +175,7 @@ state_b = ['reg_jump',
175 175
 'fak_jump',
176 176
 'fak_walk_air',
177 177
 'fak_walk_air_out',
178
-#'fak_onboard',
178
+'fak_onboard',
179 179
 #'fak_offboard',
180 180
 'fak_brfoot',
181 181
 'fak_frfoot',
@@ -472,7 +472,7 @@ def main(cont):
472 472
 
473 473
 
474 474
 	#-----------------------
475
-	#print(own['aState'], newState, rA)
475
+	print(own['aState'], newState, rA)
476 476
 	#print()
477 477
 	if newState != '':
478 478
 		own['aState'] = newState 

+ 18
- 14
scripts/actionsFSMlist.py View File

@@ -191,23 +191,25 @@ reg_idle7 = a_class(
191 191
 
192 192
 reg_jump = a_class(
193 193
 	#player armature action name, start, end frames
194
-	'reg_jump', 1, 10,
194
+	#'reg_jump', 1, 10,
195
+	'a_jump_t', 9, 27,
195 196
 	#deck action name, start, end frames  
196
-	'b_reg_jump', 1, 10,
197
+	'b_reg_jump', 1, 5,
197 198
 	#layer, speed, mode (0 = play, 1 = loop), blendin
198
-	1, .5, 0, 10,
199
+	3, .75, 0, 5,
199 200
 	#intro, length
200 201
 	None, 0,
201 202
 	#exits
202 203
 	['reg_idle', 'reg_walk_air', 'reg_onboard'],
203 204
 	#force exit, frame
204
-	'reg_walk_air', 20,
205
+	'reg_walk_air', 12,
205 206
 	#opposite
206 207
 	None)
207 208
 
208 209
 reg_walk_air = a_class(
209 210
 	#player armature action name, start, end frames
210
-	'reg_walk_air', 10, 10,
211
+	#'reg_walk_air', 10, 10,
212
+	'a_jump_t', 27, 27,
211 213
 	#deck action name, start, end frames  
212 214
 	'b_reg_walk_air', 10, 10,
213 215
 	#layer, speed, mode (0 = play, 1 = loop), blendin
@@ -225,7 +227,8 @@ reg_walk_air = a_class(
225 227
 
226 228
 reg_walk_air_out = a_class(
227 229
 	#player armature action name, start, end frames
228
-	'reg_walk_air', 10, 40,
230
+	#'reg_walk_air', 10, 40,
231
+	'a_jump_t', 27, 49,
229 232
 	#deck action name, start, end frames  
230 233
 	'b_reg_walk_air', 10, 40,
231 234
 	#layer, speed, mode (0 = play, 1 = loop), blendin
@@ -236,7 +239,7 @@ reg_walk_air_out = a_class(
236 239
 	#['reg_idle', 'reg_walk', 'reg_walkFast', 'reg_onboard'],
237 240
 	walk_exits,
238 241
 	#force exit, frame
239
-	'reg_idle', 10,
242
+	'reg_idle', 20,
240 243
 	#opposite
241 244
 	None)
242 245
 
@@ -317,7 +320,7 @@ reg_roll = a_class(
317 320
 	#intro, length
318 321
 	None, 0,
319 322
 	#exits
320
-	['reg_idle', 'reg_offboard', 'reg_turnLeft', 'reg_turnRight', 'reg_opos', 'reg_nopos', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual', 'reg_air', 'reg_air_nose', 'reg_air_tail', 'reg_manual_left', 'reg_manual_right', 'reg_nmanual_left', 'reg_nmanual_right', 'reg_stop'],
323
+	['reg_idle', 'fak_offboard' 'reg_offboard', 'reg_turnLeft', 'reg_turnRight', 'reg_opos', 'reg_nopos', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual', 'reg_air', 'reg_air_nose', 'reg_air_tail', 'reg_manual_left', 'reg_manual_right', 'reg_nmanual_left', 'reg_nmanual_right', 'reg_stop'],
321 324
 	#force exit, frame
322 325
 	None, 0,
323 326
 	#opposite
@@ -2528,17 +2531,18 @@ fak_onboard = a_class(
2528 2531
 
2529 2532
 fak_offboard = a_class(
2530 2533
 	#player armature action name, start, end frames
2531
-	'fak_noffboard', 1, 30,
2534
+	'fak_noffboard', 1, 24,
2535
+	#'fak_noffboard', 
2532 2536
 	#deck action name, start, end frames  
2533
-	'b_fak_offboard', 1, 30,
2537
+	'b_reg_offboard', 1, 30,
2534 2538
 	#layer, speed, mode (0 = play, 1 = loop), blendin
2535
-	4, .5, 0, 5,
2539
+	2, .5, 0, 0,
2536 2540
 	#intro, length
2537 2541
 	None, 0,
2538 2542
 	#exits
2539
-	['fak_idle', 'fak_walkFast', 'fak_walk', 'fak_onboard'],
2543
+	['reg_idle', 'fak_idle', 'fak_walkFast', 'fak_walk', 'fak_onboard'],
2540 2544
 	#force exit, frame
2541
-	'fak_idle', 28,
2545
+	'reg_idle3', 24,
2542 2546
 	#opposite
2543 2547
 	None)
2544 2548
 
@@ -2552,7 +2556,7 @@ fak_roll = a_class(
2552 2556
 	#intro, length
2553 2557
 	None, 0,
2554 2558
 	#exits
2555
-	['fak_idle', 'fak_offboard', 'fak_turnLeft', 'fak_turnRight', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right'],
2559
+	['fak_idle', 'fak_offboard', 'reg_offboard' 'fak_turnLeft', 'fak_turnRight', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right'],
2556 2560
 	#force exit, frame
2557 2561
 	None, 0,
2558 2562
 	#opposite

+ 17
- 0
scripts/game.py View File

@@ -1,5 +1,20 @@
1 1
 import bge
2 2
 import FSM
3
+import requests
4
+import platform
5
+
6
+def phone_home():
7
+
8
+
9
+	#url = 'https://www.w3schools.com/python/demopage.php'
10
+	url = 'https://shuvit.org/phone_home.php'
11
+	n = platform.uname()
12
+	n = platform.platform()
13
+	myobj = {'somekey': n}
14
+
15
+	x = requests.post(url, data = myobj, timeout=3.50)
16
+	print('phone home response')
17
+	print(x.text)
3 18
 
4 19
 def main(cont):
5 20
 	own = cont.owner
@@ -8,5 +23,7 @@ def main(cont):
8 23
 		own['game_inited'] = True
9 24
 		own['cont'] = cont
10 25
 		dict['gameFSM'] = FSM.GameFSM(own)
26
+		#phone_home()
27
+
11 28
 
12 29
 	dict['gameFSM'].Execute()

+ 12
- 3
scripts/player.py View File

@@ -1,14 +1,23 @@
1 1
 import bge
2 2
 import FSM
3 3
 
4
+class Player:
5
+	def __init__(self, own):
6
+		self.owner = own
7
+		self.FSM = FSM.PlayerFSM(own)
8
+		self.walking = True
4 9
 
10
+	def update(self):
11
+		self.FSM.Execute()
5 12
 
6 13
 def update(cont):
7 14
 	#print('-------------player updating----------------')
8 15
 	dict = bge.logic.globalDict
9 16
 	own = cont.owner
10 17
 
11
-	if 'playerFSM' not in dict:
12
-		dict['playerFSM'] = FSM.PlayerFSM(own)
18
+	if 'player_class' not in dict:
19
+		#dict['playerFSM'] = FSM.PlayerFSM(own)
20
+		dict['player_class'] = Player(own)
13 21
 
14
-	dict['playerFSM'].Execute()
22
+	#dict['playerFSM'].Execute()
23
+	dict['player_class'].update()

+ 1
- 1
scripts/scene_init.py View File

@@ -134,7 +134,7 @@ def main():
134 134
         own['last_roty'] = 0.0
135 135
         
136 136
         own['walk_targ_speed'] = 2
137
-        own['walk_fast_targ_speed'] = 8
137
+        own['walk_fast_targ_speed'] = 5
138 138
         own['walk_speed'] = 0
139 139
         own['walk_inc'] = .2
140 140
         own['walk_jump_timer'] = 0

+ 278
- 277
scripts/walk.py View File

@@ -147,15 +147,15 @@ def main(cont):
147 147
     ######################################    
148 148
 
149 149
     #idle      
150
-    if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
151
-        own['requestAction'] = 'reg_idle'
152
-        if own['throw_deck'] == True:
153
-            own['requestAction'] = 'reg_idle_nb'
150
+    #if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
151
+        #own['requestAction'] = 'reg_idle'
152
+        #if own['throw_deck'] == True:
153
+            #own['requestAction'] = 'reg_idle_nb'
154 154
 
155
-    if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
156
-        own['requestAction'] = 'fak_idle'
157
-        if own['throw_deck'] == True:
158
-            own['requestAction'] = 'fak_idle_nb'
155
+    #if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
156
+        #own['requestAction'] = 'fak_idle'
157
+        #if own['throw_deck'] == True:
158
+            #own['requestAction'] = 'fak_idle_nb'
159 159
 
160 160
     if lUD < -sens:
161 161
         lup = 1
@@ -396,42 +396,43 @@ def main(cont):
396 396
                 pass
397 397
              
398 398
             if STANCE == 0:
399
-                own['requestAction'] = 'reg_offboard'             
399
+                #own['requestAction'] = 'reg_offboard'             
400 400
                 print('requesting off board')
401 401
                 
402
-            if STANCE == 1:
403
-                own['requestAction'] = 'fak_offboard'                          
402
+            #if STANCE == 1:
403
+                #own['requestAction'] = 'fak_offboard'                          
404 404
     def jump():
405
-        #limit fall speed
406
-        if linvel.z < -10:
407
-            own.linearVelocity.z = -10
408
-        if xBut == True or dict['kb_space'] == 1: 
409
-            if own['lastx'] == 0:
410
-                #killact(3)
411
-                #killact(4)
412
-                #killact(5)
413
-                #killact(6)
414
-                #killact(7)      
415
-                if STANCE == 0:  
416
-                    own['requestAction'] ='reg_jump'  
417
-                    #print('jump') 
418
-                if STANCE == 1:
419
-                    own['requestAction'] ='fak_jump'             
420
-                    #print('jump')
421
-                JUMPHEIGHT = 1100
422
-                force = [ 0.0, 0.0, JUMPHEIGHT]
423
-                # use local axis
424
-                local = False
425
-                # apply force -- limit jump speed
426
-                if linvel.z < 10:
427
-                    #own.applyForce(force, local)
428
-                    own.linearVelocity.z += 5
429
-                    own.linearVelocity.x = linvel.x
430
-                    own.linearVelocity.y = linvel.y
431
-                    own['walk_jump_timer'] = 6
432
-            own['lastx'] = 1
433
-        else:
434
-            own['lastx'] = 0  
405
+        pass
406
+        # #limit fall speed
407
+        # if linvel.z < -10:
408
+        #     own.linearVelocity.z = -10
409
+        # if xBut == True or dict['kb_space'] == 1: 
410
+        #     if own['lastx'] == 0:
411
+        #         #killact(3)
412
+        #         #killact(4)
413
+        #         #killact(5)
414
+        #         #killact(6)
415
+        #         #killact(7)      
416
+        #         if STANCE == 0:  
417
+        #             own['requestAction'] ='reg_jump'  
418
+        #             #print('jump') 
419
+        #         if STANCE == 1:
420
+        #             own['requestAction'] ='fak_jump'             
421
+        #             #print('jump')
422
+        #         JUMPHEIGHT = 1100
423
+        #         force = [ 0.0, 0.0, JUMPHEIGHT]
424
+        #         # use local axis
425
+        #         local = False
426
+        #         # apply force -- limit jump speed
427
+        #         if linvel.z < 10:
428
+        #             #own.applyForce(force, local)
429
+        #             own.linearVelocity.z += 5
430
+        #             own.linearVelocity.x = linvel.x
431
+        #             own.linearVelocity.y = linvel.y
432
+        #             own['walk_jump_timer'] = 6
433
+        #     own['lastx'] = 1
434
+        # else:
435
+        #     own['lastx'] = 0  
435 436
             
436 437
     def getonboard(dict, cont):
437 438
         grindDar = cont.sensors['grindDar2']
@@ -866,243 +867,243 @@ def main(cont):
866 867
             except:
867 868
                 pass    
868 869
                           
869
-    def switchcam():
870
-        if ltsBut == False and own['lastlts'] == True and rtsBut == False:
871
-            if own['camera'] == 1:
872
-                own['camera'] = 0
873
-            else:
874
-                own['camera'] = 1
875
-        if rtsBut == False and own['lastrts'] == True and ltsBut == False:
876
-            if own['camera'] == 2:
877
-                own['camera'] = 0
878
-            else:
879
-                own['camera'] = 2 
880
-    #followcam 
881
-    def move_followcam():
882
-        if own['camera'] == 2:
883
-            if own['lastbkBut'] == True and bkBut == False:
884
-                #print("activate move followcam") 
885
-                if own['move_followcam'] == False:
886
-                    own['move_followcam'] = True
887
-                else:
888
-                    own['move_followcam'] = False                       
889
-            if own['move_followcam'] == True:
890
-                camspeed1 = .015
891
-                camspeed2 = .055
892
-                camrot1 = .005
893
-                camrot2 = .02
894
-                #up
895
-                if lUD < -0.080:
896
-                    followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
897
-                    cont.activate(followcam.actuators["up"])
898
-                    #print("fastup")
899
-                else:
900
-                    cont.deactivate(followcam.actuators["up"])    
901
-    #            #down    
902
-                if lUD > .080:
903
-                    followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
904
-                    cont.activate(followcam.actuators["down"])
905
-                else:
906
-                    cont.deactivate(followcam.actuators["down"])                    
907
-    #            #left
908
-                #if lLR < -0.080:
909
-                if lLR > 0.080:    
910
-                    followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
911
-                    cont.activate(followcam.actuators["left"])
912
-                else:
913
-                    cont.deactivate(followcam.actuators["left"])                    
914
-    #            #right
915
-                #if lLR > 0.080: 
916
-                if lLR < -0.080:         
917
-                    followcam.actuators["right"].dLoc = [camspeed2, 0, 0]                
918
-                    cont.activate(followcam.actuators["right"])
919
-                else:
920
-                    cont.deactivate(followcam.actuators["right"])  
921
-                #up
922
-                if rUD < -0.080:
923
-                    followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
924
-                    cont.activate(followcam.actuators["rotup"])
925
-                else:
926
-                    cont.deactivate(followcam.actuators["rotup"])    
927
-    #            #down    
928
-                if rUD > .080:
929
-                    followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]                
930
-                    cont.activate(followcam.actuators["rotdown"])
931
-                else:
932
-                    cont.deactivate(followcam.actuators["rotdown"])                    
933
-    #            #left
934
-                if rLR < -0.080:
935
-                    followcam.actuators["rotleft"].dRot = [0, 0, camrot2]                
936
-                    cont.activate(followcam.actuators["rotleft"])
937
-                else:
938
-                    cont.deactivate(followcam.actuators["rotleft"])                    
939
-    #            #right
940
-                if rLR > 0.080:         
941
-                    followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
942
-                    cont.activate(followcam.actuators["rotright"])
943
-                else:
944
-                    cont.deactivate(followcam.actuators["rotright"]) 
870
+    # def switchcam():
871
+    #     if ltsBut == False and own['lastlts'] == True and rtsBut == False:
872
+    #         if own['camera'] == 1:
873
+    #             own['camera'] = 0
874
+    #         else:
875
+    #             own['camera'] = 1
876
+    #     if rtsBut == False and own['lastrts'] == True and ltsBut == False:
877
+    #         if own['camera'] == 2:
878
+    #             own['camera'] = 0
879
+    #         else:
880
+    #             own['camera'] = 2 
881
+    # #followcam 
882
+    # def move_followcam():
883
+    #     if own['camera'] == 2:
884
+    #         if own['lastbkBut'] == True and bkBut == False:
885
+    #             #print("activate move followcam") 
886
+    #             if own['move_followcam'] == False:
887
+    #                 own['move_followcam'] = True
888
+    #             else:
889
+    #                 own['move_followcam'] = False                       
890
+    #         if own['move_followcam'] == True:
891
+    #             camspeed1 = .015
892
+    #             camspeed2 = .055
893
+    #             camrot1 = .005
894
+    #             camrot2 = .02
895
+    #             #up
896
+    #             if lUD < -0.080:
897
+    #                 followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
898
+    #                 cont.activate(followcam.actuators["up"])
899
+    #                 #print("fastup")
900
+    #             else:
901
+    #                 cont.deactivate(followcam.actuators["up"])    
902
+    # #            #down    
903
+    #             if lUD > .080:
904
+    #                 followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
905
+    #                 cont.activate(followcam.actuators["down"])
906
+    #             else:
907
+    #                 cont.deactivate(followcam.actuators["down"])                    
908
+    # #            #left
909
+    #             #if lLR < -0.080:
910
+    #             if lLR > 0.080:    
911
+    #                 followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
912
+    #                 cont.activate(followcam.actuators["left"])
913
+    #             else:
914
+    #                 cont.deactivate(followcam.actuators["left"])                    
915
+    # #            #right
916
+    #             #if lLR > 0.080: 
917
+    #             if lLR < -0.080:         
918
+    #                 followcam.actuators["right"].dLoc = [camspeed2, 0, 0]                
919
+    #                 cont.activate(followcam.actuators["right"])
920
+    #             else:
921
+    #                 cont.deactivate(followcam.actuators["right"])  
922
+    #             #up
923
+    #             if rUD < -0.080:
924
+    #                 followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
925
+    #                 cont.activate(followcam.actuators["rotup"])
926
+    #             else:
927
+    #                 cont.deactivate(followcam.actuators["rotup"])    
928
+    # #            #down    
929
+    #             if rUD > .080:
930
+    #                 followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]                
931
+    #                 cont.activate(followcam.actuators["rotdown"])
932
+    #             else:
933
+    #                 cont.deactivate(followcam.actuators["rotdown"])                    
934
+    # #            #left
935
+    #             if rLR < -0.080:
936
+    #                 followcam.actuators["rotleft"].dRot = [0, 0, camrot2]                
937
+    #                 cont.activate(followcam.actuators["rotleft"])
938
+    #             else:
939
+    #                 cont.deactivate(followcam.actuators["rotleft"])                    
940
+    # #            #right
941
+    #             if rLR > 0.080:         
942
+    #                 followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
943
+    #                 cont.activate(followcam.actuators["rotright"])
944
+    #             else:
945
+    #                 cont.deactivate(followcam.actuators["rotright"]) 
945 946
 
946
-    #*********************************************                
947
+    # #*********************************************                
947 948
                     
948
-                if lUD > -0.080 and lUD < -0.030:
949
-                    followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
950
-                    cont.activate(followcam.actuators["up"])
951
-                else:
952
-                    cont.deactivate(followcam.actuators["up"])    
953
-    #            #down    
954
-                if lUD < .080 and lUD > .03:
955
-                    followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
956
-                    cont.activate(followcam.actuators["down"])
957
-                else:
958
-                    cont.deactivate(followcam.actuators["down"])                    
959
-    #            #left
960
-                if lLR > -0.080 and lLR < -0.030:
961
-                    followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
962
-                    cont.activate(followcam.actuators["left"])
963
-                else:
964
-                    cont.deactivate(followcam.actuators["left"])                    
965
-    #            #right
966
-                if lLR < .080 and lLR > .03:       
967
-                    followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
968
-                    cont.activate(followcam.actuators["right"])
969
-                else:
970
-                    cont.deactivate(followcam.actuators["right"])  
971
-                #up
972
-                if rUD > -0.080 and rUD < -0.030:
973
-                    followcam.actuators["rotup"].dRot = [camrot1, 0, 0]                
974
-                    cont.activate(followcam.actuators["rotup"])
975
-                else:
976
-                    cont.deactivate(followcam.actuators["rotup"])    
977
-    #            #down    
978
-                if rUD < .080 and rUD > .03:
979
-                    followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
980
-                    cont.activate(followcam.actuators["rotdown"])
981
-                else:
982
-                    cont.deactivate(followcam.actuators["rotdown"])                    
983
-    #            #left
984
-                if rLR > -0.080 and rLR < -0.030:
985
-                    followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
986
-                    cont.activate(followcam.actuators["rotleft"])
987
-                else:
988
-                    cont.deactivate(followcam.actuators["rotleft"])                    
989
-    #            #right
990
-                if rLR < .080 and rLR > .03:         
991
-                    followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
992
-                    cont.activate(followcam.actuators["rotright"])
993
-                else:
994
-                    cont.deactivate(followcam.actuators["rotright"])                       
995
-    def move_flycam():
996
-        if own['camera'] == 1:
997
-            if own['lastbkBut'] == True and bkBut == False: 
998
-                if own['move_freecam'] == False:
999
-                    own['move_freecam'] = True
1000
-                else:
1001
-                    own['move_freecam'] = False                       
1002
-            if own['move_freecam'] == True:
1003
-                camspeed1 = .015
1004
-                camspeed2 = .055
1005
-                camrot1 = .005
1006
-                camrot2 = .02
1007
-                #up
1008
-                if lUD < -0.080:
1009
-                    freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
1010
-                    cont.activate(freecam.actuators["up"])
1011
-                else:
1012
-                    cont.deactivate(freecam.actuators["up"])    
1013
-    #            #down    
1014
-                if lUD > .080:
1015
-                    freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
1016
-                    cont.activate(freecam.actuators["down"])
1017
-                else:
1018
-                    cont.deactivate(freecam.actuators["down"])                    
1019
-    #            #left
1020
-                if lLR < -0.080:
1021
-                    freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
1022
-                    cont.activate(freecam.actuators["left"])
1023
-                else:
1024
-                    cont.deactivate(freecam.actuators["left"])                    
1025
-    #            #right
1026
-                if lLR > 0.080:         
1027
-                    freecam.actuators["right"].dLoc = [camspeed2, 0, 0]                
1028
-                    cont.activate(freecam.actuators["right"])
1029
-                else:
1030
-                    cont.deactivate(freecam.actuators["right"])  
1031
-                #up
1032
-                if rUD < -0.080:
1033
-                    freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
1034
-                    cont.activate(freecam.actuators["rotup"])
1035
-                else:
1036
-                    cont.deactivate(freecam.actuators["rotup"])    
1037
-    #            #down    
1038
-                if rUD > .080:
1039
-                    freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]                
1040
-                    cont.activate(freecam.actuators["rotdown"])
1041
-                else:
1042
-                    cont.deactivate(freecam.actuators["rotdown"])                    
1043
-    #            #left
1044
-                if rLR < -0.080:
1045
-                    freecam.actuators["rotleft"].dRot = [0, 0, camrot2]                
1046
-                    cont.activate(freecam.actuators["rotleft"])
1047
-                else:
1048
-                    cont.deactivate(freecam.actuators["rotleft"])                    
1049
-    #            #right
1050
-                if rLR > 0.080:         
1051
-                    freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
1052
-                    cont.activate(freecam.actuators["rotright"])
1053
-                else:
1054
-                    cont.deactivate(freecam.actuators["rotright"]) 
949
+    #             if lUD > -0.080 and lUD < -0.030:
950
+    #                 followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
951
+    #                 cont.activate(followcam.actuators["up"])
952
+    #             else:
953
+    #                 cont.deactivate(followcam.actuators["up"])    
954
+    # #            #down    
955
+    #             if lUD < .080 and lUD > .03:
956
+    #                 followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
957
+    #                 cont.activate(followcam.actuators["down"])
958
+    #             else:
959
+    #                 cont.deactivate(followcam.actuators["down"])                    
960
+    # #            #left
961
+    #             if lLR > -0.080 and lLR < -0.030:
962
+    #                 followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
963
+    #                 cont.activate(followcam.actuators["left"])
964
+    #             else:
965
+    #                 cont.deactivate(followcam.actuators["left"])                    
966
+    # #            #right
967
+    #             if lLR < .080 and lLR > .03:       
968
+    #                 followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
969
+    #                 cont.activate(followcam.actuators["right"])
970
+    #             else:
971
+    #                 cont.deactivate(followcam.actuators["right"])  
972
+    #             #up
973
+    #             if rUD > -0.080 and rUD < -0.030:
974
+    #                 followcam.actuators["rotup"].dRot = [camrot1, 0, 0]                
975
+    #                 cont.activate(followcam.actuators["rotup"])
976
+    #             else:
977
+    #                 cont.deactivate(followcam.actuators["rotup"])    
978
+    # #            #down    
979
+    #             if rUD < .080 and rUD > .03:
980
+    #                 followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
981
+    #                 cont.activate(followcam.actuators["rotdown"])
982
+    #             else:
983
+    #                 cont.deactivate(followcam.actuators["rotdown"])                    
984
+    # #            #left
985
+    #             if rLR > -0.080 and rLR < -0.030:
986
+    #                 followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
987
+    #                 cont.activate(followcam.actuators["rotleft"])
988
+    #             else:
989
+    #                 cont.deactivate(followcam.actuators["rotleft"])                    
990
+    # #            #right
991
+    #             if rLR < .080 and rLR > .03:         
992
+    #                 followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
993
+    #                 cont.activate(followcam.actuators["rotright"])
994
+    #             else:
995
+    #                 cont.deactivate(followcam.actuators["rotright"])                       
996
+    # def move_flycam():
997
+    #     if own['camera'] == 1:
998
+    #         if own['lastbkBut'] == True and bkBut == False: 
999
+    #             if own['move_freecam'] == False:
1000
+    #                 own['move_freecam'] = True
1001
+    #             else:
1002
+    #                 own['move_freecam'] = False                       
1003
+    #         if own['move_freecam'] == True:
1004
+    #             camspeed1 = .015
1005
+    #             camspeed2 = .055
1006
+    #             camrot1 = .005
1007
+    #             camrot2 = .02
1008
+    #             #up
1009
+    #             if lUD < -0.080:
1010
+    #                 freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
1011
+    #                 cont.activate(freecam.actuators["up"])
1012
+    #             else:
1013
+    #                 cont.deactivate(freecam.actuators["up"])    
1014
+    # #            #down    
1015
+    #             if lUD > .080:
1016
+    #                 freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
1017
+    #                 cont.activate(freecam.actuators["down"])
1018
+    #             else:
1019
+    #                 cont.deactivate(freecam.actuators["down"])                    
1020
+    # #            #left
1021
+    #             if lLR < -0.080:
1022
+    #                 freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
1023
+    #                 cont.activate(freecam.actuators["left"])
1024
+    #             else:
1025
+    #                 cont.deactivate(freecam.actuators["left"])                    
1026
+    # #            #right
1027
+    #             if lLR > 0.080:         
1028
+    #                 freecam.actuators["right"].dLoc = [camspeed2, 0, 0]                
1029
+    #                 cont.activate(freecam.actuators["right"])
1030
+    #             else:
1031
+    #                 cont.deactivate(freecam.actuators["right"])  
1032
+    #             #up
1033
+    #             if rUD < -0.080:
1034
+    #                 freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
1035
+    #                 cont.activate(freecam.actuators["rotup"])
1036
+    #             else:
1037
+    #                 cont.deactivate(freecam.actuators["rotup"])    
1038
+    # #            #down    
1039
+    #             if rUD > .080:
1040
+    #                 freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]                
1041
+    #                 cont.activate(freecam.actuators["rotdown"])
1042
+    #             else:
1043
+    #                 cont.deactivate(freecam.actuators["rotdown"])                    
1044
+    # #            #left
1045
+    #             if rLR < -0.080:
1046
+    #                 freecam.actuators["rotleft"].dRot = [0, 0, camrot2]                
1047
+    #                 cont.activate(freecam.actuators["rotleft"])
1048
+    #             else:
1049
+    #                 cont.deactivate(freecam.actuators["rotleft"])                    
1050
+    # #            #right
1051
+    #             if rLR > 0.080:         
1052
+    #                 freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
1053
+    #                 cont.activate(freecam.actuators["rotright"])
1054
+    #             else:
1055
+    #                 cont.deactivate(freecam.actuators["rotright"]) 
1055 1056
 
1056
-    #*********************************************                
1057
+    # #*********************************************                
1057 1058
                     
1058
-                if lUD > -0.080 and lUD < -0.030:
1059
-                    freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
1060
-                    cont.activate(freecam.actuators["up"])
1061
-                    #print(lUD)
1062
-                else:
1063
-                    cont.deactivate(freecam.actuators["up"])    
1064
-    #            #down    
1065
-                if lUD < .080 and lUD > .03:
1066
-                    freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
1067
-                    cont.activate(freecam.actuators["down"])
1068
-                else:
1069
-                    cont.deactivate(freecam.actuators["down"])                    
1070
-    #            #left
1071
-                if lLR > -0.080 and lLR < -0.030:
1072
-                    freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
1073
-                    cont.activate(freecam.actuators["left"])
1074
-                else:
1075
-                    cont.deactivate(freecam.actuators["left"])                    
1076
-    #            #right
1077
-                if lLR < .080 and lLR > .03:       
1078
-                    freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
1079
-                    cont.activate(freecam.actuators["right"])
1080
-                else:
1081
-                    cont.deactivate(freecam.actuators["right"])  
1082
-                #up
1083
-                if rUD > -0.080 and rUD < -0.030:
1084
-                    freecam.actuators["rotup"].dRot = [camrot1, 0, 0]                
1085
-                    cont.activate(freecam.actuators["rotup"])
1086
-                else:
1087
-                    cont.deactivate(freecam.actuators["rotup"])    
1088
-    #            #down    
1089
-                if rUD < .080 and rUD > .03:
1090
-                    freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
1091
-                    cont.activate(freecam.actuators["rotdown"])
1092
-                else:
1093
-                    cont.deactivate(freecam.actuators["rotdown"])                    
1094
-    #            #left
1095
-                if rLR > -0.080 and rLR < -0.030:
1096
-                    freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
1097
-                    cont.activate(freecam.actuators["rotleft"])
1098
-                else:
1099
-                    cont.deactivate(freecam.actuators["rotleft"])                    
1100
-    #            #right
1101
-                if rLR < .080 and rLR > .03:         
1102
-                    freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
1103
-                    cont.activate(freecam.actuators["rotright"])
1104
-                else:
1105
-                    cont.deactivate(freecam.actuators["rotright"])                     
1059
+    #             if lUD > -0.080 and lUD < -0.030:
1060
+    #                 freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
1061
+    #                 cont.activate(freecam.actuators["up"])
1062
+    #                 #print(lUD)
1063
+    #             else:
1064
+    #                 cont.deactivate(freecam.actuators["up"])    
1065
+    # #            #down    
1066
+    #             if lUD < .080 and lUD > .03:
1067
+    #                 freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
1068
+    #                 cont.activate(freecam.actuators["down"])
1069
+    #             else:
1070
+    #                 cont.deactivate(freecam.actuators["down"])                    
1071
+    # #            #left
1072
+    #             if lLR > -0.080 and lLR < -0.030:
1073
+    #                 freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
1074
+    #                 cont.activate(freecam.actuators["left"])
1075
+    #             else:
1076
+    #                 cont.deactivate(freecam.actuators["left"])                    
1077
+    # #            #right
1078
+    #             if lLR < .080 and lLR > .03:       
1079
+    #                 freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
1080
+    #                 cont.activate(freecam.actuators["right"])
1081
+    #             else:
1082
+    #                 cont.deactivate(freecam.actuators["right"])  
1083
+    #             #up
1084
+    #             if rUD > -0.080 and rUD < -0.030:
1085
+    #                 freecam.actuators["rotup"].dRot = [camrot1, 0, 0]                
1086
+    #                 cont.activate(freecam.actuators["rotup"])
1087
+    #             else:
1088
+    #                 cont.deactivate(freecam.actuators["rotup"])    
1089
+    # #            #down    
1090
+    #             if rUD < .080 and rUD > .03:
1091
+    #                 freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
1092
+    #                 cont.activate(freecam.actuators["rotdown"])
1093
+    #             else:
1094
+    #                 cont.deactivate(freecam.actuators["rotdown"])                    
1095
+    # #            #left
1096
+    #             if rLR > -0.080 and rLR < -0.030:
1097
+    #                 freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
1098
+    #                 cont.activate(freecam.actuators["rotleft"])
1099
+    #             else:
1100
+    #                 cont.deactivate(freecam.actuators["rotleft"])                    
1101
+    # #            #right
1102
+    #             if rLR < .080 and rLR > .03:         
1103
+    #                 freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
1104
+    #                 cont.activate(freecam.actuators["rotright"])
1105
+    #             else:
1106
+    #                 cont.deactivate(freecam.actuators["rotright"])                     
1106 1107
     if r_ground.triggered == False:
1107 1108
         cont.deactivate(own.actuators["walk_align"])
1108 1109
     else:
@@ -1285,9 +1286,9 @@ def main(cont):
1285 1286
     checkidle()
1286 1287
     
1287 1288
     reset_pos()
1288
-    switchcam()
1289
-    move_flycam()
1290
-    move_followcam()
1289
+    #switchcam()
1290
+    #move_flycam()
1291
+    #move_followcam()
1291 1292
     fall()
1292 1293
     idle_anim()
1293 1294
     sit()

+ 2
- 2
shuvit.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:3e55e2945a5c427472ecf717882c96dd7bf317495661bea9907d5694d73498f0
3
-size 117686772
2
+oid sha256:3b52a239858b1ced5475be1a026f55c1b06e79f4dea68924729da312be6ef19c
3
+size 121784228

+ 0
- 3
shuvit_t.blend View File

@@ -1,3 +0,0 @@
1
-version https://git-lfs.github.com/spec/v1
2
-oid sha256:0ea5fc351cf8bfe6bca856c317d5391c4c5c0e3b5e6373f4acb7838f232b72b5
3
-size 117695636

Loading…
Cancel
Save