Exemple #1
0
            public Zombiestats GetZombiestats()         //esta es una invocacion de la estructura que se encarga de operar todas las estadisticas del zombie
            {
                gustos = (bodyparts)Random.Range(0, 4); //esn esta linea se utiliza la variable gustos que es una variable de tipo bodyparts que es el enum y este se iguala a un random range el cual selecciona entre los 5 elementos del enum
                Zombiestats stats = new Zombiestats();

                if (gustos == bodyparts.Brazos)//luego de que se le asigna uno de los 5 items del enum y en funcion de que parte escoja este imprimira in mensaje en la consola con el elemento asignado
                {
                    stats.partes = bodyparts.Brazos;
                    Debug.Log("Warrrrr soy un zombie y quiero comer" + stats.partes);
                }
                if (gustos == bodyparts.Cerebros)
                {
                    stats.partes = bodyparts.Cerebros;
                    Debug.Log("Warrr soy un zombie y quiero comer" + stats.partes);
                }
                if (gustos == bodyparts.Higado)
                {
                    stats.partes = bodyparts.Higado;
                    Debug.Log("Warrr soy un zombie y quiero comer" + stats.partes);
                }
                if (gustos == bodyparts.Piernas)
                {
                    stats.partes = bodyparts.Piernas;
                    Debug.Log("Warrr soy un zombie y quiero comer" + stats.partes);
                }
                if (gustos == bodyparts.Riñon)
                {
                    stats.partes = bodyparts.Riñon;
                    Debug.Log("Warr soy un zombie y quiero comer" + stats.partes);
                }
                return(stats);//entrega toda la informacion contenida dentro de esta estructura
            }
Exemple #2
0
        void drawbodyparts(bodyparts bp)
        {
            Graphics g = panel1.CreateGraphics();
            Pen      p = new Pen(Color.White, 2);

            if (bp == bodyparts.head)
            {
                g.DrawEllipse(p, 40, 50, 40, 40);
            }
            else if (bp == bodyparts.left_eye)
            {
                SolidBrush c = new SolidBrush(Color.White);
                g.FillEllipse(c, 50, 60, 5, 5);
            }
            else if (bp == bodyparts.right_eye)
            {
                SolidBrush c = new SolidBrush(Color.White);
                g.FillEllipse(c, 63, 60, 5, 5);
            }
            else if (bp == bodyparts.mouth)
            {
                g.DrawArc(p, 50, 60, 20, 20, 45, 90);
            }
            else if ((bp == bodyparts.body))
            {
                g.DrawLine(p, new Point(60, 90), new Point(60, 170));
            }
            else if ((bp == bodyparts.left_arm))
            {
                g.DrawLine(p, new Point(60, 100), new Point(30, 85));
            }
            else if ((bp == bodyparts.right_arm))
            {
                g.DrawLine(p, new Point(60, 100), new Point(90, 85));
            }
            else if ((bp == bodyparts.left_leg))
            {
                g.DrawLine(p, new Point(60, 170), new Point(90, 190));
            }
            else if ((bp == bodyparts.right_leg))
            {
                g.DrawLine(p, new Point(60, 170), new Point(30, 190));
            }
        }
Exemple #3
0
        void drawbodyparts(bodyparts bp)
        {
            Graphics g = panel1.CreateGraphics();
            Pen      p = new Pen(Color.Black, 2);

            if (bp == bodyparts.Head)
            {
                g.DrawEllipse(p, 40, 50, 40, 40);
            }
            else if (bp == bodyparts.Left_Eye)
            {
                SolidBrush s = new SolidBrush(Color.Black);
                g.FillEllipse(s, 50, 60, 5, 5);
            }
            else if (bp == bodyparts.Right_Eye)
            {
                SolidBrush s = new SolidBrush(Color.Black);
                g.FillEllipse(s, 63, 60, 5, 5);
            }
            else if (bp == bodyparts.Mouth)
            {
                g.DrawArc(p, 50, 60, 20, 20, 45, 90);
            }
            else if (bp == bodyparts.Body)
            {
                g.DrawLine(p, new Point(60, 90), new Point(60, 170));
            }
            else if (bp == bodyparts.Left_Arm)
            {
                g.DrawLine(p, new Point(60, 100), new Point(30, 85));
            }
            else if (bp == bodyparts.Right_Arm)
            {
                g.DrawLine(p, new Point(60, 100), new Point(90, 85));
            }
            else if (bp == bodyparts.Left_Leg)
            {
                g.DrawLine(p, new Point(60, 170), new Point(30, 190));
            }
            else if (bp == bodyparts.Right_Leg)
            {
                g.DrawLine(p, new Point(60, 170), new Point(90, 190));
            }
        }