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 43KB

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