Shuvit game master repo. http://shuvit.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

walk.py 44KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  1. #shuvit.org
  2. #walk.py
  3. import bge
  4. import GameLogic
  5. import ctypes
  6. import random
  7. import math
  8. scene = bge.logic.getCurrentScene()
  9. objList = scene.objects
  10. cont = GameLogic.getCurrentController()
  11. obj = bge.logic.getCurrentScene().objects
  12. char = bge.constraints.getCharacter
  13. own = cont.owner
  14. stance = own['stance']
  15. STANCE = own['stance']
  16. r_ground = cont.sensors["r_Ground"]
  17. linvel = own.getLinearVelocity(True)
  18. lasta = own['lasta']
  19. lastx = own['lastx']
  20. last_sit = own['sit']
  21. dict = bge.logic.globalDict
  22. try:
  23. own['walk_timer'] = own['walk_timer'] +1
  24. except:
  25. own['walk_timer'] = 1
  26. truckon = 450
  27. deckon = 460
  28. lLR = dict['lLR']
  29. lUD = dict['lUD']
  30. rLR = dict['rLR']
  31. rUD = dict['rUD']
  32. lTrig = dict['lTrig']
  33. rTrig = dict['rTrig']
  34. aBut = dict['aBut']
  35. bBut = dict['bBut']
  36. xBut = dict['xBut']
  37. yBut = dict['yBut']
  38. lBump = dict['lBump']
  39. rBump = dict['rBump']
  40. bkBut = dict['bkBut']
  41. stBut = dict['stBut']
  42. xbBut = dict['xbBut']
  43. ltsBut = dict['ltsBut']
  44. rtsBut = dict['rtsBut']
  45. ldPad = dict['ldPad']
  46. rdPad = dict['rdPad']
  47. udPad = dict['udPad']
  48. ddPad = dict['ddPad']
  49. #user
  50. sens = .04
  51. fliplay = 30
  52. dropinCol = own.sensors['dropinCol']
  53. cube = scene.objects['control_cube.002']
  54. skater = scene.objects["Char4"]
  55. deck = scene.objects["deck"]
  56. trucks = scene.objects["trucks"]
  57. camobj2 = scene.objects['camobj']
  58. throw_deck_empty = scene.objects["throw_deck_empty"]
  59. wheel1 = scene.objects["rollen.000"]
  60. wheel2 = scene.objects["rollen.001"]
  61. wheel3 = scene.objects["rollen.002"]
  62. wheel4 = scene.objects["rollen.003"]
  63. camobj = scene.objects["Camera.003"]
  64. camera = cont.actuators["Camera"]
  65. replayCam = cont.actuators["replayCam"]
  66. timer = own['dropinTimer']
  67. cam = scene.objects["Camera.003"]
  68. freecam = scene.objects["freecam"]
  69. followcam = scene.objects["followcam"]
  70. control_bottom = scene.objects['control_bottom']
  71. cb = control_bottom.sensors['grindCol_bottom']
  72. cb_td = control_bottom.sensors['td_bottom']
  73. noidle = 0
  74. #if skater.isPlayingAction(460):
  75. # noidle = 1
  76. if own["stance"] == None:
  77. own["stance"] = True
  78. STANCE = own["stance"]
  79. def killact(layer):
  80. if skater.isPlayingAction(layer):
  81. skater.stopAction(layer)
  82. if deck.isPlayingAction(layer):
  83. deck.stopAction(layer)
  84. if trucks.isPlayingAction(layer):
  85. trucks.stopAction(layer)
  86. def killall():
  87. for x in range(5000):
  88. skater.stopAction(x)
  89. deck.stopAction(x)
  90. trucks.stopAction(x)
  91. def trucksisplaying():
  92. for x in range(5000):
  93. if deck.isPlayingAction(x):
  94. print("deck is playing:", x)
  95. def printplaying():
  96. splaying_layers = "S: "
  97. playing_layers = "D: "
  98. tplaying_layers = "T: "
  99. for x in range(9900):
  100. if skater.isPlayingAction(x):
  101. #if trucks.isPlayingAction(x):
  102. #if skater.isPlayingAction(x):
  103. splaying_layers += str(x)
  104. splaying_layers += " "
  105. if deck.isPlayingAction(x):
  106. #if trucks.isPlayingAction(x):
  107. #if skater.isPlayingAction(x):
  108. playing_layers += str(x)
  109. playing_layers += " "
  110. if trucks.isPlayingAction(x):
  111. #if trucks.isPlayingAction(x):
  112. #if skater.isPlayingAction(x):
  113. tplaying_layers += str(x)
  114. tplaying_layers += " "
  115. print(splaying_layers, playing_layers, tplaying_layers)
  116. #printplaying()
  117. ##
  118. if r_ground.positive and xBut == False and lastx == False:
  119. killact(10)
  120. #killact(11)
  121. killact(12)
  122. killact(13)
  123. ######################################
  124. #idle
  125. 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:
  126. own['requestAction'] = 'reg_idle'
  127. if own['throw_deck'] == True:
  128. own['requestAction'] = 'reg_idle_nb'
  129. 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:
  130. own['requestAction'] = 'fak_idle'
  131. if own['throw_deck'] == True:
  132. own['requestAction'] = 'fak_idle_nb'
  133. if lUD < -sens:
  134. lup = 1
  135. else:
  136. lup = 0
  137. if lUD > sens:
  138. ldown = 1
  139. else:
  140. ldown = 0
  141. if lLR < -sens:
  142. lLeft = 1
  143. else:
  144. lLeft = 0
  145. if lLR > sens:
  146. lRight = 1
  147. else:
  148. lRight = 0
  149. #walking
  150. #new walking
  151. vel = own.getLinearVelocity(True)
  152. if own['walk_timer'] < 50:
  153. velx = vel.x * .95
  154. own.setLinearVelocity([velx, 0, vel.z], True)
  155. else:
  156. own.setLinearVelocity([0, 0, vel.z], True)
  157. wf = 1
  158. if own['last_walk_frame'] - own['last_roll_frame'] > 55:
  159. wf = 0
  160. if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)) and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] == 0:
  161. own['walking'] = "regular"
  162. walking = "regular"
  163. elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] != 2:
  164. own['walking'] = "fast"
  165. walking = "fast"
  166. else:
  167. own['walking'] = None
  168. walking = None
  169. if walking == "regular":
  170. cont.deactivate(own.actuators['forward2'])
  171. cont.deactivate(own.actuators['backward2'])
  172. if stance == 0:
  173. cont.activate(own.actuators['forward'])
  174. else:
  175. cont.activate(own.actuators['backward'])
  176. if walking == "fast":
  177. cont.deactivate(own.actuators['forward'])
  178. cont.deactivate(own.actuators['backward'])
  179. if stance == 0:
  180. cont.activate(own.actuators['forward2'])
  181. else:
  182. cont.activate(own.actuators['backward2'])
  183. if walking == None:
  184. cont.deactivate(own.actuators['forward2'])
  185. cont.deactivate(own.actuators['backward2'])
  186. cont.deactivate(own.actuators['forward'])
  187. cont.deactivate(own.actuators['backward'])
  188. if own['walk_timer'] < 50:
  189. velx = vel.x * .95
  190. own.setLinearVelocity([velx, 0, vel.z], True)
  191. else:
  192. own.setLinearVelocity([0, 0, vel.z], True)
  193. #old walking
  194. if (lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
  195. own.actuators["walkondirt"].volume = .2
  196. own.actuators["walkondirt"].pitch = 1
  197. cont.activate(own.actuators["walkondirt"])
  198. if stance == 0 and skater.isPlayingAction(fliplay) == False:
  199. #without deck
  200. if own['throw_deck'] == True:
  201. own['requestAction'] = 'reg_walk_nb'
  202. else:
  203. own['requestAction'] = 'reg_walk'
  204. if stance == 1 and skater.isPlayingAction(fliplay) == False:
  205. #without deck
  206. if own['throw_deck'] == True:
  207. own['requestAction'] = 'fak_walk_nb'
  208. else:
  209. own['requestAction'] = 'fak_walk'
  210. elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
  211. own.actuators["walkondirt"].volume = .2
  212. own.actuators["walkondirt"].pitch = 1.3
  213. cont.activate(own.actuators["walkondirt"])
  214. if stance == 0 and skater.isPlayingAction(fliplay) == False:
  215. if own['throw_deck'] == True:
  216. own['requestAction'] = 'reg_walkFast_nb'
  217. else:
  218. own['requestAction'] = 'reg_walkFast'
  219. if stance == 1 and skater.isPlayingAction(fliplay) == False:
  220. if own['throw_deck'] == True:
  221. own['requestAction'] = 'fak_walkFast_nb'
  222. else:
  223. own['requestAction'] = 'fak_walkFast'
  224. else:
  225. vel = own.getLinearVelocity(True)
  226. cont.deactivate(own.actuators["walkondirt"])
  227. #turning
  228. if lRight == 1 or dict['kb_ra'] == 2:
  229. cont.activate(own.actuators['right'])
  230. else:
  231. cont.deactivate(own.actuators['right'])
  232. if lLeft == 1 or dict['kb_la'] == 2:
  233. cont.activate(own.actuators['left'])
  234. else:
  235. cont.deactivate(own.actuators['left'])
  236. #in air
  237. if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
  238. if stance == 0:
  239. cont.deactivate(own.actuators['forward'])
  240. cont.deactivate(own.actuators['forward2'])
  241. killact(4)
  242. killact(5)
  243. killact(6)
  244. killact(7)
  245. velx = linvel.x - 1
  246. own.setLinearVelocity([-1.5, linvel.y, linvel.z], 1)
  247. if stance == 1:
  248. cont.deactivate(own.actuators['backward'])
  249. cont.deactivate(own.actuators['backward2'])
  250. killact(4)
  251. killact(5)
  252. killact(6)
  253. killact(7)
  254. velx = linvel.x + 1
  255. own.setLinearVelocity([1.5, linvel.y, linvel.z], 1)
  256. own['lF_air_frame'] = own['framenum']
  257. #---------------
  258. if rLR > .05:
  259. cont.activate(camobj.actuators['camRight'])
  260. else:
  261. cont.deactivate(camobj.actuators['camRight'])
  262. if rLR < -.05:
  263. cont.activate(camobj.actuators['camLeft'])
  264. else:
  265. cont.deactivate(camobj.actuators['camLeft'])
  266. if rUD > .05:
  267. cont.activate(camobj.actuators['camDown'])
  268. else:
  269. cont.deactivate(camobj.actuators['camDown'])
  270. if rUD < -.05:
  271. cont.activate(camobj.actuators['camUp'])
  272. else:
  273. cont.deactivate(camobj.actuators['camUp'])
  274. #----------------
  275. camera.height = .01 #.9
  276. camera.min = 1.75
  277. camera.max = 2.25
  278. lasty = own['lasty']
  279. def onboard():
  280. if own['walk'] == 0:
  281. print("start walking")
  282. own['walk_idling'] = 0
  283. if own['framenum'] > 100 and own['fall'] == False:
  284. cont.activate(own.actuators['pop'])
  285. own['getoffboard'] = False
  286. own["walk_idle_frame"] = own["framenum"]
  287. own['grindcement_vol'] = 0
  288. own['grindcement_pitch'] = 0
  289. own['grindrail_vol'] = 0
  290. own['grindrail_pitch'] = 0
  291. own['sroll_vol'] = 0
  292. own['sroll_pitch'] = 0
  293. #camobj.worldPosition.z += 4
  294. try:
  295. vel = own['offboard_vel']
  296. vel = [velx, vel.y, vel.z]
  297. except:
  298. pass
  299. if STANCE == 0:
  300. own['requestAction'] = 'reg_offboard'
  301. if STANCE == 1:
  302. own['requestAction'] = 'fak_offboard'
  303. def jump():
  304. #limit fall speed
  305. if linvel.z < -10:
  306. own.linearVelocity.z = -10
  307. if xBut == True or dict['kb_space'] == 1:
  308. if own['lastx'] == 0:
  309. killact(3)
  310. killact(4)
  311. killact(5)
  312. killact(6)
  313. killact(7)
  314. if STANCE == 0:
  315. own['requestAction'] ='reg_jump'
  316. print('jump')
  317. if STANCE == 1:
  318. own['requestAction'] ='fak_jump'
  319. print('jump')
  320. JUMPHEIGHT = 1100
  321. force = [ 0.0, 0.0, JUMPHEIGHT]
  322. # use local axis
  323. local = False
  324. # apply force -- limit jump speed
  325. if linvel.z < 10:
  326. own.applyForce(force, local)
  327. own['lastx'] = 1
  328. else:
  329. own['lastx'] = 0
  330. def dropin():
  331. if dropinCol.positive == True:
  332. pass
  333. def getonboard(dict):
  334. #print(dict['kb_q'])
  335. getonboard = own['getonboard']
  336. fliplay2 = 50#8560
  337. if ((yBut == True and dict['last_yBut'] == False) or dict['kb_q'] == 2):# and (cont.sensors["vehicleNear"].positive == False and own['throw_deck'] == False):
  338. fliplay3 = fliplay2 + 1
  339. if dropinCol.positive == True:
  340. nearestObject = None
  341. grindEmpty = scene.objects['grindEmpty']
  342. grindDar = grindEmpty.sensors['grindDar2']
  343. minDist = None
  344. if grindDar.positive:
  345. detectedObjects = grindDar.hitObjectList
  346. dist = 0
  347. for obj in detectedObjects:
  348. dist = own.getDistanceTo(obj)
  349. if (minDist is None or dist < minDist):
  350. nearestObject = obj
  351. minDist = dist
  352. if nearestObject != None:
  353. print(nearestObject)
  354. obj = nearestObject
  355. player_e = own.worldOrientation.to_euler()
  356. player_pos = own.worldPosition
  357. player_rotz = math.degrees(player_e[2])
  358. grinder_e = obj.worldOrientation.to_euler()
  359. grinder_rotz = math.degrees(grinder_e[2])
  360. rot = player_rotz - grinder_rotz
  361. grinder_pos = obj.worldPosition
  362. worldVect = [1, 0, 0]
  363. vect = obj.getAxisVect(worldVect)
  364. go = obj.worldOrientation
  365. grinder_axis = [1,0,0]
  366. try:
  367. delta = player_pos - grinder_pos
  368. delta = delta.cross(vect)
  369. if delta[2] >= 0:
  370. grindside = "right"
  371. else:
  372. grindside = "left"
  373. deltamove = delta[2] * .1#.25
  374. if STANCE == 0:
  375. move = [-deltamove, 0, 0]
  376. else:
  377. move = [deltamove, 0, 0]
  378. own.applyMovement(move, True)
  379. except:
  380. pass
  381. if STANCE == 0:
  382. own['requestAction'] ='reg_dropin_pos'
  383. own['dropinTimer'] = 60
  384. if STANCE == 1:
  385. own['requestAction'] ='fak_dropin_pos'
  386. own['dropinTimer'] = 60
  387. if getonboard == 1:
  388. fliplay3 = 6000
  389. onboard_speed = .1
  390. own['getonboard'] = 0
  391. own['walk_idling'] = 0
  392. if (yBut == False and lasty == True) or (yBut == True or dict['kb_q'] == 2) and dropinCol.positive:
  393. deckact = deck.actuators["Visibility"]
  394. trucksact = trucks.actuators["Visibility"]
  395. wheel1act = wheel1.actuators["Visibility"]
  396. wheel2act = wheel2.actuators["Visibility"]
  397. wheel3act = wheel3.actuators["Visibility"]
  398. wheel4act = wheel4.actuators["Visibility"]
  399. deckact.visibility = True
  400. trucksact.visibility = True
  401. wheel1act.visibility = True
  402. wheel2act.visibility = True
  403. wheel3act.visibility = True
  404. wheel4act.visibility = True
  405. cont.activate(deck.actuators['Visibility'])
  406. cont.activate(trucks.actuators['Visibility'])
  407. cont.activate(wheel1.actuators['Visibility'])
  408. cont.activate(wheel2.actuators['Visibility'])
  409. cont.activate(wheel3.actuators['Visibility'])
  410. cont.activate(wheel4.actuators['Visibility'])
  411. own['throw_deck'] = False
  412. throw_deck_empty = scene.objects["throw_deck_empty"]
  413. throw_deck_empty['kill_deck'] = 1
  414. if ((yBut == False and lasty == True) or dict['kb_q'] == 3):# and cont.sensors["vehicleNear"].positive == False:
  415. own['getonboard'] = 1
  416. own['walk_idling'] = 0
  417. def nextframe():
  418. framenumber = own["framenum"]
  419. framenumber = framenumber + 1
  420. if framenumber == 900000:
  421. framenumber = 0
  422. own["framenum"] = framenumber
  423. own['last_walk_frame'] = framenumber
  424. def checkidle():
  425. idle = cont.sensors["idle"]
  426. idle_frame = own["walk_idle_frame"]
  427. if idle.positive:
  428. own["walk_idle_frame"] = 0
  429. cont.deactivate(camobj.actuators['idle_camRight'])
  430. camera.height = .5
  431. else:
  432. if idle_frame == 0:
  433. own["walk_idle_frame"] = own["framenum"]
  434. diff = own["framenum"] - idle_frame
  435. if (diff > 700 and idle_frame != 0 and dropinCol.positive == False and own['walk'] != 0) or own['sit'] == 1:
  436. cont.activate(camobj.actuators['idle_camRight'])
  437. camera.height = .9
  438. camera.min = 2
  439. camera.max = 2.50
  440. own['walk_idling'] = 1
  441. else:
  442. own['walk_idling'] = 0
  443. def idle_anim():
  444. if own['walk_idling'] == 1 and own['sit'] == 0:
  445. walk_idle_frame = own['walk_idle_frame']
  446. mod_num = (own["framenum"] - walk_idle_frame) % 240
  447. idle_lay = 300
  448. if mod_num == 0:
  449. if own['idle_skipper'] > 0:
  450. own['idle_skipper'] -= 1
  451. ran_num = random.randint(1, 8)
  452. if own['last_idle_num'] == ran_num:
  453. ran_num = 1
  454. if own['idle_skipper'] == 0:
  455. own['last_idle_num'] = ran_num
  456. if ran_num == 1 or ran_num > 7:
  457. killact(3)
  458. if STANCE == 0 and own['throw_deck'] == 0:
  459. own['requestAction'] = 'reg_idle1'
  460. elif STANCE == 0 and own['throw_deck'] == 1:
  461. own['requestAction'] = 'reg_idle1'
  462. elif STANCE == 1 and own['throw_deck'] == 0:
  463. own['requestAction'] = 'fak_idle1'
  464. elif STANCE == 1 and own['throw_deck'] == 1:
  465. own['requestAction'] = 'fak_idle1'
  466. elif ran_num == 2:
  467. killact(3)
  468. if STANCE == 0 and own['throw_deck'] == 0:
  469. own['requestAction'] = 'reg_idle2'
  470. elif STANCE == 0 and own['throw_deck'] == 1:
  471. own['requestAction'] = 'reg_idle2_nb'
  472. elif STANCE == 1 and own['throw_deck'] == 0:
  473. own['requestAction'] = 'fak_idle1'
  474. elif STANCE == 1 and own['throw_deck'] == 1:
  475. own['requestAction'] = 'fak_idle1'
  476. elif ran_num == 3:
  477. killact(3)
  478. if STANCE == 0 and own['throw_deck'] == 0:
  479. own['requestAction'] = 'reg_idle3'
  480. elif STANCE == 0 and own['throw_deck'] == 1:
  481. own['requestAction'] = 'reg_idle3'
  482. elif STANCE == 1 and own['throw_deck'] == 0:
  483. own['requestAction'] = 'fak_idle1'
  484. elif STANCE == 1 and own['throw_deck'] == 1:
  485. own['requestAction'] = 'fak_idle1'
  486. own['idle_skipper'] = 2
  487. elif ran_num == 4:
  488. killact(3)
  489. if STANCE == 0 and own['throw_deck'] == 0:
  490. own['requestAction'] = 'reg_idle4'
  491. elif STANCE == 0 and own['throw_deck'] == 1:
  492. own['requestAction'] = 'reg_idle4'
  493. elif STANCE == 1 and own['throw_deck'] == 0:
  494. own['requestAction'] = 'fak_idle4'
  495. elif STANCE == 1 and own['throw_deck'] == 1:
  496. own['requestAction'] = 'fak_idle4'
  497. elif ran_num == 5:
  498. killact(3)
  499. if STANCE == 0 and own['throw_deck'] == 0:
  500. own['requestAction'] = 'reg_idle5'
  501. elif STANCE == 0 and own['throw_deck'] == 1:
  502. own['requestAction'] = 'reg_idle5'
  503. elif STANCE == 1 and own['throw_deck'] == 0:
  504. own['requestAction'] = 'fak_idle5'
  505. elif STANCE == 1 and own['throw_deck'] == 1:
  506. own['requestAction'] = 'fak_idle5'
  507. elif ran_num == 6:
  508. killact(3)
  509. if STANCE == 0 and own['throw_deck'] == 0:
  510. own['requestAction'] = 'reg_idle6'
  511. elif STANCE == 0 and own['throw_deck'] == 1:
  512. own['requestAction'] = 'reg_idle6'
  513. elif STANCE == 1 and own['throw_deck'] == 0:
  514. own['requestAction'] = 'fak_idle6'
  515. elif STANCE == 1 and own['throw_deck'] == 1:
  516. own['requestAction'] = 'fak_idle6'
  517. elif ran_num == 7:
  518. killact(3)
  519. if STANCE == 0 and own['throw_deck'] == 0:
  520. own['requestAction'] = 'reg_idle7'
  521. elif STANCE == 0 and own['throw_deck'] == 1:
  522. own['requestAction'] = 'reg_idle7'
  523. elif STANCE == 1 and own['throw_deck'] == 0:
  524. own['requestAction'] = 'fak_idle6'
  525. elif STANCE == 1 and own['throw_deck'] == 1:
  526. own['requestAction'] = 'fak_idle6'
  527. def reset_pos():
  528. #reset
  529. if ddPad == 1:
  530. spawn_pos = own['spawn_pos']
  531. spawn_rot = own['spawn_rot']
  532. spawn_cam_pos = own['spawn_cam_pos']
  533. spawn_cam_rot = own['spawn_cam_rot']
  534. try:
  535. own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
  536. own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
  537. cam.worldPosition = (spawn_cam_pos[0], spawn_cam_pos[1], (spawn_cam_pos[2]))
  538. cam.worldOrientation = [[spawn_cam_rot[0][0],spawn_cam_rot[0][1],spawn_cam_rot[0][2]], [spawn_cam_rot[1][0],spawn_cam_rot[1][1],spawn_cam_rot[1][2]], [0.0, 0.0, 1.0]]
  539. except:
  540. own.worldPosition = (0, 0, .1)
  541. own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
  542. own['stance'] = own['spawn_stance']
  543. if own["spawn_stance"] == 1:
  544. own.setLinearVelocity([.1,0,0], 1)
  545. else:
  546. own.setLinearVelocity([-.1,0,0], 1)
  547. if udPad == 1:
  548. own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]]
  549. own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
  550. own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]]
  551. own['spawn_cam_rot'] = [[cam.worldOrientation[0][0],cam.worldOrientation[0][1],cam.worldOrientation[0][2]], [cam.worldOrientation[1][0],cam.worldOrientation[1][1],cam.worldOrientation[1][2]], cam.worldOrientation[2][2]]
  552. stance = own["stance"]
  553. own["spawn_stance"] = stance
  554. def falldeck():
  555. throw_deck_empty = scene.objects["throw_deck_empty"]
  556. deckact = deck.actuators["Visibility"]
  557. trucksact = trucks.actuators["Visibility"]
  558. wheel1act = wheel1.actuators["Visibility"]
  559. wheel2act = wheel2.actuators["Visibility"]
  560. wheel3act = wheel3.actuators["Visibility"]
  561. wheel4act = wheel4.actuators["Visibility"]
  562. if own['throw_deck'] == False:
  563. own['throw_deck'] = True
  564. deckact.visibility = False
  565. trucksact.visibility = False
  566. wheel1act.visibility = False
  567. wheel2act.visibility = False
  568. wheel3act.visibility = False
  569. wheel4act.visibility = False
  570. act = throw_deck_empty.actuators['throw_dec_act']
  571. if STANCE == True:
  572. act.linearVelocity = [0.0, 1.0, 1.0]
  573. if STANCE == False:
  574. act.linearVelocity = [0.0, 1.0, -1.0]
  575. cont.activate(act)
  576. else:
  577. own['throw_deck'] = False
  578. deckact.visibility = True
  579. trucksact.visibility = True
  580. wheel1act.visibility = True
  581. wheel2act.visibility = True
  582. wheel3act.visibility = True
  583. wheel4act.visibility = True
  584. throw_deck_empty['kill_deck'] = 1
  585. cont.activate(deck.actuators['Visibility'])
  586. cont.activate(trucks.actuators['Visibility'])
  587. cont.activate(wheel1.actuators['Visibility'])
  588. cont.activate(wheel2.actuators['Visibility'])
  589. cont.activate(wheel3.actuators['Visibility'])
  590. cont.activate(wheel4.actuators['Visibility'])
  591. def throwdeck(strength, ud):
  592. throw_deck_empty = scene.objects["throw_deck_empty"]
  593. deckact = deck.actuators["Visibility"]
  594. trucksact = trucks.actuators["Visibility"]
  595. wheel1act = wheel1.actuators["Visibility"]
  596. wheel2act = wheel2.actuators["Visibility"]
  597. wheel3act = wheel3.actuators["Visibility"]
  598. wheel4act = wheel4.actuators["Visibility"]
  599. if own['throw_deck'] == False:
  600. own['throw_deck'] = True
  601. deckact.visibility = False
  602. trucksact.visibility = False
  603. wheel1act.visibility = False
  604. wheel2act.visibility = False
  605. wheel3act.visibility = False
  606. wheel4act.visibility = False
  607. act = throw_deck_empty.actuators['throw_dec_act']
  608. hard = strength * .08
  609. if hard > 9:
  610. hard = 9
  611. if hard < 1:
  612. hard = 1
  613. ud = ud * 4
  614. own['bbut_timer'] = 0
  615. if STANCE == True:
  616. own['requestAction'] = 'fak_throw'
  617. act.linearVelocity = [0.0, ud, hard]
  618. if STANCE == False:
  619. own['requestAction'] = 'fak_throw'
  620. act.linearVelocity = [0.0, ud, -hard]
  621. cont.activate(act)
  622. else:
  623. own['throw_deck'] = False
  624. deckact.visibility = True
  625. trucksact.visibility = True
  626. wheel1act.visibility = True
  627. wheel2act.visibility = True
  628. wheel3act.visibility = True
  629. wheel4act.visibility = True
  630. throw_deck_empty['kill_deck'] = 1
  631. cont.activate(deck.actuators['Visibility'])
  632. cont.activate(trucks.actuators['Visibility'])
  633. cont.activate(wheel1.actuators['Visibility'])
  634. cont.activate(wheel2.actuators['Visibility'])
  635. cont.activate(wheel3.actuators['Visibility'])
  636. cont.activate(wheel4.actuators['Visibility'])
  637. def throwdeck_trigger():
  638. lastb = own['lastb']
  639. throw_deck_empty = scene.objects["throw_deck_empty"]
  640. if bBut == True:
  641. own['bbut_timer'] += 1
  642. ud = (rUD * 10) +1
  643. if bBut == False:
  644. throw_deck_empty['kill_deck'] = 0
  645. if bBut == False and own['lastb'] == True:
  646. strength = own['bbut_timer']
  647. ud = (rUD * 10) +1
  648. throwdeck(strength, ud)
  649. def focus_deck():
  650. since_air = own['framenum'] - own['lF_air_frame']
  651. if cb_td.positive and since_air < 10:
  652. object = 'focus_deckA'
  653. object2 = 'focus_deckB'
  654. other = throw_deck_empty
  655. throw_deck = scene.objects["throw_deck"]
  656. throw_deck.endObject()
  657. scene.addObject(object, other, 0)
  658. scene.addObject(object2, other, 0)
  659. if own['throw_deck'] == True:
  660. if dict['ldPad'] == False and dict['last_ldPad'] == True:
  661. object = 'focus_deckA'
  662. object2 = 'focus_deckB'
  663. other = throw_deck_empty
  664. scene.addObject(object, other, 0)
  665. scene.addObject(object2, other, 0)
  666. def fall():
  667. if own['fall'] == True:
  668. falldeck()
  669. if STANCE == 1:
  670. own['requestAction'] = 'fak_air-walk_air'
  671. own.setLinearVelocity([3,2,0], True)
  672. else:
  673. own['requestAction'] = 'reg_air-walk_air'
  674. own.setLinearVelocity([-3,-2,0], True)
  675. own['fall'] = False
  676. def sit():
  677. #turn off sit
  678. if lup == 1 or ldown == 1 or lUD > sens or lUD < -sens:
  679. if own['sit'] == 1:
  680. killact(300)
  681. killact(299)
  682. own['sit'] = 0
  683. if aBut == False and lasta == True:
  684. try:
  685. if 'sit' in r_ground.hitObject:
  686. print("sit")
  687. own['sit'] = 1
  688. killact(3)
  689. if STANCE == 0:
  690. own['requestAction'] = 'reg_sit'
  691. elif STANCE == 1:
  692. own['requestAction'] = 'fak_sit'
  693. except:
  694. pass
  695. if own['sit'] == 1:
  696. try:
  697. killact(3)
  698. sit_vect = r_ground.hitObject.getAxisVect( [0, 1, 0])
  699. if STANCE == 0:
  700. own.alignAxisToVect(-sit_vect, 0, .2)
  701. own['requestAction'] = 'reg_sit'
  702. elif STANCE == 1:
  703. own['requestAction'] = 'fak_sit'
  704. own.alignAxisToVect(sit_vect, 0, .2)
  705. except:
  706. pass
  707. def switchcam():
  708. if ltsBut == False and own['lastlts'] == True and rtsBut == False:
  709. if own['camera'] == 1:
  710. own['camera'] = 0
  711. else:
  712. own['camera'] = 1
  713. if rtsBut == False and own['lastrts'] == True and ltsBut == False:
  714. if own['camera'] == 2:
  715. own['camera'] = 0
  716. else:
  717. own['camera'] = 2
  718. #followcam
  719. def move_followcam():
  720. if own['camera'] == 2:
  721. if own['lastbkBut'] == True and bkBut == False:
  722. print("activate move followcam")
  723. if own['move_followcam'] == False:
  724. own['move_followcam'] = True
  725. else:
  726. own['move_followcam'] = False
  727. if own['move_followcam'] == True:
  728. camspeed1 = .015
  729. camspeed2 = .055
  730. camrot1 = .005
  731. camrot2 = .02
  732. #up
  733. if lUD < -0.080:
  734. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  735. cont.activate(followcam.actuators["up"])
  736. print("fastup")
  737. else:
  738. cont.deactivate(followcam.actuators["up"])
  739. # #down
  740. if lUD > .080:
  741. followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  742. cont.activate(followcam.actuators["down"])
  743. else:
  744. cont.deactivate(followcam.actuators["down"])
  745. # #left
  746. if lLR < -0.080:
  747. followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  748. cont.activate(followcam.actuators["left"])
  749. else:
  750. cont.deactivate(followcam.actuators["left"])
  751. # #right
  752. if lLR > 0.080:
  753. followcam.actuators["right"].dLoc = [camspeed2, 0, 0]
  754. cont.activate(followcam.actuators["right"])
  755. else:
  756. cont.deactivate(followcam.actuators["right"])
  757. #up
  758. if rUD < -0.080:
  759. followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
  760. cont.activate(followcam.actuators["rotup"])
  761. else:
  762. cont.deactivate(followcam.actuators["rotup"])
  763. # #down
  764. if rUD > .080:
  765. followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]
  766. cont.activate(followcam.actuators["rotdown"])
  767. else:
  768. cont.deactivate(followcam.actuators["rotdown"])
  769. # #left
  770. if rLR < -0.080:
  771. followcam.actuators["rotleft"].dRot = [0, 0, camrot2]
  772. cont.activate(followcam.actuators["rotleft"])
  773. else:
  774. cont.deactivate(followcam.actuators["rotleft"])
  775. # #right
  776. if rLR > 0.080:
  777. followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
  778. cont.activate(followcam.actuators["rotright"])
  779. else:
  780. cont.deactivate(followcam.actuators["rotright"])
  781. #*********************************************
  782. if lUD > -0.080 and lUD < -0.030:
  783. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  784. cont.activate(followcam.actuators["up"])
  785. else:
  786. cont.deactivate(followcam.actuators["up"])
  787. # #down
  788. if lUD < .080 and lUD > .03:
  789. followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  790. cont.activate(followcam.actuators["down"])
  791. else:
  792. cont.deactivate(followcam.actuators["down"])
  793. # #left
  794. if lLR > -0.080 and lLR < -0.030:
  795. followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  796. cont.activate(followcam.actuators["left"])
  797. else:
  798. cont.deactivate(followcam.actuators["left"])
  799. # #right
  800. if lLR < .080 and lLR > .03:
  801. followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
  802. cont.activate(followcam.actuators["right"])
  803. else:
  804. cont.deactivate(followcam.actuators["right"])
  805. #up
  806. if rUD > -0.080 and rUD < -0.030:
  807. followcam.actuators["rotup"].dRot = [camrot1, 0, 0]
  808. cont.activate(followcam.actuators["rotup"])
  809. else:
  810. cont.deactivate(followcam.actuators["rotup"])
  811. # #down
  812. if rUD < .080 and rUD > .03:
  813. followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  814. cont.activate(followcam.actuators["rotdown"])
  815. else:
  816. cont.deactivate(followcam.actuators["rotdown"])
  817. # #left
  818. if rLR > -0.080 and rLR < -0.030:
  819. followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
  820. cont.activate(followcam.actuators["rotleft"])
  821. else:
  822. cont.deactivate(followcam.actuators["rotleft"])
  823. # #right
  824. if rLR < .080 and rLR > .03:
  825. followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
  826. cont.activate(followcam.actuators["rotright"])
  827. else:
  828. cont.deactivate(followcam.actuators["rotright"])
  829. def move_flycam():
  830. if own['camera'] == 1:
  831. if own['lastbkBut'] == True and bkBut == False:
  832. if own['move_freecam'] == False:
  833. own['move_freecam'] = True
  834. else:
  835. own['move_freecam'] = False
  836. if own['move_freecam'] == True:
  837. camspeed1 = .015
  838. camspeed2 = .055
  839. camrot1 = .005
  840. camrot2 = .02
  841. #up
  842. if lUD < -0.080:
  843. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  844. cont.activate(freecam.actuators["up"])
  845. else:
  846. cont.deactivate(freecam.actuators["up"])
  847. # #down
  848. if lUD > .080:
  849. freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  850. cont.activate(freecam.actuators["down"])
  851. else:
  852. cont.deactivate(freecam.actuators["down"])
  853. # #left
  854. if lLR < -0.080:
  855. freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  856. cont.activate(freecam.actuators["left"])
  857. else:
  858. cont.deactivate(freecam.actuators["left"])
  859. # #right
  860. if lLR > 0.080:
  861. freecam.actuators["right"].dLoc = [camspeed2, 0, 0]
  862. cont.activate(freecam.actuators["right"])
  863. else:
  864. cont.deactivate(freecam.actuators["right"])
  865. #up
  866. if rUD < -0.080:
  867. freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
  868. cont.activate(freecam.actuators["rotup"])
  869. else:
  870. cont.deactivate(freecam.actuators["rotup"])
  871. # #down
  872. if rUD > .080:
  873. freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]
  874. cont.activate(freecam.actuators["rotdown"])
  875. else:
  876. cont.deactivate(freecam.actuators["rotdown"])
  877. # #left
  878. if rLR < -0.080:
  879. freecam.actuators["rotleft"].dRot = [0, 0, camrot2]
  880. cont.activate(freecam.actuators["rotleft"])
  881. else:
  882. cont.deactivate(freecam.actuators["rotleft"])
  883. # #right
  884. if rLR > 0.080:
  885. freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
  886. cont.activate(freecam.actuators["rotright"])
  887. else:
  888. cont.deactivate(freecam.actuators["rotright"])
  889. #*********************************************
  890. if lUD > -0.080 and lUD < -0.030:
  891. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  892. cont.activate(freecam.actuators["up"])
  893. #print(lUD)
  894. else:
  895. cont.deactivate(freecam.actuators["up"])
  896. # #down
  897. if lUD < .080 and lUD > .03:
  898. freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  899. cont.activate(freecam.actuators["down"])
  900. else:
  901. cont.deactivate(freecam.actuators["down"])
  902. # #left
  903. if lLR > -0.080 and lLR < -0.030:
  904. freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  905. cont.activate(freecam.actuators["left"])
  906. else:
  907. cont.deactivate(freecam.actuators["left"])
  908. # #right
  909. if lLR < .080 and lLR > .03:
  910. freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
  911. cont.activate(freecam.actuators["right"])
  912. else:
  913. cont.deactivate(freecam.actuators["right"])
  914. #up
  915. if rUD > -0.080 and rUD < -0.030:
  916. freecam.actuators["rotup"].dRot = [camrot1, 0, 0]
  917. cont.activate(freecam.actuators["rotup"])
  918. else:
  919. cont.deactivate(freecam.actuators["rotup"])
  920. # #down
  921. if rUD < .080 and rUD > .03:
  922. freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  923. cont.activate(freecam.actuators["rotdown"])
  924. else:
  925. cont.deactivate(freecam.actuators["rotdown"])
  926. # #left
  927. if rLR > -0.080 and rLR < -0.030:
  928. freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
  929. cont.activate(freecam.actuators["rotleft"])
  930. else:
  931. cont.deactivate(freecam.actuators["rotleft"])
  932. # #right
  933. if rLR < .080 and rLR > .03:
  934. freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
  935. cont.activate(freecam.actuators["rotright"])
  936. else:
  937. cont.deactivate(freecam.actuators["rotright"])
  938. if r_ground.triggered == False:
  939. cont.deactivate(own.actuators["walk_align"])
  940. else:
  941. cont.activate(own.actuators["walk_align"])
  942. #walking on stairs
  943. if r_ground.triggered:
  944. try:
  945. if 'stair' in r_ground.hitObject:
  946. own['stair_counter'] = 20
  947. except:
  948. pass
  949. if own['stair_counter'] > 0:
  950. own['stair_counter'] -= 1
  951. if yBut == True:
  952. own['walk_idling'] = 0
  953. own["walk_idle_frame"] = 0
  954. if own['stair_counter'] > 5 and r_ground.triggered == False:
  955. own.applyForce([0,0,-200], True)
  956. if deck.visible:
  957. own['deckvis'] = 1
  958. else:
  959. own['deckvis'] = 0
  960. if own['requestAction'] == 'empty' or own['requestAction'] == None:
  961. if STANCE == 0:
  962. own['requestAction'] = 'reg_idle1'
  963. if STANCE == 1:
  964. own['requestAction'] = 'fak_idle1'
  965. def onground():
  966. if r_ground.positive:
  967. own['lF_ground_frame'] = own['framenum']
  968. if 'grind' in r_ground.hitObject:
  969. if own['framenum'] - own['last_fall_frame'] < 90:
  970. own.applyForce([0,100,0], True)
  971. #print('moving away from rail')
  972. else:
  973. #print('in air')
  974. if own['framenum'] - own['lF_ground_frame'] > 10:
  975. if STANCE == 0:
  976. own['requestAction'] = 'reg_walk_air'
  977. else:
  978. own['requestAction'] = 'fak_walk_air'
  979. #if control bottom is touching ground object, turn ground on
  980. if cb.positive:
  981. if own['framenum'] - own['last_fall_frame'] < 90:
  982. own['lF_ground_frame'] = own['framenum']
  983. def get_in_car():
  984. vehicleNear = cont.sensors["vehicleNear"]
  985. #print('vh', vehicleNear.positive)
  986. scene = bge.logic.getCurrentScene()
  987. cam = scene.active_camera
  988. #dict = bge.logic.globalDict
  989. if vehicleNear.positive and 'car' in vehicleNear.hitObject:
  990. obj = vehicleNear.hitObject
  991. if yBut == True:
  992. obj['driving'] = True
  993. own['driving'] = True
  994. cube.suspendDynamics(True)
  995. cube.worldPosition = obj.worldPosition
  996. cube.worldOrientation = obj.worldOrientation
  997. rot = [ 0.0, 0.0, 1.570796327]
  998. cube.applyRotation(rot,False)
  999. compound = False
  1000. # child is solid
  1001. ghost = True
  1002. # set parent
  1003. cube.setParent( obj, compound, ghost)
  1004. #cam.target = obj
  1005. #cam.state = 2
  1006. cont.actuators['Camera'].object = obj
  1007. cont.actuators['Camera'].height = 3
  1008. cont.actuators['Camera'].min = 6
  1009. cont.actuators['Camera'].max = 10
  1010. own.state = 2
  1011. print('near car')
  1012. if dict['last_driving'] == True:
  1013. cont.actuators['Camera'].object = scene.objects['camCube']
  1014. cont.activate(cont.actuators['walk'])
  1015. if own['driving'] == False:
  1016. #cont.actuators['Camera'].object = scene.objects['camCube']
  1017. #cont.activate(cont.actuators['walk'])
  1018. dict['last_driving'] = False
  1019. def get_on_bike(dict, own):
  1020. #bikeCol = cont.sensors['bikeCol']
  1021. vehicleNear = cont.sensors["vehicleNear"]
  1022. #print('vh', vehicleNear.positive)
  1023. scene = bge.logic.getCurrentScene()
  1024. #cam = scene.active_camera
  1025. #dict = bge.logic.globalDict
  1026. try:
  1027. if vehicleNear.positive and 'bike' in vehicleNear.hitObject:
  1028. if yBut == True and dict['last_yBut'] == False and own['throw_deck'] == True:
  1029. vehicleNear.hitObject.endObject()
  1030. dict['bike'] = True
  1031. cont.activate(own.actuators['bike_state'])
  1032. object = "player_bike"
  1033. # instantly add bullet
  1034. newbike = scene.addObject(object, own, 0)
  1035. #bike.localScale = 4.6
  1036. newbike.setParent(cube, False, False)
  1037. #rot = [ 0.0, 0.0, 1.570796327]
  1038. #bike.applyRotation(rot,False)
  1039. except:
  1040. pass
  1041. if dict['driving_reset'] == True:
  1042. scene.resume()
  1043. cube.suspendDynamics(False)
  1044. cont.actuators['Camera'].object = camobj2
  1045. cont.activate(own.actuators['walk'])
  1046. #dict['driving_reset'] = False
  1047. #print('reseting driving')
  1048. onboard()
  1049. jump()
  1050. dropin()
  1051. throwdeck_trigger()
  1052. nextframe()
  1053. checkidle()
  1054. getonboard(dict)
  1055. reset_pos()
  1056. switchcam()
  1057. move_flycam()
  1058. move_followcam()
  1059. fall()
  1060. idle_anim()
  1061. sit()
  1062. onground()
  1063. focus_deck()
  1064. get_in_car()
  1065. get_on_bike(dict, own)
  1066. #printplaying()
  1067. own.alignAxisToVect([0.0,0.0,1.0], 2, .03)
  1068. own.actuators["sroll"].stopSound()
  1069. wheel1 = scene.objects["rollen.000"]
  1070. wheel2 = scene.objects["rollen.001"]
  1071. wheel3 = scene.objects["rollen.002"]
  1072. wheel4 = scene.objects["rollen.003"]
  1073. wheel1.stopAction(2)
  1074. wheel2.stopAction(2)
  1075. wheel3.stopAction(2)
  1076. wheel4.stopAction(2)
  1077. own['lasty'] = yBut
  1078. own['lastb'] = bBut
  1079. own['lasta'] = aBut
  1080. own['lastx'] = xBut
  1081. own['lastlts'] = ltsBut
  1082. own['lastrts'] = rtsBut
  1083. own['lastbkBut'] = bkBut
  1084. own['dropinCol'] = dropinCol
  1085. own['walk'] = 1