Beispiel #1
0
    //Handles failure state
    public void ReceiveEvent(CustomEvent evt)
    {
        if(evt.GetEventName() == "Time Up")
        {
            //game over
            gameOver = 1;
            StartCoroutine(pause());

        }
    }
Beispiel #2
0
    public void RecieveEvent(CustomEvent evt)
    {
        if(evt.GetEventName() == "Sword Attack")
        {
            int evtX, evtY, x, y;
            evtX = evt.GetParam(0);
            evtY = evt.GetParam(1);
            x = (int)transform.position.x;
            y = (int)transform.position.y;

            float distance = Vector3.Distance(transform.position, new Vector3(evtX, evtY, 0.0f));

            if(distance < 120.0f)
            {
                this.takeDamage(1, evt.GetParam(2));
            }
        }
    }
Beispiel #3
0
    void RecieveEvent(CustomEvent evt)
    {
        if(evt.GetEventName() == "Sword Attack")
        {
            int evtX, evtY;
            evtX = evt.GetParam(0);
            evtY = evt.GetParam(1);

            float distance = Vector3.Distance(transform.position, new Vector3(evtX, evtY, 0.0f));

            if(distance < 40.0f)
            {
                this.takeDamage((int)ATTACK_TYPE.MELEE, evt.GetParam(2));
            }
        }
    }