Exemplo n.º 1
0
        /// <summary>
        /// Setup the gameloop and start it.
        /// </summary>
        private void InitializeGame()
        {
            _world = TestWorldFactory.CreateWorld();
            _gamePanel.World = _world;

            _gameThread = new Thread(GameLoop);
            _playing = true;
            _timeSinceLastUpdate = DateTime.Now;
            _gameThread.Start();
        }
Exemplo n.º 2
0
        public static World CreateWorld()
        {
            World world = new World();
            Adventurer adventurer = new Adventurer(world);
            world.AddEntity(adventurer);
            world.AddEntity(new Creeper(new Vector2(300, 100), world));
            world.AddEntity(new Creeper(new Vector2(-300, 100), world));
            world.AddEntity(new Creeper(new Vector2(-100, 200), world));
            world.AddEntity(new Helper(world));

            // Conga conga conga conga!
            const int CongaSize = 4;
            MovingEntity lastInConga = adventurer;
            for (int i = 0; i < CongaSize; i++)
            {
                lastInConga = new Follower(world, lastInConga, 25);
                world.AddEntity(lastInConga);
            }
            world.AddCollidingEntity(new House(new Vector2(0, -180)));
            world.AddCollidingEntity(new Tree(new Vector2(-200, -200)));
            world.AddCollidingEntity(new Tree(new Vector2(200, -200)));
            world.AddEntity(new Explorer(world));
            return world;
        }