Ejemplo n.º 1
0
 public void touchPigeon(pigeon p)
 {
     if (this.AlreadyTouchedPigeon)
     {
         return; // nothing to do if we already touched the pigeon
     }
     game.getInstance().AddScore(game.SCORE_PER_MESSAGE);
     // Else, we drop the message from our hand and we heal the pigeon
     dropMessage();
     this.AlreadyTouchedPigeon = true;
     p.Health = Mathf.Min(pigeon.PIGEON_ALLY_HEALTH_BOOST + p.Health, pigeon.PIGEON_STARTING_HEALTH);
     healthUI.getInstance().blink();
 }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        nameIt();
        pigeon pigeon         = pigeon.getInstance();
        var    pCollider      = pigeon.getInstance().GetComponent <Collider>();
        var    pigeonPosition = pCollider.transform.position;
        // Add velocity to the bullet
        var heading = pigeonPosition + new Vector3(0, PIGEON_SHOOT_DIRECTION_Y_OFFSET, 0) - this.transform.position;

        //heading.y = 0;
        //var distance = heading.magnitude;
        //this.direction = heading / distance;

        //this rotates the bullet to face the pigeon
        //Vector2 dir = this.transform.position - pigeon.transform.position;
        this.transform.right = heading.normalized;
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     pigeon.singleTon = this;
 }