Browse Source

shooting align broke

shuvit 4 years ago
parent
commit
61e3a13d93
10 changed files with 328 additions and 126 deletions
  1. 2
    2
      assets/base_rink.blend
  2. 2
    2
      game.blend
  3. 6
    1
      scripts/FSM.py
  4. 230
    90
      scripts/StatesPlayer.py
  5. 73
    25
      scripts/player.py
  6. 4
    1
      scripts/sound_man.py
  7. 3
    3
      scripts/utils.py
  8. 3
    0
      sounds/board.wav
  9. 2
    2
      sounds/check.wav
  10. 3
    0
      sounds/check_miss.wav

+ 2
- 2
assets/base_rink.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:6fd35c828bc9f4a9cedd4a0cbabfe4c73b4f631a6f9ac40a7a9ce8d43d99768d
3
-size 879696
2
+oid sha256:d718c610f9474038616f499be2f3690aff9052518adb7d4bc0eff2fc23547ac9
3
+size 881784

+ 2
- 2
game.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:3559301c4de37746ac7a2c9c876ad08a33c89c8412a1fafc4a4b4bcb8a456aa2
3
-size 1483504
2
+oid sha256:f016e857703f59b024a36a4c6771499335a880d0553e59261357dab5a9b47d05
3
+size 1464492

+ 6
- 1
scripts/FSM.py View File

@@ -70,7 +70,12 @@ class PlayerFSM(Char):
70 70
         'FaceoffIntro',
71 71
         'Faceoff', 
72 72
         'ShootShot',
73
-        'WindShot']
73
+        'WindShot',
74
+        'CheckMissOn',
75
+        'CheckMissOff',
76
+        'CheckOn',
77
+        'CheckOff',
78
+        'Checked']
74 79
         
75 80
         for s in state_list:
76 81
             self.FSM.AddState(s, getattr(StatesPlayer, s)(self.FSM))

+ 230
- 90
scripts/StatesPlayer.py View File

@@ -26,7 +26,7 @@ class Example(State):
26 26
     def Execute(self):
27 27
         self.FSM.stateLife += 1
28 28
         o = self.FSM.owner
29
-        g = o.me
29
+        g = o.me['game']
30 30
         self.FSM.ToTransition('toNewState')
31 31
     
32 32
     def Exit(self):
@@ -64,6 +64,10 @@ class GetPuck(State):
64 64
                 if o.kb_da == 0 and o.last_kb_da == 1:
65 65
                     o.switch_player()
66 66
                     print('fsm switch')
67
+                o.check_check()
68
+                # if o.kb_ua == 1:
69
+                #     self.FSM.ToTransition('toCheckMissOn')
70
+
67 71
         if o.team == 1:
68 72
             self.FSM.ToTransition('toDefendPuck')
69 73
     
@@ -146,63 +150,69 @@ class DefendPuck(State):
146 150
         self.FSM.stateLife += 1
147 151
 
148 152
         o = self.FSM.owner
149
-        
150 153
         g = o.me['game']
151
-
152 154
         d = o.cont.getDistanceTo(g.puck)  
153 155
         
154 156
         utils.update_whiskers(o)  
155 157
                   
156
-        if g.puck.worldPosition.y > 0:
157
-            y = -4
158
-        else:
159
-            y = 4
160
-        if o.player_col:
161
-            #print('hitting', o.player_col) 
162
-            pass   
163
-        if o == g.players[1]:
164
-            poi = [0, y, o.cont.worldPosition.z]
165
-            if g.puck.worldPosition.x > 4:
166
-                poi = [-6, y, o.cont.worldPosition.z]    
167
-            if g.puck.worldPosition.x < -4:
168
-                poi = [4, y, o.cont.worldPosition.z]                    
169
-            #distance to point of interest
170
-            dto_poi = o.cont.getDistanceTo(poi)
171
-            if dto_poi > .5:
172
-                v = o.cont.getVectTo(poi)
173
-                o.cont.alignAxisToVect(v[1], 0, .1)
174
-                if o.cont.linearVelocity.x < 2:
175
-                    o.cont.applyForce([o.speed, 0, 0], True)
176
-            else:
177
-                v = o.cont.getVectTo(g.puck)
178
-                o.cont.alignAxisToVect(v[1], 0, .05)                
179
-                o.cont.linearVelocity = [0, 0, 0]
158
+        if o.checked != None:
159
+            self.FSM.ToTransition('toChecked')
160
+
161
+        o.simple_align(.04)    
162
+
163
+        # if g.puck.worldPosition.y > 0:
164
+        #     y = -4
165
+        # else:
166
+        #     y = 4
167
+        # if o.player_col:
168
+        #     #print('hitting', o.player_col) 
169
+        #     pass   
170
+
171
+    
172
+
173
+        # if o == g.players[1]:
174
+        #     poi = [0, y, o.cont.worldPosition.z]
175
+        #     if g.puck.worldPosition.x > 4:
176
+        #         poi = [-6, y, o.cont.worldPosition.z]    
177
+        #     if g.puck.worldPosition.x < -4:
178
+        #         poi = [4, y, o.cont.worldPosition.z]                    
179
+        #     #distance to point of interest
180
+        #     dto_poi = o.cont.getDistanceTo(poi)
181
+        #     if dto_poi > .5:
182
+        #         v = o.cont.getVectTo(poi)
183
+        #         o.cont.alignAxisToVect(v[1], 0, .1)
184
+        #         if o.cont.linearVelocity.x < 2:
185
+        #             o.cont.applyForce([o.speed, 0, 0], True)
186
+        #     else:
187
+        #         v = o.cont.getVectTo(g.puck)
188
+        #         o.cont.alignAxisToVect(v[1], 0, .05)                
189
+        #         o.cont.linearVelocity = [0, 0, 0]
180 190
                 
181
-            o.align_to_base()
182
-            if abs(o.cont.linearVelocity.y) > .5:
183
-                o.cont.linearVelocity *= .5
191
+        #     o.align_to_base()
192
+        #     if abs(o.cont.linearVelocity.y) > .5:
193
+        #         o.cont.linearVelocity *= .5
184 194
                 
185
-        if o == g.players[2]:
186
-            poi = [0-6, -y, o.cont.worldPosition.z]
187
-            if g.puck.worldPosition.x > 4:
188
-                poi = [6-6, -y, o.cont.worldPosition.z]    
189
-            if g.puck.worldPosition.x < -4:
190
-                poi = [-4-6, y, o.cont.worldPosition.z]                    
191
-            #distance to point of interest
192
-            dto_poi = o.cont.getDistanceTo(poi)
193
-            if dto_poi > .5:
194
-                v = o.cont.getVectTo(poi)
195
-                o.cont.alignAxisToVect(v[1], 0, .1)
196
-                if o.cont.linearVelocity.x < 2:
197
-                    o.cont.applyForce([o.speed, 0, 0], True)
198
-            else:
199
-                v = o.cont.getVectTo(g.puck)
200
-                o.cont.alignAxisToVect(v[1], 0, .05)                
201
-                o.cont.linearVelocity = [0, 0, 0]
195
+        # if o == g.players[2]:
196
+        #     poi = [0-6, -y, o.cont.worldPosition.z]
197
+        #     if g.puck.worldPosition.x > 4:
198
+        #         poi = [6-6, -y, o.cont.worldPosition.z]    
199
+        #     if g.puck.worldPosition.x < -4:
200
+        #         poi = [-4-6, y, o.cont.worldPosition.z]                    
201
+        #     #distance to point of interest
202
+        #     dto_poi = o.cont.getDistanceTo(poi)
203
+        #     if dto_poi > .5:
204
+        #         v = o.cont.getVectTo(poi)
205
+        #         o.cont.alignAxisToVect(v[1], 0, .1)
206
+        #         if o.cont.linearVelocity.x < 2:
207
+        #             o.cont.applyForce([o.speed, 0, 0], True)
208
+        #     else:
209
+        #         v = o.cont.getVectTo(g.puck)
210
+        #         o.cont.alignAxisToVect(v[1], 0, .05)                
211
+        #         o.cont.linearVelocity = [0, 0, 0]
202 212
                 
203
-            o.align_to_base()
204
-            if abs(o.cont.linearVelocity.y) > .5:
205
-                o.cont.linearVelocity *= .5
213
+        #     o.align_to_base()
214
+        #     if abs(o.cont.linearVelocity.y) > .5:
215
+        #         o.cont.linearVelocity *= .5
206 216
         
207 217
         
208 218
     def Exit(self):
@@ -290,45 +300,7 @@ class Shooting(State):
290 300
         
291 301
     def Execute(self):
292 302
         pass
293
-#        self.FSM.stateLife += 1
294
-#        o = self.FSM.owner        
295
-#        g = o.me['game']
296
-#        o.state = 'shooting'
297
-#        v = o.cont.getVectTo(o.goal_t)
298
-#        
299
-#        stre = .1
300
-#        o.stick.alignAxisToVect(v[1], 0, stre)        
301
-#        o.cont.alignAxisToVect(v[1], 0, stre)                        
302
-#        e1 = o.cont.worldOrientation.to_euler().z
303
-#        e2 = o.stick.worldOrientation.to_euler().z
304
-#        dif = e1 - e2
305
-#        if dif > -1.5:
306
-#            o.stick.applyRotation([0,0,.15], True) 
307
-#            
308
-#        if o.shooting > 15:   
309
-#            g.puck.worldPosition = o.puck_empty.worldPosition
310
-#            g.puck.linearVelocity = [0,0,0]            
311
-#        
312
-#        if o.shooting == 15:
313
-#            g.sound_man.queue_sound(['shoot', o.cont, g.camera]) 
314
-#            
315
-#        if o.kb_da == 1:
316
-#            o.shooting = 25
317
-#            #print('kb')   
318
-#        else:
319
-#            print(o.shooting)
320
-#            if o.shooting > 0:
321
-#                #print('oshooting')
322
-#                dif = e1 - e2
323
-#                o.shooting -= 1
324
-#                o.stick.applyRotation([0,0,-.22], True)   
325
-#                #print(dif)      
326
-#                #if dif > 1.8 and o.shooting < 5:
327
-#                if o.shooting < 1:                
328
-#                    o.state = 'chasing'
329
-#                    self.FSM.ToTransition('toGetPuck')
330
-#                    #print('exit')
331
-#                o.puck = False 
303
+
332 304
             
333 305
     def Exit(self):
334 306
         print('Waking up from Shooting.')          
@@ -575,4 +547,172 @@ class ShootShot(State):
575 547
     def Exit(self):
576 548
         pass
577 549
 
578
-#====================================  
550
+#====================================  
551
+
552
+class CheckMissOn(State):
553
+    def __init__(self,FSM):
554
+        super(CheckMissOn, self).__init__(FSM)    
555
+        
556
+    def Enter(self):
557
+        self.FSM.stateLife = 1
558
+        super(CheckMissOn, self).Enter()        
559
+        o = self.FSM.owner
560
+        g = o.me['game']
561
+        g.sound_man.queue_sound(['check_miss', o.cont, g.camera]) 
562
+    def Execute(self):
563
+        self.FSM.stateLife += 1
564
+        o = self.FSM.owner
565
+        g = o.me['game']
566
+
567
+        length = 3
568
+        sr = -.35
569
+        sm = .4
570
+
571
+        if self.FSM.stateLife < length + 2:
572
+            sr = sr * (self.FSM.stateLife / (length + 2))
573
+            sm = sm * (self.FSM.stateLife / (length + 2))
574
+            #print(sr, sm, 'hittting')    
575
+
576
+        
577
+        o.stick.applyRotation([0, sr, 0], True)                    
578
+        o.stick.applyMovement([sm, 0, 0], True)
579
+
580
+        if o.kb_ua != 1:
581
+            self.FSM.ToTransition('toCheckMissOff')
582
+    
583
+    def Exit(self):
584
+        pass
585
+
586
+#====================================  
587
+
588
+class CheckMissOff(State):
589
+    def __init__(self,FSM):
590
+        super(CheckMissOff, self).__init__(FSM)    
591
+        
592
+    def Enter(self):
593
+        self.FSM.stateLife = 1
594
+        super(CheckMissOff, self).Enter()        
595
+        
596
+    def Execute(self):
597
+        self.FSM.stateLife += 1
598
+        o = self.FSM.owner
599
+        g = o.me['game']
600
+        self.FSM.ToTransition('toGetPuck')
601
+    
602
+    def Exit(self):
603
+        pass
604
+
605
+#====================================  
606
+
607
+
608
+class CheckOn(State):
609
+    def __init__(self,FSM):
610
+        super(CheckOn, self).__init__(FSM)    
611
+        
612
+    def Enter(self):
613
+        self.FSM.stateLife = 1
614
+        super(CheckOn, self).Enter()        
615
+        o = self.FSM.owner
616
+        g = o.me['game']
617
+        g.sound_man.queue_sound(['check', o.cont, g.camera]) 
618
+
619
+    def Execute(self):
620
+        self.FSM.stateLife += 1
621
+        o = self.FSM.owner
622
+        g = o.me['game']
623
+
624
+        length = 3
625
+        sr = -.35
626
+        sm = .4
627
+
628
+        if self.FSM.stateLife < length + 2:
629
+            sr = sr * (self.FSM.stateLife / (length + 2))
630
+            sm = sm * (self.FSM.stateLife / (length + 2))
631
+            #print(sr, sm, 'hittting')    
632
+
633
+        
634
+        o.stick.applyRotation([0, sr, 0], True)                    
635
+        o.stick.applyMovement([sm, 0, 0], True)
636
+
637
+        if o.kb_ua != 1:
638
+            self.FSM.ToTransition('toCheckOff')
639
+    
640
+    def Exit(self):
641
+        pass
642
+
643
+#====================================  
644
+
645
+class CheckOff(State):
646
+    def __init__(self,FSM):
647
+        super(CheckOff, self).__init__(FSM)    
648
+        
649
+    def Enter(self):
650
+        self.FSM.stateLife = 1
651
+        super(CheckOff, self).Enter()        
652
+        
653
+    def Execute(self):
654
+        self.FSM.stateLife += 1
655
+        o = self.FSM.owner
656
+        g = o.me['game']
657
+        self.FSM.ToTransition('toGetPuck')
658
+    
659
+    def Exit(self):
660
+        pass
661
+
662
+#====================================  
663
+
664
+class Checked(State):
665
+    def __init__(self,FSM):
666
+        super(Checked, self).__init__(FSM)    
667
+        
668
+    def Enter(self):
669
+        self.FSM.stateLife = 1
670
+        super(Checked, self).Enter() 
671
+        o = self.FSM.owner
672
+        self.checker = o.checked 
673
+        o.checked = None      
674
+        
675
+    def Execute(self):
676
+        self.FSM.stateLife += 1
677
+        o = self.FSM.owner
678
+        g = o.me['game']
679
+
680
+        tilt = -.01
681
+        
682
+        local = o.cont.worldOrientation.inverted() * (self.checker.cont.worldPosition - o.cont.worldPosition) 
683
+        print(local)
684
+        if local.x > 0:
685
+            #target is in front
686
+            print('in front')
687
+            pass
688
+        else:
689
+            #target is behind
690
+            print('behind')
691
+            pass
692
+        if local.y > 0:
693
+                 #object on right
694
+            print('on right')
695
+            rot = 'right'
696
+            o.body.applyRotation([-tilt, 0, 0], True)
697
+            o.head.applyRotation([(-tilt * 1.2), 0, 0], True) 
698
+        else:
699
+                 #object is on left 
700
+            print('on left')
701
+            rot = 'left'       
702
+            o.body.applyRotation([tilt, 0, 0], True)        
703
+            o.head.applyRotation([(tilt * 1.2), 0, 0], True)     
704
+
705
+
706
+
707
+        tilt2 = -.02
708
+
709
+        o.body.applyRotation([0, tilt2, 0], True)     
710
+        o.head.applyRotation([0, (tilt2 * 1.2), 0], True) 
711
+        if self.FSM.stateLife > 20:
712
+            self.FSM.ToTransition('toDefendPuck')
713
+    
714
+    def Exit(self):
715
+        pass
716
+
717
+#====================================  
718
+

+ 73
- 25
scripts/player.py View File

@@ -49,8 +49,8 @@ class team:
49 49
         for x in self.players:
50 50
             #a_list.append(str(x.FSM.FSM.curState.__class__.__name__))
51 51
             a_list.append(x.user)
52
-        if self.name == 'a':
53
-            print(a_list)
52
+        #if self.name == 'a':
53
+            #print(a_list)
54 54
 
55 55
         
56 56
 class game:
@@ -222,6 +222,7 @@ class hockey_player():
222 222
         self.contr = contr
223 223
         self.state = 'chasing'
224 224
         self.shooting = False
225
+        self.checked = None
225 226
         self.passing = 0
226 227
         self.pass_id = 0
227 228
         self.player_col = 'adfadf'
@@ -323,7 +324,7 @@ class hockey_player():
323 324
             
324 325
             self.body.alignAxisToVect([0,0,1], 2, .02)
325 326
             self.head.alignAxisToVect([0,0,1], 2, .02)            
326
-        #self.stick.alignAxisToVect([0,0,1], 2, .005)
327
+        self.stick.alignAxisToVect([0,0,1], 2, .005)
327 328
         
328 329
         self.cont.linearVelocity.y *= .98   
329 330
                  
@@ -373,7 +374,7 @@ class hockey_player():
373 374
         mates = self.mates.p_closest.copy()
374 375
         mates.remove(self)
375 376
         since_switch_a = g.frame - self.mates.switch_player_frame[2]
376
-        print(mates, since_switch_a)
377
+        #print(mates, since_switch_a)
377 378
         for m in mates:
378 379
             m.user = 0
379 380
         if since_switch_a > 30:
@@ -398,17 +399,60 @@ class hockey_player():
398 399
                 self.puck = True
399 400
                 if self.mates.user > 0:
400 401
                     self.user = 1 
401
-                    print('check_puck function switching user') 
402
+                    #print('check_puck function switching user') 
402 403
                 self.FSM.FSM.ToTransition('toPosesPuck')
403 404
                 self.state = 'possession' 
405
+
406
+
407
+    def check_check(self):
408
+        if self.kb_ua == 1:
409
+
410
+            #sorted(listasdf, key=lambda x: x[1])
411
+
412
+            distances = []
413
+            for w in self.whiskers:
414
+                if w[0] is not None:
415
+                    if w[0].name == 'player_controller':
416
+                    #make list of whiskers and distances
417
+                        d = self.cont.getDistanceTo(w[1])
418
+                        distances.append([w, d])
419
+            if distances != []:
420
+                #sort list of whiskers
421
+                nd = sorted(distances, key=lambda x: x[1])
422
+                for a in nd:
423
+                    print(a[0][0]['name'], a[1])
424
+                print('----')
425
+                #sort list of whiskers
426
+                if nd[0][1] < 1.1:
427
+                    self.FSM.FSM.ToTransition('toCheckOn') 
428
+                    print(nd[0][0][0]['c_ref'])
429
+                    nd[0][0][0]['c_ref'].checked = self                          
430
+                else:    
431
+                    self.FSM.FSM.ToTransition('toCheckMissOn')        
432
+            else:        
433
+                self.FSM.FSM.ToTransition('toCheckMissOn')        
434
+
435
+    def check_checked(self):
436
+        if self.checked == True:
437
+            #self.checked = False
438
+            print('--------checked')
439
+            return True    
440
+        else:
441
+            return False  
442
+
443
+    def simple_align(self, strength):
444
+        self.base.worldOrientation = self.cont.worldOrientation
445
+        self.body.alignAxisToVect([0,0,1], 2, strength)
446
+        self.head.alignAxisToVect([0,0,1], 2, strength * .8)            
447
+        self.stick.alignAxisToVect([0,0,1], 2, strength)  
404 448
               
405 449
     def update(self):
406 450
         if self.teammates == []:
407 451
             self.puck = False
408
-            print(self.me['game'].team_a, self.me['game'].players)
452
+            #print(self.me['game'].team_a, self.me['game'].players)
409 453
             if self.me['game'].team_a_user == 1:
410 454
                 if self.me['game'].team_a[2] == self:
411
-                    print('this is number 1')
455
+                    #print('this is number 1')
412 456
                     self.user = 1
413 457
                 else:
414 458
                     self.user = 0                
@@ -460,16 +504,16 @@ class hockey_player():
460 504
                 if state != 'Passing':
461 505
                     self.FSM.FSM.ToTransition('toPassing')
462 506
                                         
463
-            if self.kb_ua == 1 and self.puck == False:
464
-                self.stick.applyRotation([0, -.35, 0], True)                    
465
-                self.stick.applyMovement([.4, 0, 0], True)
466
-                if self.last_kb_ua == False:
467
-                    self.me['game'].sound_man.queue_sound(['check', self.cont, self.me['game'].camera])
468
-                    print('hit sound')
469
-            if self.kb_ua == 1 and self.puck == True:
470
-                a = str(self.FSM.FSM.curState.__class__.__name__)
471
-                if state != 'Dumping':
472
-                    self.FSM.FSM.ToTransition('toDumping')   
507
+            # if self.kb_ua == 1 and self.puck == False:
508
+            #     self.stick.applyRotation([0, -.35, 0], True)                    
509
+            #     self.stick.applyMovement([.4, 0, 0], True)
510
+            #     if self.last_kb_ua == False:
511
+            #         self.me['game'].sound_man.queue_sound(['check', self.cont, self.me['game'].camera])
512
+            #         print('hit sound')
513
+            # if self.kb_ua == 1 and self.puck == True:
514
+            #     a = str(self.FSM.FSM.curState.__class__.__name__)
515
+            #     if state != 'Dumping':
516
+            #         self.FSM.FSM.ToTransition('toDumping')   
473 517
 
474 518
             self.user_movement()                
475 519
                 
@@ -507,17 +551,21 @@ def puck(cont):
507 551
             own.worldPosition.x = 11.5
508 552
         if own.worldPosition.x < -12:
509 553
             own.worldPosition.x = -11.5
510
-        if own.worldPosition.y > 7:
511
-            own.worldPosition.y = 6.5
512
-        if own.worldPosition.y < -7:
513
-            own.worldPosition.y = -6.5  
554
+        if own.worldPosition.y > 8.5:
555
+            own.worldPosition.y = 7.5
556
+        if own.worldPosition.y < -8.5:
557
+            own.worldPosition.y = -7.5  
514 558
             
515 559
         if cont.sensors['puck-player'].hitObject is not None:
516 560
             ho = cont.sensors['puck-player'].hitObject
517 561
             if 'post' in ho:
518 562
                 print('POST!!!!')
519
-                g.sound_man.queue_sound(['post', g.puck, g.camera])                                
520
-          
563
+                g.sound_man.queue_sound(['post', g.puck, g.camera]) 
564
+            if 'board' in ho:
565
+                print('BOARD!!!!')
566
+                if g.frame - g.sound_man.board_played > 30:
567
+                    g.sound_man.queue_sound(['board', g.puck, g.camera])                                                
568
+                    g.sound_man.board_played = g.frame 
521 569
         if not g.a_team.possession and not g.b_team.possession:                  
522 570
             if cont.sensors['puck-player'].hitObject is not None:
523 571
                 ho = cont.sensors['puck-player'].hitObject
@@ -532,5 +580,5 @@ def puck(cont):
532 580
                     print('GOOOAAAALLL!!', o['team'])
533 581
                     g.FSM.FSM.ToTransition('toGoalScored')
534 582
 
535
-                    if 'a2' in cont.sensors['puck-player'].hitObject['name']:
536
-                        pass
583
+                    #if 'a2' in cont.sensors['puck-player'].hitObject['name']:
584
+                        #pass

+ 4
- 1
scripts/sound_man.py View File

@@ -7,9 +7,12 @@ import aud
7 7
 def init_sounds(self):
8 8
 	#pop
9 9
 
10
+	self.check_miss = sounds('check_miss')
10 11
 	self.check = sounds('check')
11 12
 	self.shoot = sounds('shoot')
12
-	self.post = sounds('post')		
13
+	self.post = sounds('post')
14
+	self.board = sounds('board')		
15
+	self.board_played = 0
13 16
 
14 17
 
15 18
 class sound_manager:

+ 3
- 3
scripts/utils.py View File

@@ -8,7 +8,7 @@ def update_whiskers(self):
8 8
 
9 9
     #cast all whisker rays
10 10
     l = len(self.whisker_objs)
11
-    print(l)
11
+    #print(l)
12 12
     #for w in self.whisker_objs:
13 13
     while iter < l:
14 14
         rc = o.cont.rayCast(self.whisker_objs[iter].worldPosition,
@@ -28,10 +28,10 @@ def update_whiskers(self):
28 28
     for w in self.whiskers:
29 29
         color = [0,1,0]
30 30
         if w[0] is not None:
31
-            if 'player' in w[0]:
31
+            if 'player' in w[0] or 'puck' in w[0]:
32 32
                 color = [1,0,0]        
33 33
 
34
-                print(w[0])
34
+                #print(w[0])
35 35
         #print(self.whiskers)
36 36
         bge.render.drawLine(o.cont.worldPosition, self.whisker_objs[iter].worldPosition, color)
37 37
         iter += 1

+ 3
- 0
sounds/board.wav View File

@@ -0,0 +1,3 @@
1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:f3f7e545f07588fb560102f0a89b047dcbec1268bd6d661c876e518872598e3d
3
+size 51468

+ 2
- 2
sounds/check.wav View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:37c72948d61bfc11063a063ca80b18ac1a3efcd4bcc821a88b2cb6710620c1fa
3
-size 20264
2
+oid sha256:e335cf57276830d08e7c5259eceff1393220fb31ab259ba03b06a3f29375409e
3
+size 96248

+ 3
- 0
sounds/check_miss.wav View File

@@ -0,0 +1,3 @@
1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:37c72948d61bfc11063a063ca80b18ac1a3efcd4bcc821a88b2cb6710620c1fa
3
+size 20264

Loading…
Cancel
Save