|
@@ -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()
|