Browse Source

monday_night1

shuvit 6 years ago
parent
commit
69350aee0c
1 changed files with 5 additions and 121 deletions
  1. 5
    121
      controller2.py

+ 5
- 121
controller2.py View File

199
 LAND_LAYER = 100
199
 LAND_LAYER = 100
200
 LAND_END = 20
200
 LAND_END = 20
201
 
201
 
202
-#Sensor logic bricks connected to the python Controller  
203
-#aXis = cont.sensors["sControla"]
204
-#bUtt = cont.sensors["sControlb"]
205
-
206
-#onW = onWindows()
207
-
208
-## windows stuff
209
-#lar_lts = 0
210
-#uad_lts = 1
211
-#lar_rts = 2 if onW else 2
212
-#uad_rts = 3 if onW else 3
213
-#lt = 4 if onW else 4
214
-#rt = 5 if onW else 5
215
-
216
-# These are the numerical values associated with the buttons on the Xbox Controller 
217
-# Called with - SensorName.getButtonStatus(buttonnumber) - 
218
-# A joystick sensor logic brick (with the 'Button' Event Type; 'All Events' selected; and 'Tap' enabled) must be connected to the Python Controller logic brick to call these buttons 
219
-
220
-#a_but = 0 if onW else 0
221
-#b_but = 1 if onW else 1
222
-#x_but = 2 if onW else 2
223
-#y_but = 3 if onW else 3
224
-#l_bump = 9 if onW else 9
225
-#r_bump = 10 if onW else 10
226
-#bk_but = 4 if onW else 4
227
-#st_but = 6 if onW else 6
228
-#xb_but = 5 if onW else 5
229
-#lts_pr = 7 if onW else 7
230
-#rts_pr = 8 if onW else 8
231
-#l_dp = 13 if onW else 13
232
-#r_dp = 14 if onW else 14
233
-#u_dp = 11 if onW else 11
234
-#d_dp = 12 if onW else 12
235
-
236
-#lLR = aXis.axisValues[lar_lts] / reduction
237
-#lUD = aXis.axisValues[uad_lts] / reduction
238
-#rLR = aXis.axisValues[lar_rts] / reduction
239
-#rUD = aXis.axisValues[uad_rts] / reduction
240
-#lTrig = aXis.axisValues[lt] / reduction
241
-#rTrig = aXis.axisValues[rt] / reduction
242
-#aBut = bUtt.getButtonStatus(a_but)
243
-#bBut = bUtt.getButtonStatus(b_but)
244
-#xBut = bUtt.getButtonStatus(x_but)
245
-#yBut = bUtt.getButtonStatus(y_but)
246
-#lBump = bUtt.getButtonStatus(l_bump)
247
-#rBump = bUtt.getButtonStatus(r_bump)
248
-#bkBut = bUtt.getButtonStatus(bk_but)
249
-#stBut = bUtt.getButtonStatus(st_but)
250
-#xbBut = bUtt.getButtonStatus(xb_but)
251
-#ltsBut = bUtt.getButtonStatus(lts_pr)
252
-#rtsBut = bUtt.getButtonStatus(rts_pr)
253
-#ldPad = bUtt.getButtonStatus(l_dp)
254
-#rdPad = bUtt.getButtonStatus(r_dp)
255
-#udPad = bUtt.getButtonStatus(u_dp)
256
-#ddPad = bUtt.getButtonStatus(d_dp)
257
-
258
 lLR = dict['lLR']
202
 lLR = dict['lLR']
259
 lUD = dict['lUD']
203
 lUD = dict['lUD']
260
 rLR = dict['rLR']
204
 rLR = dict['rLR']
277
 udPad = dict['udPad']
221
 udPad = dict['udPad']
278
 ddPad = dict['ddPad']
222
 ddPad = dict['ddPad']
279
 
223
 
280
-
281
-## -End- ##
282
-#list = bUtt.getButtonActiveList()
283
-#print(list)
284
-
285
-#no input
286
-#def cutOff():
287
-#    
288
-# if (abs(lLR) < axisTh 
289
-#     and abs(lUD) < axisTh 
290
-#     and abs(rLR) < axisTh 
291
-#     and abs(rUD) < axisTh
292
-#     and aBut == False):
293
-#         
294
-#  return True
295
-
296
 #fliptricks after manuals
224
 #fliptricks after manuals
297
 if (frame - own['last_manual_frame']) < 25:
225
 if (frame - own['last_manual_frame']) < 25:
298
     flip_start_lay = 8
226
     flip_start_lay = 8
354
     for x in range(9000):
282
     for x in range(9000):
355
         skater.stopAction(x)
283
         skater.stopAction(x)
356
         deck.stopAction(x)
284
         deck.stopAction(x)
357
-        trucks.stopAction(x)
358
-               
359
-def grind_stance():
360
-    #own["last_grind_stance"] = own["grind_stance"]
361
-#    if grindHit == 1 and LAST_GRIND == 1 and (own['grindCountdown'] < 15 or own['grindCountdown'] >19):
362
-#        own["last_grind_stance"] = own["grind_stance"]        
363
-        #own["grind_stance"] = STANCE 
364
-    pass    
365
-grind_stance()  
285
+        trucks.stopAction(x) 
366
 
286
 
367
 def reset_rtimers():
287
 def reset_rtimers():
368
     own["Q1oncd"] = 0
288
     own["Q1oncd"] = 0
392
 check_fall()
312
 check_fall()
393
 def check_landing():
313
 def check_landing():
394
     lf_ground = own["lF_ground"]
314
     lf_ground = own["lF_ground"]
395
-    #zvel = own.getLinearVelocity
396
-    #print(zvel)
397
     STANCE = own["stance"]
315
     STANCE = own["stance"]
398
-    #if lf_ground == False and r_ground.triggered == True and grindDar == 0:
399
     playing_action_frame = skater.getActionFrame(LAND_LAYER)
316
     playing_action_frame = skater.getActionFrame(LAND_LAYER)
400
-    #if playing_action_frame < (LAND_END):    
401
-        #own["lastPump"] = False
402
-        #own["Pump"] = False
403
     if lf_ground == False and r_ground.triggered == True:
317
     if lf_ground == False and r_ground.triggered == True:
404
         own['jump_from_trans'] = 0
318
         own['jump_from_trans'] = 0
405
         nearestObject = None
319
         nearestObject = None
406
         minDist = None
320
         minDist = None
407
         detectedObjects = grindDar2.hitObjectList
321
         detectedObjects = grindDar2.hitObjectList
408
-
409
         if grindDar == 0:
322
         if grindDar == 0:
410
-            #print("you are not grinding", grindHit)
411
             lastheight = own["air_height"]
323
             lastheight = own["air_height"]
412
             pos = own.worldPosition.z
324
             pos = own.worldPosition.z
413
             dist = lastheight - pos
325
             dist = lastheight - pos
414
             dist = dist * 2
326
             dist = dist * 2
415
-
416
             if dist > 1:
327
             if dist > 1:
417
                 dist = 1
328
                 dist = 1
418
             own.actuators["land"].volume = dist 
329
             own.actuators["land"].volume = dist 
442
     if vib_countdown == 1:
353
     if vib_countdown == 1:
443
         stopAnims()
354
         stopAnims()
444
         stance()
355
         stance()
445
-        
446
 
356
 
447
 #air anim
357
 #air anim
448
 if r_ground.triggered == False:
358
 if r_ground.triggered == False:
592
     #if own['flip_manual_stance'] == 0:
502
     #if own['flip_manual_stance'] == 0:
593
     own["fak_nmanual"] = 0 
503
     own["fak_nmanual"] = 0 
594
 if own['last_fak_nmanual'] == 1 and own['fak_nmanual'] == 0:
504
 if own['last_fak_nmanual'] == 1 and own['fak_nmanual'] == 0:
595
-    #killall() 
596
     pass  
505
     pass  
597
 
506
 
598
-
599
-#print("rm ", own["reg_manual"], "rnm ", own["reg_nmanual"], "fm ", own["fak_manual"], "fnm ", own["fak_nmanual"])
600
-
601
-
602
 def reg_stance_left_off():
507
 def reg_stance_left_off():
603
     LAST_LEFT = own["LAST_LEFT"]
508
     LAST_LEFT = own["LAST_LEFT"]
604
     own["LAST_LEFT"] = 0   
509
     own["LAST_LEFT"] = 0   
3536
     
3441
     
3537
 def reset_pos():
3442
 def reset_pos():
3538
     #reset
3443
     #reset
3539
-    if ddPad == 1:
3540
-        
3444
+    if ddPad == 1:   
3541
         spawn_pos = own['spawn_pos']
3445
         spawn_pos = own['spawn_pos']
3542
         spawn_rot = own['spawn_rot']
3446
         spawn_rot = own['spawn_rot']
3543
         try:
3447
         try:
4225
         move = [deltamove, 0, 0]
4129
         move = [deltamove, 0, 0]
4226
         #print(deltamove)
4130
         #print(deltamove)
4227
         if abs(deltamove) < 1 and delta[1] < 1:
4131
         if abs(deltamove) < 1 and delta[1] < 1:
4228
-            own.applyMovement(move, True)        
4229
-        #print(deltamove, delta, "delta.......")       
4230
-        #pos = ground_ray.hitPosition 
4231
-        #print(pos)
4232
-        
4233
-        #linvelloc6 = own.getLinearVelocity(True)
4234
-        #xvel6 = linvelloc6.x * .95
4235
-        #force = (xvel6, linvelloc6.y, linvelloc6.z)
4236
-        #own.setLinearVelocity(force, True)        
4237
-    
4238
-        
4239
-        
4132
+            own.applyMovement(move, True)               
4240
         
4133
         
4241
 #control_calib() #scene must be enabled in main                 
4134
 #control_calib() #scene must be enabled in main                 
4242
 jump_Timer()
4135
 jump_Timer()
4259
 wallride_sound()
4152
 wallride_sound()
4260
 shutoff_timers()
4153
 shutoff_timers()
4261
 grindout_cleanup()
4154
 grindout_cleanup()
4262
-#trans_jump()
4263
-
4264
 
4155
 
4265
-#printplaying()
4266
-#transmult()
4267
 linvelx = own.getLinearVelocity(True)
4156
 linvelx = own.getLinearVelocity(True)
4268
-#print(linvelx)
4157
+
4269
 own["linvelx"] = linvelx.x
4158
 own["linvelx"] = linvelx.x
4270
 LAST_STANCE = STANCE
4159
 LAST_STANCE = STANCE
4271
 LAST_STANCE = own["stance"]
4160
 LAST_STANCE = own["stance"]
4293
 if own['manual'] == 1:
4182
 if own['manual'] == 1:
4294
     own['last_manual_frame'] = frame
4183
     own['last_manual_frame'] = frame
4295
 
4184
 
4296
-
4297
-#print(own['hippy'], own['last_hippy'])
4298
 own['last_hippy'] = own['hippy']
4185
 own['last_hippy'] = own['hippy']
4299
-#last pressed down frame
4300
 if aBut == 1 and own["lasta"] == 0:
4186
 if aBut == 1 and own["lasta"] == 0:
4301
     own["lastaf"] = frame
4187
     own["lastaf"] = frame
4302
 if xBut == 1 and own["lastx"] == 0:
4188
 if xBut == 1 and own["lastx"] == 0:
4313
     own.applyForce(force2, True)
4199
     own.applyForce(force2, True)
4314
 #print('grindtouch = ',  own['grindTouch'])
4200
 #print('grindtouch = ',  own['grindTouch'])
4315
 if grindDar == False and r_ground.triggered and own['grindTouch'] == False:
4201
 if grindDar == False and r_ground.triggered and own['grindTouch'] == False:
4316
-    own['grindType'] = ''
4317
-
4318
-
4202
+    own['grindType'] = ''

Loading…
Cancel
Save