예제 #1
0
        /// Generating the map, spawning things.
        void Start()
        {
            this.tick = new Tick();
            this.map  = new Map(275, 275);
            this.map.TempMapGen();
            this.map.BuildAllMeshes();
            Debug.Log(this.map);

            /// TEST STUFF

            /*
             * for (int i = 0; i < 5; i++) {
             *      this.map.SpawnCharacter(new Animal(new Vector2Int(15,15), Defs.animals["chicken"]));
             * }*/
            GrowArea area = new GrowArea(Defs.plants["carrot"]);

            area.Add(new RectI(new Vector2Int(15, 15), 6, 6));
            for (int i = 0; i < 5; i++)
            {
                this.map.SpawnCharacter(new Human(new Vector2Int(10, 10), Defs.animals["human"]));
            }
//			Fy.Characters.AI.TargetList.GetRandomTargetInRange(new Vector2Int(10, 10));

            this.StartCoroutine(this.TickLoop());
            this._ready = true;
        }
예제 #2
0
        void TestStuff()
        {
            Debug.Log(this.map);
            /// TEST STUFF

            foreach (Vector2Int position in new RectI(new Vector2Int(10, 10), 5, 5))
            {
                if (this.map[position].blockStackable == false)
                {
                    this.map.Spawn(position, new Stackable(
                                       position,
                                       Defs.stackables["logs"],
                                       Random.Range(1, Defs.stackables["logs"].maxStack)
                                       ));
                }
            }

            ///// TEST WALLS
            int y = 22;

            for (int x = 10; x < 28; x++)
            {
                Loki.map.Spawn(new Vector2Int(x, y), new Building(
                                   new Vector2Int(x, y),
                                   Defs.buildings["wood_wall"]
                                   ));
            }
            y = 30;
            for (int x = 10; x < 28; x++)
            {
                Loki.map.Spawn(new Vector2Int(x, y), new Building(
                                   new Vector2Int(x, y),
                                   Defs.buildings["wood_wall"]
                                   ));
            }
            Loki.map.UpdateConnectedBuildings();
            ///// TEST WALLS

            /*for (int i = 0; i < 5; i++) {
             *      this.map.SpawnCharacter(new Animal(new Vector2Int(15,15), Defs.animals["chicken"]));
             * }*/
            GrowArea area = new GrowArea(Defs.plants["carrot"]);

            area.Add(new RectI(new Vector2Int(15, 15), 6, 6));

            StockArea stockarea = new StockArea(Defs.empty);

            stockarea.Add(new RectI(new Vector2Int(5, 5), 6, 6));

            for (int i = 0; i < 5; i++)
            {
                this.map.SpawnCharacter(new Human(new Vector2Int(10, 10), Defs.animals["human"]));
            }
            //Fy.Characters.AI.TargetList.GetRandomTargetInRange(new Vector2Int(10, 10));
            //new WindowBuildMenu();
        }