Ejemplo n.º 1
0
    public void SendPlayerFire(int force, int angle)
    {
        // PlayerController enemyControl = mainPlayerController;
        // foreach(PlayerController pc in playerControllers){
        //  if (pc.info.id != mainPlayerController.info.id){
        //      enemyControl = pc;
        //      break;
        //  }
        // }
        Vector2 pPos = foreController.WorldPositionToPixel(mainPlayerController.transform.position, true);

        // if (isOnLocalTest){
        //  Debug.Log("Main Player Fired: " + ((int)(mainPlayerController.isHeadingRight?(byte)1:(byte)255)).ToString());
        //  Debug.Log("Main Player Fired: " + ((int)pPos.x).ToString() + ", "+
        //               ((int)pPos.y).ToString() + ", " + force.ToString()+ ", " + angle.ToString());
        //  return;
        // }
        connector.SendDirection(mainPlayerController.isHeadingRight?(byte)1:(byte)255);
        //Send ShootTag and Shoot packet
        // byte tim = ((byte)(countDownController.initSeconds - ((int)countDownController.timer)));
        byte tim = ((byte)(int)countDownController.timer);

        connector.SendShoot((int)pPos.x, (int)pPos.y - 30, force, angle, (byte)tim);
    }