コード例 #1
0
ファイル: World.cs プロジェクト: XCarrel/Krohonde
        public World()
        {
            InitializeComponent();
            myWorld = new MotherNature(pctWorld.ClientSize.Width, pctWorld.ClientSize.Height);

            RedColony rcolo = new RedColony(new System.Windows.Point(400, 200), myWorld);

            rcolo.Spawn(8);
            myWorld.AddColony(rcolo);
            GreenColony gcolo = new GreenColony(new System.Windows.Point(1400, 200), myWorld);

            gcolo.Spawn(8);
            myWorld.AddColony(gcolo);
            BlueColony bcolo = new BlueColony(new System.Windows.Point(900, 800), myWorld);

            bcolo.Spawn(8);
            myWorld.AddColony(bcolo);
            myWorld.Initialize();
            score = new Score(this);
            score.Show();
        }
コード例 #2
0
 public override void OnceLoad()
 {
     if (!this.AllObjReady)
     {
         this.width  = 2400;
         this.height = 1800;
         myWorld     = new MotherNature(this.width, this.height);
         RedColony rcolo = new RedColony(new System.Windows.Point(400, 200), myWorld);
         rcolo.Spawn(40);
         myWorld.AddColony(rcolo);
         GreenColony gcolo = new GreenColony(new System.Windows.Point(1200, 600), myWorld);
         gcolo.Spawn(40);
         myWorld.AddColony(gcolo);
         myWorld.Initialize();
         colonies         = new List <Colony>();
         food             = new List <FoodCluster>();
         bricks           = new List <BrickCluster>();
         rocks            = new List <Rock>();
         pheromons        = new List <Pheromon>();
         alea             = new Random();
         this.AllObjReady = true;
     }
 }