// Use this for initialization
	void Start () 
    {
        clock = GameObject.Find("Clock").GetComponent<ClockBehaviour>();

        acamera = Camera.main.GetComponent<AdvancedCamera>();
        bigEventTimer = 0;
        bigEventMaxTimer = Random.Range(200, 400);
        bigEventObject = Global.getChildGameObject(Camera.main.gameObject, "Clash Event");
	}
    // Use this for initialization
    void Start()
    {
        clock = GameObject.Find("Clock").GetComponent <ClockBehaviour>();

        acamera          = Camera.main.GetComponent <AdvancedCamera>();
        bigEventTimer    = 0;
        bigEventMaxTimer = Random.Range(200, 400);
        bigEventObject   = Global.getChildGameObject(Camera.main.gameObject, "Clash Event");
    }
    public void SetEntity(Vector2 pos, bool isPlayer)
    {
        health = maxHealth;

        this.isPlayer = isPlayer;
        isDead        = false;

        playerScript    = playerObject.GetComponent <Player>();
        top_animator    = Global.getChildGameObject(gameObject, "Animation_top").GetComponent <Animator>();
        bottom_animator = Global.getChildGameObject(gameObject, "Animation_bottom").GetComponent <Animator>();

        mirrored          = false;
        onGround          = false;
        collidingWithWall = false;
        skipNextMove      = false;
        fallTroughBar     = false;
        underBar          = false;
        attackDone        = false;
        dustOnce          = false;
        maxDrunk          = false;
        checkDrunkTimer   = true;
        useMpu            = playerScript.useMpu;
        if (chosenCharacter == Player.Character.FAIRY)
        {
            canDoubleJump = true;
        }
        else
        {
            canDoubleJump = false;
        }

        isHit       = false;
        isAttacking = false;
        isBlocking  = false;
        isDashing   = false;
        isDrinking  = false;

        jumpOnce         = 0;
        attackOnce       = 0;
        attackCooldown   = 0;
        drinkAnimCounter = 0;
        drunkness        = 0;
        drunknessF       = 0f;
        drunkWalkTimer   = 0;
        deathCounter     = 0;

        hitDirection = "filler";

        lastVelocity = new Vector2(0, 2);

        sortOfDrink = Drink.SortOfDrink.NONE;
        Direction   = Facing.RIGHT;

        groundCheck  = Global.getChildGameObject(gameObject, "GroundCheck");
        punchCheck   = Global.getChildGameObject(gameObject, "PunchCheck");
        bodyCheck    = Global.getChildGameObject(gameObject, "BodyCheck");
        wallCheck    = Global.getChildGameObject(gameObject, "WallCheck");
        dustParticle = Global.getChildGameObject(gameObject, "Dust particle");
        groundLayer  = playerObject.GetComponent <LayerMaskPass>().GetLayerMask();

        respawnButtonPos = new Vector2(transform.position.x, transform.position.y - 40);
        healthHud        = playerScript.healthHUD.GetComponentInChildren <HealthHUD>();
        healthHud.SetHealth(health);

        advancedCamera     = Camera.main.GetComponent <AdvancedCamera>();
        this.mpuController = playerScript.mpuController;

        SetDictionary();
    }
    public void SetEntity(Vector2 pos, bool isPlayer)
    {
        health = maxHealth;

        this.isPlayer = isPlayer;
        isDead = false;

        playerScript = playerObject.GetComponent<Player>();
        top_animator = Global.getChildGameObject(gameObject, "Animation_top").GetComponent<Animator>();
        bottom_animator = Global.getChildGameObject(gameObject, "Animation_bottom").GetComponent<Animator>();

        mirrored = false;
        onGround = false;
        collidingWithWall = false;
        skipNextMove = false;
        fallTroughBar = false;
        underBar = false; 
        attackDone = false;
        dustOnce = false;
        maxDrunk = false;
        checkDrunkTimer = true;
        if (chosenCharacter == Player.Character.FAIRY)
            canDoubleJump = true;
        else
            canDoubleJump = false;

        isHit = false;
        isAttacking = false;
        isBlocking = false;
        isDashing = false;
        isDrinking = false;
        
        jumpOnce = 0;
        attackOnce = 0;
        attackCooldown = 0;
        drinkAnimCounter = 0;
        drunkness = 0;
        drunknessF = 0f;
        drunkWalkTimer = 0;
        deathCounter = 0;

        hitDirection = "filler";

        lastVelocity = new Vector2(0, 2);

        sortOfDrink = Drink.SortOfDrink.NONE;
        Direction = Facing.RIGHT;

        groundCheck = Global.getChildGameObject(gameObject, "GroundCheck");
        punchCheck = Global.getChildGameObject(gameObject, "PunchCheck");
        bodyCheck = Global.getChildGameObject(gameObject, "BodyCheck");
        wallCheck = Global.getChildGameObject(gameObject, "WallCheck");
        dustParticle = Global.getChildGameObject(gameObject, "Dust particle");
        groundLayer = playerObject.GetComponent<LayerMaskPass>().GetLayerMask();

        respawnButtonPos = new Vector2(transform.position.x, transform.position.y - 40);
        advancedCamera = Camera.main.GetComponent<AdvancedCamera>();

        SetDictionary();
    }
Beispiel #5
0
        protected void InitGame()
        {
            Root r = Root.Instance;
            Root.Instance.Gui.windows.Clear();

            PlayerCam = new AdvancedCamera(CameraMode.Normal, null, 50);
            PlayerCam.Position = new Vector3(0, 1.5f, 0);
            //PlayerCam.Smooth = true;

            FlyByCam = new AdvancedCamera(CameraMode.FlyBy, null, 1000);
            //FlyByCam.Smooth = true;

            FreeCam = new AdvancedCamera(CameraMode.Normal);
            FreeCam.Position = new Vector3(0, 50, 0);

            RotateCam = new AdvancedCamera(CameraMode.Normal);
            RotateCam.Position = new Vector3(1429, 202, 62);
            RotateCam.rotationspeed.Y = 45.0f / 180.0f * (float)Math.PI;
            RotateCam.Fov = 90;

            Cameras = new AdvancedCamera[] { FlyByCam, PlayerCam, FreeCam, RotateCam };

            r.Scene.camera = FlyByCam;

            CameraControl = new StandardControl(FreeCam);
            CurrentCameraNumber = 0;
        }