Example #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        GameObject obj = collision.gameObject;

        if (PlayerZone.IsOutside && !MessageSystemPlayingScene.Player.CompareTag("InVisible") && !MessageSystemPlayingScene.IsDead)
        {
            PlayerZone.MoveToPlayerZone();
        }
        if ((obj.CompareTag("Player") || (obj.CompareTag("Hit") && obj.name == "Brian")) && MessageSystemPlayingScene.IsJump)
        {
            MessageSystemPlayingScene.exitFromPingPong = false;
            if (!PlayerZone.IsOutside)
            {
                MessageSystemPlayingScene.SetDefaultConstraints();
            }
            else
            {
                MessageSystemGameBlock.SetPlayingConstraints();
            }
            if (Conecting.Management == 0 && !TapToGo.Screen.activeInHierarchy)
            {
                TapToGo.Screen.SetActive(true);
            }
            MessageSystemPlayingScene.IsJump = false;
            MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsRunAgain", true);
            StartCoroutine(PreparationToJump());
        }
    }
Example #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !MessageSystemPlayingScene.inPingPong)
     {
         MessageSystemPlayingScene.InBodyColider = true;
         MessageSystemGameBlock.SetPlayingConstraints();
     }
 }
Example #3
0
 private void OnCollisionExit2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         onCube = true;
         MessageSystemPlayingScene.IsJump = true;
         MessageSystemGameBlock.SetPlayingConstraints();
     }
 }
Example #4
0
 public void ExitFromTeleport()
 {
     if (!PlayerZone.IsOutside)
     {
         MessageSystemPlayingScene.SetDefaultConstraints();
     }
     else
     {
         MessageSystemGameBlock.SetPlayingConstraints();
     }
     MessageSystemPlayingScene.Player.tag = "Player";
 }
Example #5
0
 public void JumpBeforBrianHit()
 {
     MessageSystemPlayingScene.IsJump = true;
     PlayerZone.SetNoneRigid();
     MessageSystemGameBlock.SetPlayingConstraints();
     if (!MessageSystemPlayingScene.exitFromPingPong)
     {
         MessageSystemPlayingScene.exitFromPingPong = true;
     }
     if (!MessageSystemPlayingScene.IsDead)
     {
         WaitingScreen.wait(MessageSystemPlayingScene.DisableCollider());
         MessageSystemPlayingScene.Player.GetComponent <Rigidbody2D>().AddForce(new Vector2(0, 9), ForceMode2D.Impulse);
     }
 }
Example #6
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Player") && !MessageSystemPlayingScene.IsJump)
     {
         if (!PlayerZone.IsOutside)
         {
             MessageSystemPlayingScene.SetDefaultConstraints();
         }
         else
         {
             MessageSystemGameBlock.SetPlayingConstraints();
         }
         MessageSystemPlayingScene.SetVisibleImagePlayer(true);
         MessageSystemPlayingScene.InBodyColider = false;
     }
 }
Example #7
0
    IEnumerator Wait()
    {
        while (MessageSystemPlayingScene.inPingPong)
        {
            yield return(null);
        }
        float motorSpeed;
        int   index = (int)MessageSystemPlayingScene.Hash[MessageSystemPlayingScene.Player.name];

        motorSpeed = (float)storageVoid["0", index.ToString()]();

        var motor = slide.motor;

        motor.motorSpeed = motorSpeed;
        slide.motor      = motor;
        MessageSystemPlayingScene.Player.SetActive(true);
        slide.connectedBody = MessageSystemPlayingScene.Player.gameObject.GetComponent <Rigidbody2D>();
        MessageSystemGameBlock.SetPlayingConstraints();
    }
 public static void Jump()
 {
     if (!StopCollider.IsCollision)
     {
         float powerJump = 10;
         isJump = true;
         PlayerZone.SetNoneRigid();
         MessageSystemGameBlock.SetPlayingConstraints();
         if (!exitFromPingPong)
         {
             exitFromPingPong = true;
             player.tag       = "Player";
         }
         if (!isDead)
         {
             WaitingScreen.wait(DisableCollider());
             player.GetComponent <Rigidbody2D>().AddForce(new Vector3(0, powerJump, 0), ForceMode2D.Impulse);
             player.GetComponent <Animator>().SetBool("IsJumpUp", true);
         }
     }
 }
Example #9
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (PlayerZone.IsOutside)
     {
         PlayerZone.MoveToPlayerZone();
     }
     if (collision.gameObject.CompareTag("Player") && MessageSystemPlayingScene.IsJump && !Cube.IsCollision)
     {
         MessageSystemPlayingScene.exitFromPingPong = false;
         if (!PlayerZone.IsOutside)
         {
             MessageSystemPlayingScene.SetDefaultConstraints();
         }
         else
         {
             MessageSystemGameBlock.SetPlayingConstraints();
         }
         MessageSystemPlayingScene.IsJump = false;
         MessageSystemPlayingScene.Player.GetComponent <Animator>().SetBool("IsRunAgain", true);
         StartCoroutine(PreparationToJump());
     }
 }
    public static void SelectHero(GameObject hero)
    {
        foreach (GameObject obj in circle)
        {
            if (obj.name == hero.name)
            {
                obj.GetComponent <Animation>().Play("RizeCircle");
            }
            else if (playerName == obj.name)
            {
                obj.GetComponent <Animation>().Play("ReduceCircle");
                if (IsActiveColider(playerName))
                {
                    obj.GetComponentInChildren <BoxCollider2D>().enabled = true;
                }
                else
                {
                    ChangeToCrossSprite(obj);
                }
            }
            else
            {
                if (IsActiveColider(obj.name))
                {
                    obj.GetComponentInChildren <BoxCollider2D>().enabled = true;
                }
            }
        }
        playerName = hero.name;
        player.SetActive(false);
        Vector2 positionLastPlayer = player.transform.position;
        string  nameLastPlayer     = player.name;

        if (!isStart)
        {
            storageVoid[0, (int)hash[playerName]]();
        }
        else
        {
            ChangeHeroAfterStart();
        }
        if (IsStart && IsActiveColider(nameLastPlayer))
        {
            player.transform.position = positionLastPlayer;
        }
        if (player.transform.position.x >= 0)
        {
            PlayerZone.IsOutside = false;
            PlayerZone.SetNoneRigid();
        }
        if (PlayerZone.IsOutside && !isDead)
        {
            PlayerZone.MoveToPlayerZone();
        }
        if (isJump && !isDead)
        {
            MessageSystemGameBlock.SetPlayingConstraints();
        }
        if (!animationDeathIsFinished)
        {
            MessageSystemGameBlock.StartGame();
            isDead = false;
            EnableCollider();
        }
        DeadLine.IsDeadLine = false;
        player.SetActive(true);
    }