Ejemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     currentComponent = Enums.Components.bone;
     max_bones        = 0;
     max_cloth        = 0;
     max_goo          = 0;
     DoCheckpoint();
 }
Ejemplo n.º 2
0
    int HowMany(Enums.Components component)
    {
        switch (component)
        {
        case Enums.Components.bone:
            return(num_bones);

        case Enums.Components.cloth:
            return(num_cloth);

        case Enums.Components.goo:
            return(num_goo);
        }
        return(0);
    }
Ejemplo n.º 3
0
    void Increase(Enums.Components component)
    {
        switch (component)
        {
        case Enums.Components.bone:
            num_bones += 1;
            break;

        case Enums.Components.cloth:
            num_cloth += 1;
            break;

        case Enums.Components.goo:
            num_goo += 1;
            break;
        }
    }
Ejemplo n.º 4
0
    void Reduce(Enums.Components component)
    {
        switch (component)
        {
        case Enums.Components.bone:
            num_bones -= 1;
            break;

        case Enums.Components.cloth:
            num_cloth -= 1;
            break;

        case Enums.Components.goo:
            num_goo -= 1;
            break;
        }
    }
Ejemplo n.º 5
0
    public void NewItem(Enums.Components component)
    {
        switch (component)
        {
        case Enums.Components.bone:
            max_bones += 1;
            num_bones += 1;
            break;

        case Enums.Components.cloth:
            max_cloth += 1;
            num_cloth += 1;
            break;

        case Enums.Components.goo:
            max_goo += 1;
            num_goo += 1;
            break;
        }
    }
Ejemplo n.º 6
0
        public override Component CreateComponent(Enums.Components component, double height, double width, double leftLoc, double topLoc, string content)
        {
            Component c = null;

            if (component == Enums.Components.Button)
            {
                c = new HTMLButton()
                {
                    Content = content, Height = height, Width = width, TopLoc = topLoc, LeftLoc = leftLoc
                }
            }
            ;
            else if (component == Enums.Components.Circle)
            {
                c = new Circle()
                {
                    Content = content, Height = height, Width = width, TopLoc = topLoc, LeftLoc = leftLoc
                }
            }
            ;
            else if (component == Enums.Components.Image)
            {
                c = new Image()
                {
                    Content = content, Height = height, Width = width, TopLoc = topLoc, LeftLoc = leftLoc
                }
            }
            ;
            else if (component == Enums.Components.Textbox)
            {
                c = new HTMLTextbox()
                {
                    Content = content, Height = height, Width = width, TopLoc = topLoc, LeftLoc = leftLoc
                }
            }
            ;

            return(c);
        }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     component = Enums.Components.none;
 }
Ejemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetAxis("Horizontal") > 0)
        {
            if (!justPressed)
            {
                switch (currentComponent)
                {
                case Enums.Components.bone:
                    currentComponent = Enums.Components.cloth;
                    break;

                case Enums.Components.cloth:
                    currentComponent = Enums.Components.goo;
                    break;
                }
                justPressed = true;
            }
        }
        else if (Input.GetAxis("Horizontal") < 0)
        {
            if (!justPressed)
            {
                switch (currentComponent)
                {
                case Enums.Components.goo:
                    currentComponent = Enums.Components.cloth;
                    break;

                case Enums.Components.cloth:
                    currentComponent = Enums.Components.bone;
                    break;
                }
                justPressed = true;
            }
        }
        else
        {
            justPressed = false;
        }

        if (Input.GetButton("Fire2"))
        {
            if (!justPressedButton)
            {
                justPressedButton = true;

                if (summoningCircle2.GetComponent <SummoningCircle>().component != Enums.Components.none)
                {
                    Increase(summoningCircle2.GetComponent <SummoningCircle>().component);
                    summoningCircle2.GetComponent <SummoningCircle>().component = Enums.Components.none;
                }
                else if (summoningCircle1.GetComponent <SummoningCircle>().component != Enums.Components.none)
                {
                    Increase(summoningCircle1.GetComponent <SummoningCircle>().component);
                    summoningCircle1.GetComponent <SummoningCircle>().component = Enums.Components.none;
                }
                else
                {
                    player.GetComponent <Player>().StopSummoning();
                    gameObject.SetActive(false);
                    summoningCircle1.SetActive(false);
                    summoningCircle2.SetActive(false);
                }
            }
        }
        else if (Input.GetButton("Fire1"))
        {
            if (!justPressedButton)
            {
                justPressedButton = true;

                if (summoningCircle1.GetComponent <SummoningCircle>().component == Enums.Components.none)
                {
                    if (HowMany(currentComponent) > 0)
                    {
                        summoningCircle1.GetComponent <SummoningCircle>().component = currentComponent;
                        Reduce(currentComponent);
                    }
                }
                else if (summoningCircle2.GetComponent <SummoningCircle>().component == Enums.Components.none)
                {
                    if (HowMany(currentComponent) > 0)
                    {
                        summoningCircle2.GetComponent <SummoningCircle>().component = currentComponent;
                        Reduce(currentComponent);
                    }
                }
                else
                {
                    player.GetComponent <Player>().StopSummoning();
                    gameObject.SetActive(false);
                    summoningCircle1.SetActive(false);
                    summoningCircle2.SetActive(false);
                    Summon();
                }
            }
        }
        else
        {
            justPressedButton = false;
        }

        MoveArrow();

        SetVisibleNumbers();
    }
Ejemplo n.º 9
0
    void Summon()
    {
        Enums.Components c1 = summoningCircle1.GetComponent <SummoningCircle>().component;
        Enums.Components c2 = summoningCircle2.GetComponent <SummoningCircle>().component;
        if ((c1 == Enums.Components.bone && c2 == Enums.Components.cloth) || (c2 == Enums.Components.bone && c1 == Enums.Components.cloth))
        {
            GameObject mob = Instantiate(zombiePrefab);
            mob.transform.position = player.transform.position + new Vector3(0, 0.2f);
            if (player.GetComponent <Player>().IsFacingRight())
            {
                mob.GetComponent <Zombie>().direction = Zombie.Directions.right;
            }
            else
            {
                mob.GetComponent <Zombie>().direction = Zombie.Directions.left;
            }
        }
        else if ((c1 == Enums.Components.bone && c2 == Enums.Components.bone))
        {
            GameObject mob = Instantiate(skeletonPrefab);
            mob.transform.position = player.transform.position + new Vector3(0, 0.2f);
            if (player.GetComponent <Player>().IsFacingRight())
            {
                mob.GetComponent <Skeleton>().direction = Skeleton.Directions.right;
            }
            else
            {
                mob.GetComponent <Skeleton>().direction = Skeleton.Directions.left;
            }
        }
        else if ((c1 == Enums.Components.goo && c2 == Enums.Components.goo))
        {
            GameObject mob = Instantiate(slimePrefab);
            mob.transform.position = player.transform.position + new Vector3(0, 0.2f);
            if (player.GetComponent <Player>().IsFacingRight())
            {
                mob.GetComponent <Slime>().direction = Slime.Directions.right;
            }
            else
            {
                mob.GetComponent <Slime>().direction = Slime.Directions.left;
            }
        }
        else if ((c1 == Enums.Components.cloth && c2 == Enums.Components.cloth))
        {
            GameObject mob = Instantiate(mummyPrefab);
            mob.transform.position = player.transform.position + new Vector3(0, 0.2f);
            mob.transform.position = new Vector3(Mathf.Round(mob.transform.position.x + 0.5f) - 0.5f, mob.transform.position.y);
        }
        else if ((c1 == Enums.Components.cloth && c2 == Enums.Components.goo) || (c2 == Enums.Components.cloth && c1 == Enums.Components.goo))
        {
            GameObject mob = Instantiate(ghostPrefab);
            mob.transform.position = player.transform.position + new Vector3(0, 0.2f);
            if (player.GetComponent <Player>().IsFacingRight())
            {
                mob.GetComponent <Ghost>().direction = Ghost.Directions.right;
            }
            else
            {
                mob.GetComponent <Ghost>().direction = Ghost.Directions.left;
            }
        }
        else if ((c1 == Enums.Components.bone && c2 == Enums.Components.goo) || (c2 == Enums.Components.bone && c1 == Enums.Components.goo))
        {
            GameObject mob = Instantiate(fishPrefab);
            mob.transform.position = player.transform.position + new Vector3(0, 0.2f);
            if (player.GetComponent <Player>().IsFacingRight())
            {
                mob.GetComponent <Fishman>().direction = Fishman.Directions.right;
            }
            else
            {
                mob.GetComponent <Fishman>().direction = Fishman.Directions.left;
            }
        }

        summoningCircle2.GetComponent <SummoningCircle>().component = Enums.Components.none;
        summoningCircle1.GetComponent <SummoningCircle>().component = Enums.Components.none;
    }
Ejemplo n.º 10
0
 public abstract Components.Component CreateComponent(Enums.Components component, double height, double width, double leftLoc, double topLoc, string content);