Beispiel #1
0
 public bool validHit(Polygon aPolygon,bool mute=false)
 {
     if (polyType == aPolygon.getPolyType () || color == aPolygon.getColor ()) {
         setSprite(aPolygon.getSprite(),aPolygon.getPolyType(),aPolygon.getColor());
         return true;
     }
     if(!mute)
     sound.Play();
     return false;
 }
Beispiel #2
0
 public void hitOther(Polygon aPolygon)
 {
     transform.rigidbody2D.isKinematic = true;
     spriteRenderer.enabled = false;
     GameObject aPartical= Instantiate (player_hit, transform.position, transform.rotation) as GameObject;
     Destroy(aPartical.gameObject,2);
     StartCoroutine ("resetPlayer");
     setSprite(aPolygon.getSprite(),aPolygon.getPolyType(),aPolygon.getColor());
 }