示例#1
0
 public Human(World w, bool immunity)
 {
     Humans++;
     index = Humans;
     immune = immunity;
     world = w;
     x = rand.Next(world.Width-10)+5;
     y = rand.Next(world.Height-10)+5;
     health = 100;
     ticksSick = 0;
     dir = (Direction)rand.Next(7);
     speed = SpeedNum.Walk;
     alive = true;
     panic = false;
 }
示例#2
0
        private void Gui_Load(object sender, EventArgs e)
        {
            zombieLand = new World(WIDTH, HEIGHT, HUMANS, IMMUNE);

            for (int r = 0; r < WIDTH; r++)
            {
                zombieLand.SetSpace(0, r, 1);
                zombieLand.SetSpace(r, 0, 1);
                zombieLand.SetSpace(WIDTH-1, r, 1);
                zombieLand.SetSpace(r, WIDTH-1, 1);

                zombieLand.SetSpace(1, r, 1);
                zombieLand.SetSpace(r, 1, 1);
                zombieLand.SetSpace(WIDTH - 2, r, 1);
                zombieLand.SetSpace(r, WIDTH - 2, 1);
            }

            /*
            zombieLand.Humans[0].Speed = Human.SpeedNum.Stop;
            zombieLand.Humans[0].PosX = 200;
            zombieLand.Humans[0].PosY = 200;

            zombieLand.Humans[1].Speed = Human.SpeedNum.Limp;
            zombieLand.Humans[1].Dir = Human.Direction.East;
            zombieLand.Humans[1].PosX = 180;
            zombieLand.Humans[1].PosY = 197;
            */

            bitMap = new Bitmap(WIDTH, HEIGHT);
            graphic = Graphics.FromImage(bitMap);
            guiDisplay.Image = bitMap;
            Display();
        }