示例#1
0
    // Update is called once per frame
    void Update()
    {
        scoreTimer += Time.deltaTime;
        if (scoreTimer >= 3)
        {
            scoreTimer = 0;
            float tmpScore = data.GetScore();
            if (tmpScore > 10)
            {
                data.SetScore(-10);
            }
        }
        if (data.GetScore() >= 100.0f)
        {
            pooping();
            data.SetScore(-10);
        }
        Moving();

        if (data.GetPlayerState() == playerData.PlayerState.monster)
        {
            timeCount += Time.deltaTime;
            if (timeCount >= 10)
            {
                timeCount -= 10.0f;
                TurnHuman();
            }
        }
    }
示例#2
0
文件: poop.cs 项目: aekly268/Sumo
    private void OnTriggerEnter2D(Collider2D col)
    {
        // score--
        playerData col_data = col.gameObject.GetComponent <playerData>();

        if (col_data.GetPlayerState() == playerData.PlayerState.human)
        {
            col_data.SetScore(-1);
            col.gameObject.GetComponent <player>().stepPoop();
            // pic
        }
        else
        {
            Destroy(gameObject);
        }
    }
示例#3
0
文件: hit.cs 项目: aekly268/Sumo
    void autoShoot()
    {
        autoShootTimer += Time.deltaTime;

        if (data.GetPlayerState() == playerData.PlayerState.monster)
        {
            if (autoShootTimer > data.autoShootTime)
            {
                autoShootTimer = 0;
                body.AddForce(data.GetOppositePlayerPos() * shootStrength, ForceMode2D.Impulse);
                data.SetPlayerPos(playerData.Pos.none);
                data.SetAnimation("fly");
                music.playMusic("shoot");
            }
        }
    }