Browse Source

char loading

shuvit 5 years ago
parent
commit
0e290c3f6b
8 changed files with 167 additions and 41 deletions
  1. 6
    4
      Settings.py
  2. 57
    19
      co_ActionState.py
  3. 24
    4
      grindV2.py
  4. 25
    0
      load_char.py
  5. 26
    4
      menuV3.py
  6. 4
    1
      music_player.py
  7. 18
    4
      scene_init.py
  8. 7
    5
      walk.py

+ 6
- 4
Settings.py View File

@@ -24,8 +24,8 @@ def readSettings():
24 24
         #print lines[29]
25 25
         reading.close()
26 26
 
27
-    own["val"] = int(data[1])
28
-    own["bright"] = int(data[1])
27
+    #own["val"] = int(data[1])
28
+    #own["bright"] = int(data[1])
29 29
     own["playerName"] = data[4]
30 30
     #own["audio"] = int(data[3])
31 31
     own["level"] = data[5]
@@ -53,7 +53,9 @@ def readSettings():
53 53
     #dict = bge.logic.globalDict
54 54
     dict['recorder_on'] = recorder_on
55 55
     own['recorder_on'] = recorder_on
56
-    dict['recorder_on'] = recorder_on  
56
+    dict['recorder_on'] = recorder_on 
57
+    character = data[1]
58
+    dict["character"] = str(character.split(None, 1)[0])
57 59
     dict["shirt_color_r"] = float(data[16])
58 60
     dict["shirt_color_g"] = float(data[17])
59 61
     dict["shirt_color_b"] = float(data[18])
@@ -103,7 +105,7 @@ def writeSettings():
103 105
     print("writing called")
104 106
     with open(fileName, 'w') as writing:
105 107
         writing.write(str("//settings.dat")+"\n")
106
-        writing.write(str(own["val"])+"\n")
108
+        writing.write(str(dict["character"])+"\n")
107 109
         writing.write(str(own["bright"])+"\n")
108 110
         writing.write(str("-\n"))
109 111
         writing.write(str("//level (e.g. spine, city, city2)")+"\n")

+ 57
- 19
co_ActionState.py View File

@@ -80,11 +80,11 @@ def main():
80 80
         own['requestAction'] = 'empty'              
81 81
 #================
82 82
     #stance change detection
83
-    if (requestAction == 'reg_roll' and l_actionState in ('fak_roll', 'fak_land', 'fak_pump_out', 'fak_nopos_out', 'fak_opos_out', 'fak_air-roll', 'fak_fs_powerslide_out', 'fak_bs_powerslide_out', 'fak_nmanual_out', 'fak_manual_out')) or l_actionState == 'fak_land' and (requestAction == 'reg_turnLeft' or requestAction == 'reg_turnRight' or requestAction == 'reg_turnLeft_out' or requestAction == 'reg_turnRight_out' or requestAction == 'reg_opos' or requestAction == 'reg_nopos' or requestAction == 'reg_pump' or requestAction == 'reg_push' or requestAction == 'reg_push_goof' or requestAction == 'fak_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('reg_turnLeft', 'reg_turnRight') and l_actionState in ('fak_turnLeft', 'fak_turnRight')):
83
+    if (requestAction == 'reg_roll' and l_actionState in ('fak_roll', 'fak_land', 'fak_pump_out', 'fak_nopos_out', 'fak_opos_out', 'fak_air-roll', 'fak_fs_powerslide_out', 'fak_bs_powerslide_out', 'fak_nmanual_out', 'fak_manual_out', 'fak_tailslide_out', 'fak_noseslide_out', 'fak_5050_out')) or l_actionState == 'fak_land' and (requestAction == 'reg_turnLeft' or requestAction == 'reg_turnRight' or requestAction == 'reg_turnLeft_out' or requestAction == 'reg_turnRight_out' or requestAction == 'reg_opos' or requestAction == 'reg_nopos' or requestAction == 'reg_pump' or requestAction == 'reg_push' or requestAction == 'reg_push_goof' or requestAction == 'fak_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('reg_turnLeft', 'reg_turnRight') and l_actionState in ('fak_turnLeft', 'fak_turnRight')):
84 84
         #print("fak-reg_roll")
85 85
         requestAction = 'fak-reg_roll'
86 86
         own['requestAction'] = 'fak-reg_roll' 
87
-    if (requestAction == 'fak_roll' and l_actionState in ('reg_roll', 'reg_land', 'reg_pump_out', 'reg_nopos_out', 'reg_opos_out', 'reg_air-roll', 'reg_fs_powerslide_out', 'reg_bs_powerslide_out', 'reg_nmanual_out', 'reg_manual_out')) or l_actionState == 'reg_land' and (requestAction == 'fak_turnLeft' or requestAction == 'fak_turnRight' or requestAction == 'fak_turnLeft_out' or requestAction == 'fak_turnRight_out' or requestAction == 'fak_opos' or requestAction == 'fak_nopos' or requestAction == 'fak_pump' or requestAction == 'fak_push' or requestAction == 'reg_push_goof' or requestAction == 'reg_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('fak_turnLeft', 'fak_turnRight') and l_actionState in ('reg_turnLeft', 'reg_turnRight')):
87
+    if (requestAction == 'fak_roll' and l_actionState in ('reg_roll', 'reg_land', 'reg_pump_out', 'reg_nopos_out', 'reg_opos_out', 'reg_air-roll', 'reg_fs_powerslide_out', 'reg_bs_powerslide_out', 'reg_nmanual_out', 'reg_manual_out', 'reg_tailslide_out', 'reg_noseslide_out', 'reg_5050_out')) or l_actionState == 'reg_land' and (requestAction == 'fak_turnLeft' or requestAction == 'fak_turnRight' or requestAction == 'fak_turnLeft_out' or requestAction == 'fak_turnRight_out' or requestAction == 'fak_opos' or requestAction == 'fak_nopos' or requestAction == 'fak_pump' or requestAction == 'fak_push' or requestAction == 'reg_push_goof' or requestAction == 'reg_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('fak_turnLeft', 'fak_turnRight') and l_actionState in ('reg_turnLeft', 'reg_turnRight')):
88 88
         #print("reg-fak_roll")
89 89
         requestAction = 'reg-fak_roll'
90 90
         own['requestAction'] = 'reg-fak_roll'
@@ -157,7 +157,20 @@ def main():
157 157
     if 'invert' in requestAction:
158 158
         actionTimer = 0
159 159
         own['actionTimer'] = 0    
160
-            
160
+    
161
+    
162
+    #dirty stall fix
163
+    fixer = 0
164
+    if requestAction in ['reg_5050', 'reg_tailslide', 'reg_noseslide'] and actionState in ['reg_pump_out', 'fak_nopos_out'] and actionTimer > 10:
165
+        fixer = 1 
166
+    if requestAction in ['fak_5050', 'fak_tailslide', 'fak_noseslide'] and actionState in ['fak_pump_out', 'fak_nopos_out'] and actionTimer > 10:
167
+        fixer = 1             
168
+        
169
+    if fixer == 1:    
170
+        actionTimer = 0
171
+        own['actionTimer'] = 0  
172
+        stopActs()              
173
+    
161 174
     #grind override
162 175
 #    if requestAction in pump_out_overList and requestAction != l_requestAction and l_actionState not in jump_overrideList:
163 176
 #            skater.stopAction(loop_layer)
@@ -200,7 +213,8 @@ def main():
200 213
                 requestAction = 'reg_turnRight_out'
201 214
                 actionState = 'reg_turnRight_out'
202 215
             elif requestAction == 'reg_pump_right':
203
-                requestAction = 'reg_right-pump'    
216
+                requestAction = 'reg_right-pump' 
217
+                   
204 218
         if l_actionState == 'reg_turnLeft':
205 219
             if requestAction not in ['reg_turnLeft', 'reg_pump_left', 'reg_pump']:
206 220
                 requestAction = 'reg_turnLeft_out'
@@ -251,10 +265,12 @@ def main():
251 265
             actionState = 'fak_pump_right-right'                        
252 266
             
253 267
 #**********************************            
254
-        if l_actionState == 'reg_pump' and requestAction not in ['reg_pump', 'reg_pump_left', 'reg_pump_right'] and requestAction not in pump_out_overList:
268
+        if l_actionState == 'reg_pump' and requestAction not in ['reg_pump', 'reg_pump_left', 'reg_pump_right', 'reg_5050'] and requestAction not in pump_out_overList:
255 269
             requestAction = 'reg_pump_out'
256 270
             actionState = 'reg_pump_out' 
257
-            
271
+        if l_actionState == 'reg_pump' and requestAction == 'reg_5050':
272
+            requestAction = 'reg_5050'
273
+            actionState = 'reg_5050'    
258 274
         if l_actionState == 'fak_pump' and requestAction not in ['fak_pump', 'fak_pump_right', 'fak_pump_left'] and requestAction not in pump_out_overList:
259 275
             requestAction = 'fak_pump_out'
260 276
             actionState = 'fak_pump_out'            
@@ -577,8 +593,8 @@ def main():
577 593
             actionState = 'reg_pump_right-rightb' 
578 594
             
579 595
         if l_actionState == 'reg_pump_right-rightb' and requestAction == 'reg_roll':
580
-            requestAction = 'reg_turnRight_out'
581
-            actionState = 'reg_turnRight_out'
596
+            requestAction = 'reg_turnRight'
597
+            actionState = 'reg_turnRight'
582 598
             
583 599
         if l_actionState == 'reg_right-pump' and requestAction == 'reg_roll':
584 600
             requestAction = 'reg_pump_out'
@@ -717,7 +733,23 @@ def main():
717 733
             requestAction = 'reg_air-roll'              
718 734
             
719 735
             
736
+        if l_actionState == 'reg_land' and requestAction in ['reg_pump_left', 'reg_pump_right']:
737
+            requestAction = 'reg_pump_in'
738
+        if l_actionState == 'fak_land' and requestAction in ['fak_pump_left', 'fak_pump_right']:
739
+            requestAction = 'fak_pump_in'  
740
+        
741
+        if l_actionState in ['reg_pump_right', 'reg_pump_left'] and requestAction == 'reg_roll':
742
+            requestAction = 'reg_pump_out'        
743
+        if l_actionState in ['fak_pump_right', 'fak_pump_left'] and requestAction == 'fak_roll':
744
+            requestAction = 'fak_pump_out'     
745
+        if l_actionState in ['reg_left-pump', 'reg_right-pump'] and requestAction == 'reg_roll':
746
+            requestAction = 'reg_pump_out' 
747
+        if l_actionState in ['fak_left-pump', 'fak_right-pump'] and requestAction == 'reg_roll':
748
+            requestAction = 'fak_pump_out' 
720 749
             
750
+        if l_actionState in ['reg_pump_right-rightb'] and requestAction == 'reg_roll':
751
+            requestAction = 'reg_right_out'
752
+            print('asd;fjas;fjas;fkjs;fkjsa;kfjs;afkjs;dkfjs;fkjas;dkfjs;fj')                                
721 753
             
722 754
 #        if (l_actionState == 'fak_air-roll' and requestAction == 'fak_manual'):
723 755
 #            actionTimer = 0
@@ -790,19 +822,21 @@ def main():
790 822
                 trucks.playAction("a_fak_dropin", 60,80, layer=trans_layer, play_mode=0, speed=.75)    
791 823
 
792 824
             if requestAction == 'reg_turnRight_out':
793
-                stopActs()
825
+                #stopActs()
794 826
                 actionState = 'reg_turnRight_out'
795 827
                 own['actionTimer'] = 19
796 828
                 trans_playing = skater.isPlayingAction(trans_layer)
797 829
                 if trans_playing:
798 830
                     cur_frame = skater.getActionFrame(trans_layer)
799 831
                                   
800
-                if trans_playing and cur_frame > .5:                
832
+                if trans_playing and cur_frame > .5 and cur_frame < 39:                
801 833
                     skater.playAction("nreg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
802 834
                     deck.playAction("a_reg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
803 835
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
804
-                    own['actionTimer'] = (10 - cur_frame) 
805
-                else:                      
836
+                    #own['actionTimer'] = (10 - cur_frame) 
837
+                    own['actionTimer'] = cur_frame
838
+                else:        
839
+                    print('play from start', trans_playing)              
806 840
                     skater.playAction("nreg_right", 10,1, layer=trans_layer, play_mode=0, speed=.5)
807 841
                     deck.playAction("a_reg_right", 10,1, layer=trans_layer, play_mode=0, speed=.5)
808 842
                     trucks.playAction("a_reg", 10,1, layer=trans_layer, play_mode=0, speed=.5)                   
@@ -881,6 +915,7 @@ def main():
881 915
                 
882 916
             if requestAction == 'fak_pump_right-right':
883 917
                 actionState = 'fak_pump_right-right'
918
+                own['actionState'] = 'fak_pump_right-right'
884 919
                 own['actionTimer'] = 19
885 920
                     
886 921
                 skater.playAction("nfak_pump_right", 40,30, layer=trans_layer, play_mode=0, speed=.5)
@@ -891,7 +926,8 @@ def main():
891 926
      
892 927
             if requestAction == 'reg_pump_right-rightb':
893 928
                 actionState = 'reg_pump_right-rightb'
894
-                own['actionTimer'] = 19
929
+                own['actionState'] = 'reg_pump_right-rightb'
930
+                own['actionTimer'] = 20
895 931
                     
896 932
                 skater.playAction("nreg_pump_right", 30,40, layer=trans_layer, play_mode=0, speed=.5)
897 933
                 deck.playAction("a_reg_right", 10,10, layer=trans_layer, play_mode=0, speed=.5)
@@ -951,7 +987,7 @@ def main():
951 987
                 trans_playing = skater.isPlayingAction(trans_layer)
952 988
                 if trans_playing:
953 989
                     cur_frame = skater.getActionFrame(trans_layer)
954
-                if trans_playing and cur_frame > .5:                
990
+                if trans_playing and cur_frame > .5 and cur_frame < 38:                
955 991
                     skater.playAction("nreg_pump_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
956 992
                     deck.playAction("a_reg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
957 993
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
@@ -2679,7 +2715,7 @@ def main():
2679 2715
                 skater.playAction('reg_fak_nosegr', 10,1, layer=trans_layer, play_mode=0, speed=1)
2680 2716
                 deck.playAction('a_reg_nosegR', 10,10, layer=trans_layer, play_mode=0, speed=1)
2681 2717
                 trucks.playAction('a_reg_nosegR', 10,10, layer=trans_layer, play_mode=0, speed=1)                                                
2682
-
2718
+        own['actionState'] = actionState
2683 2719
    
2684 2720
 #######################################        
2685 2721
         #loop actions 
@@ -2860,7 +2896,8 @@ def main():
2860 2896
                         deck.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2861 2897
                         trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2862 2898
                         #print(cur_frame)
2863
-                    else:    
2899
+                    else:   
2900
+                        own['actionTimer'] = 20 
2864 2901
                         skater.playAction("nreg_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=1)
2865 2902
                         deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
2866 2903
                         trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
@@ -2967,7 +3004,8 @@ def main():
2967 3004
                         skater.playAction("nfak_pump_in", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2968 3005
                         deck.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2969 3006
                         trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2970
-                    else:    
3007
+                    else:   
3008
+                        own['actionTimer'] = 20 
2971 3009
                         skater.playAction("nfak_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=1)
2972 3010
                         deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
2973 3011
                         trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
@@ -4266,8 +4304,8 @@ def main():
4266 4304
     if trans_playing:
4267 4305
         cur_frame = skater.getActionFrame(trans_layer)  
4268 4306
         cur_frame = round(cur_frame, 2)     
4269
-    #print("oG: ", og_request, "rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
4270
-    print("rA:", requestAction, "|aS:", own['actionState'], own['actionTimer'], 'cf', cur_frame)
4307
+    print("oG: ", og_request, "rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
4308
+    #print("rA:", requestAction, "|aS:", own['actionState'], own['actionTimer'], 'cf', cur_frame)
4271 4309
     cur_frame = skater.getActionFrame(trans_layer)
4272 4310
     #print(cur_frame)
4273 4311
     def printplaying():

+ 24
- 4
grindV2.py View File

@@ -43,7 +43,7 @@ def main():
43 43
     #print(roty)
44 44
     roty = abs(roty) 
45 45
     sub = 0
46
-    align_strength = .3
46
+    align_strength = .1#.3
47 47
     align_strength2 = .2
48 48
     touched = grindTouch.triggered
49 49
     lgf = own['last_grind_frame']
@@ -224,7 +224,7 @@ def main():
224 224
 
225 225
         #z align
226 226
         #print("zalign") 
227
-        stre = .15
227
+        stre = .15#.075#.15
228 228
         player.alignAxisToVect(grinder_vectz, 2, stre)                                                  
229 229
         
230 230
         if rot >= 0 and rot < 45:
@@ -652,10 +652,29 @@ def main():
652 652
         except:
653 653
             pass    
654 654
     if ray.triggered == False:
655
-        own["nogrindsound"] = 1                               
655
+        own["nogrindsound"] = 1 
656
+    def slow_roty():
657
+      #print(abs(roty - own['last_roty']))
658
+      #print(roty)                
659
+      
660
+      #if roted > 5:
661
+        #pass
662
+        #align slow  
663
+        constraint = cont.actuators['gConstraint']
664
+        if (own['framenum'] - own['grind_start_frame'] < 40) and touched == 1:
665
+          #print('limit rot')              
666
+          #constraint.damp = 80
667
+        #else:
668
+          #constraint.damp = 30
669
+        #constraint.rotDamp = 80
670
+            cont.activate(constraint) 
671
+        else:
672
+            cont.deactivate(constraint)      
656 673
     timer()    
657 674
     aligntimer()
658
-    stop_bounce()   
675
+    stop_bounce() 
676
+    slow_roty()
677
+      
659 678
                    
660 679
     own['grindOld'] = grindold 
661 680
     own['test'] = test
@@ -665,6 +684,7 @@ def main():
665 684
     own['grindTouch'] = grindTouch.triggered
666 685
     own["grindDar_timer"] = grindDar_timer
667 686
     own["last_grindDar"] = last_grindDar
687
+    own['last_roty'] = roty
668 688
     linVelocity3 = own.getLinearVelocity(True)
669 689
     set_pregrind_vel()
670 690
     own['last_z'] = own.worldPosition.z

+ 25
- 0
load_char.py View File

@@ -0,0 +1,25 @@
1
+
2
+import bge
3
+
4
+
5
+
6
+def main(cont):
7
+    own = cont.owner
8
+    scene = bge.logic.getCurrentScene()
9
+    actu = cont.actuators['start_level']
10
+    dict = bge.logic.globalDict
11
+    mainDir = bge.logic.expandPath("//")
12
+    
13
+    fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
14
+    
15
+    path = bge.logic.expandPath(fileName)
16
+    bge.logic.LibLoad(path, 'Scene')  
17
+    
18
+    
19
+#    fileName = mainDir + "characters/sun.blend"    
20
+#    
21
+#    path = bge.logic.expandPath(fileName)
22
+#    bge.logic.LibLoad(path, 'Scene')      
23
+
24
+
25
+    cont.activate(actu)

+ 26
- 4
menuV3.py View File

@@ -2,6 +2,7 @@ import bge
2 2
 keyboard = bge.logic.keyboard
3 3
 JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
4 4
 
5
+player_list = ['annie', 'billy', 'fred', 'becky', 'kevin', 'ralph']               
5 6
 
6 7
 #exit functions
7 8
 #=======
@@ -575,7 +576,23 @@ def endpoint(funct, motion, dict, cont):
575 576
             dict['reload_timer'] = 250
576 577
             dict['overlay_fadein'] = 1              
577 578
                                          
578
-                                         
579
+    if funct in player_list:
580
+        if motion == 'inc':
581
+            dict['character'] = funct
582
+            Settings.writeSettings()
583
+            Settings.readSettings()
584
+            dict['load_timer'] = load_timer
585
+            dict['reload_timer'] = 250
586
+            dict['overlay_fadein'] = 1  
587
+            
588
+#    if funct == 'billy':
589
+#        if motion == 'inc':
590
+#            dict['character'] = 'billy'
591
+#            Settings.writeSettings()
592
+#            Settings.readSettings()
593
+#            dict['load_timer'] = load_timer
594
+#            dict['reload_timer'] = 250
595
+#            dict['overlay_fadein'] = 1                                                       
579 596
 #'1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen'                            
580 597
     if funct == '1920x1080':
581 598
         #pass
@@ -661,7 +678,7 @@ def get_c_list(dict):
661 678
     if dict['mlevel'] == 2:
662 679
         if dict['lv1_opt'] == 'player':
663 680
         #if opt == 'settings':
664
-            dict['current_list'] = ['shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo']            
681
+            dict['current_list'] = ['character', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo']            
665 682
 
666 683
     if dict['mlevel'] == 2:
667 684
         if dict['lv1_opt'] == 'level':
@@ -685,7 +702,10 @@ def get_c_list(dict):
685 702
         if dict['lv2_opt'] == 'dof':
686 703
             dict['current_list'] = ['dof on']  
687 704
         if dict['lv2_opt'] == 'bloom':
688
-            dict['current_list'] = ['bloom on']                
705
+            dict['current_list'] = ['bloom on']  
706
+            
707
+        if dict['lv2_opt'] == 'character':
708
+            dict['current_list'] = player_list   
689 709
 
690 710
 def get_inputs(dict, cont):
691 711
     import aud
@@ -812,7 +832,7 @@ def init(own, dict):
812 832
     dict['mlevel'] = 0
813 833
     dict['current_opt'] = ''
814 834
     dict['pause_menu_text'] = ''
815
-    dict['menu_end_points'] = ['exit', 'restart', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo', 'brightness / contrast on', 'brightness value', 'contrast value', 'hdr on', 'avgL', 'hdr strength', 'ao on', 'ao radius', 'ao width', 'ao only', 'dof on', 'sun strength', 'sun rot x', 'sun rot y', 'shadow on', 'ambient strength', 'Demo Scene', 'Empty Lot', 'Park A', 'Training', 'Spine', 'Warehouse', 'Shop', '1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen', 'bloom on', 'cam height', 'focal length', 'min dist', 'max dist', 'enter replay', 'recorder on', 'record length', 'enter replay (press back button)', 'recorder on', 'record length (n/a)', 'physics']
835
+    dict['menu_end_points'] = ['exit', 'restart', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo', 'brightness / contrast on', 'brightness value', 'contrast value', 'hdr on', 'avgL', 'hdr strength', 'ao on', 'ao radius', 'ao width', 'ao only', 'dof on', 'sun strength', 'sun rot x', 'sun rot y', 'shadow on', 'ambient strength', 'Demo Scene', 'Empty Lot', 'Park A', 'Training', 'Spine', 'Warehouse', 'Shop', '1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen', 'bloom on', 'cam height', 'focal length', 'min dist', 'max dist', 'enter replay', 'recorder on', 'record length', 'enter replay (press back button)', 'recorder on', 'record length (n/a)', 'physics',] + player_list
816 836
     
817 837
 def output(dict):
818 838
     try:
@@ -918,6 +938,8 @@ def output(dict):
918 938
             outp = outp + '(2.4): ' + str(dict['cam_max'])  
919 939
         if dict['current_opt'] ==  'recorder on':
920 940
             outp = outp + ': ' + str(dict['recorder_on']) 
941
+#        if dict['current_opt'] ==  'character':
942
+#            outp = outp + ': ' + str(dict['character'])             
921 943
                                 
922 944
             
923 945
     dict['pause_menu_text'] = outp

+ 4
- 1
music_player.py View File

@@ -97,10 +97,13 @@ def previous_track():
97 97
 def initer(cont):
98 98
     #cont = bge.logic.getCurrentController()
99 99
     own = cont.owner
100
+    dict = bge.logic.globalDict
101
+    if 'playback' not in dict:
102
+        dict['playback'] = True
100 103
     if 'mp_inited' not in own:
101 104
         own['mp_inited'] = True
102 105
         print('Initializing music player')
103
-        dict = bge.logic.globalDict
106
+        
104 107
         file_list = os.listdir(directory) 
105 108
         dict['mu_lib'] = file_list
106 109
         dict['mu_playlist'] = file_list

+ 18
- 4
scene_init.py View File

@@ -3,6 +3,7 @@ import bge
3 3
 
4 4
 def main():
5 5
     import bge
6
+    #import GameLogic
6 7
     cont = bge.logic.getCurrentController()
7 8
     own = cont.owner
8 9
     dict = bge.logic.globalDict
@@ -23,9 +24,21 @@ def main():
23 24
     scenes = bge.logic.getSceneList()
24 25
     own['pre_pause_linvel'] = 0.0
25 26
     #own['last_roll_frame'] = 0
26
-    
27
-    
28
-    
27
+  
28
+
29
+    objList = scene.objects
30
+
31
+    # get object named MainCharacter
32
+    parent = objList["control_cube.002"]
33
+
34
+    # combine child's shape with parent's
35
+    compound = True
36
+    obj = scene.objects['Char4']
37
+    # child is solid
38
+    ghost = False
39
+    # set parent
40
+    obj.setParent( parent, compound, ghost)  
41
+  
29 42
     
30 43
     for i in scenes:
31 44
         if i.name == "main":
@@ -159,5 +172,6 @@ def main():
159 172
     own['transition_timer'] = 0
160 173
     own['transitioning'] = 0
161 174
     own['driving'] = False
162
-           
175
+    own['last_roty'] = 0.0
176
+       
163 177
 main()

+ 7
- 5
walk.py View File

@@ -61,7 +61,7 @@ dropinCol = own.sensors['dropinCol']
61 61
 skater = scene.objects["Char4"]
62 62
 deck = scene.objects["deck"]
63 63
 trucks = scene.objects["trucks"]
64
-
64
+camobj = scene.objects['camobj']
65 65
 throw_deck_empty = scene.objects["throw_deck_empty"]
66 66
 wheel1 = scene.objects["rollen.000"]
67 67
 wheel2 = scene.objects["rollen.001"]
@@ -303,9 +303,9 @@ else:
303 303
     cont.deactivate(camobj.actuators['camUp'])     
304 304
                 
305 305
 #----------------
306
-camera.height = .9 #-.4
307
-camera.min = 1.5
308
-camera.max = 2
306
+camera.height = .01 #.9
307
+camera.min = 1.75
308
+camera.max = 2.25
309 309
 lasty = own['lasty']     
310 310
 
311 311
 def onboard():
@@ -323,7 +323,9 @@ def onboard():
323 323
         own['grindrail_vol'] = 0
324 324
         own['grindrail_pitch'] = 0 
325 325
         own['sroll_vol'] = 0
326
-        own['sroll_pitch'] = 0                 
326
+        own['sroll_pitch'] = 0   
327
+        
328
+        #camobj.worldPosition.z += 4              
327 329
         try:
328 330
             vel = own['offboard_vel']
329 331
             vel = [velx, vel.y, vel.z]           

Loading…
Cancel
Save