Beispiel #1
0
    // Send the soul to a portal
    public void SendTheSoul(EikiJudge_Controller.Direction judgementDirection)
    {
        if (judgementDirection == EikiJudge_Controller.Direction.left)
        {
            targetPortal = new Vector3(-4.35f, 2.5f);
        }
        else
        {
            targetPortal = new Vector3(4.35f, 2.5f);
        }

        soulTrajectory = (targetPortal - transform.position).normalized;

        // If the soul is not sent to the right portal -> loose
        if (judgementDirection != rightPortalDirection)
        {
            EikiJudge_Controller.controller.LoseGame();
        }
    }
    private void Awake()
    {
        controller = this;

        // randomly flip position of the heaven/hell portals
        if (Random.value > 0.5f)
        {
            heavenTransform.position = new Vector2(heavenTransform.position.x * -1, heavenTransform.position.y);
            hellTransform.position   = new Vector2(hellTransform.position.x * -1, hellTransform.position.y);

            hellDirection   = EikiJudge_Controller.Direction.right;
            heavenDirection = EikiJudge_Controller.Direction.left;
        }
        else
        {
            hellDirection   = EikiJudge_Controller.Direction.left;
            heavenDirection = EikiJudge_Controller.Direction.right;
        }
    }
Beispiel #3
0
    // Key input / move Eiki's arm / set a direction for the soul
    void EikiJudgement()
    {
        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            judgementDirection = EikiJudge_Controller.Direction.left;
        }

        else if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            judgementDirection = EikiJudge_Controller.Direction.right;
        }

        else if (Input.GetKeyUp(KeyCode.LeftArrow) || Input.GetKeyUp(KeyCode.RightArrow))
        {
            judgementDirection = EikiJudge_Controller.Direction.none;
        }
        else
        {
            judgementDirection = EikiJudge_Controller.Direction.none;
        }
    }
Beispiel #4
0
    private void Start()
    {
        // Randomize bad/good soul
        if (Random.value > 0.5f)
        {
            soulRenderer.sprite  = goodSoulSprite;
            rightPortalDirection = EikiJudge_PortalsController.controller.heavenDirection;
        }
        else
        {
            soulRenderer.sprite  = badSoulSprite;
            rightPortalDirection = EikiJudge_PortalsController.controller.hellDirection;
        }
        print("soul " + soulListPosition + " right portal is " + rightPortalDirection);

        // If this soul must be late
        if (EikiJudge_Controller.controller.lastSoulIsLate && (soulListPosition + 1) == EikiJudge_Controller.controller.soulsNumber)
        {
            soulIsLate = true;
        }

        // Put some delay before moving in front of Eiki
        Invoke("MoveToCourtDelay", delay * soulListPosition);
    }
    private void Start()
    {
        // Randomize bad/good soul
        if (Random.value > 0.5f)
        {
            soulRenderer.sprite  = goodSoulSprite;
            rightPortalDirection = EikiJudge_PortalsController.controller.heavenDirection;
        }
        else
        {
            soulRenderer.sprite  = badSoulSprite;
            rightPortalDirection = EikiJudge_PortalsController.controller.hellDirection;
        }

        // If this soul must be late
        if (EikiJudge_Controller.controller.lastSoulIsLate && (soulListPosition + 1) == EikiJudge_Controller.controller.soulsNumber)
        {
            soulIsLate = true;
        }

        // Put some delay before moving in front of Eiki
        // delay is multiplied by index, so the first delay is null (multiplied by index 0)
        Invoke("MoveToCourt", delay * soulListPosition);
    }