Exemplo n.º 1
0
        public GameObjectsManager(Camera camera)
        {
            _camera = camera;
            _gameObjects = new List<GameObject>(150);
            _addNewObjectsQueue = new Queue<GameObject>(150);
            _deleteObjectsQueue = new Queue<GameObject>(150);

            QuadTree = new QuadTree<ColliderComponent>(new Rectangle(0, 0, 1024, 1024));
        }
Exemplo n.º 2
0
        public DataGameFrame(string name)
        {
            var w = BlueberryGame.CurrentGame.Window.Width;
            var h = BlueberryGame.CurrentGame.Window.Height;

            _camera = new Camera(new System.Drawing.Size(w, h),
                                 new System.Drawing.Point(0, 0), true);
            _goManager = new GameObjectsManager(_camera);

            var path = name + ".xml";
            var file = new XmlDocument();
            file.Load(path);

            XmlNode main = file.SelectSingleNode("Frame");

            ResourceMgr.LoadResourcesXmlData(main);
            LoadGameObjectsXmlData(main);

            GL.ClearColor(Color4.CornflowerBlue);
        }
Exemplo n.º 3
0
        public GameWorld(int width, int height)
        {
            Width = width;
            Height = height;
            TileMap = new TileMap(Width, Height);

            _gameObjects = new List<GameObject>();
            _quadTree = new QuadTree<GameObject>(new Rectangle(0,0, Width * 64, Height * 64));
            _quadTree.MaxGeneration = 4;
            _addNewObjectsQueue = new Queue<GameObject>();
            _deleteObjectsQueue = new Queue<GameObject>();

            Camera = new Camera(Game.g_screenSize, new Point(Game.g_screenSize.Width / 2, Game.g_screenSize.Height / 2), true);
            Camera.ScaleTo(1f);
            Camera.MoveSpeed = 7;

            background = new ParallaxBackground(this);
            BloodSystem = new BloodSystem(this);
            BloodSystem.Init();
            BloodSystem.BlendWith(back);

            mback = new MagicBackground();

            UpdateObjectsEnqueues();
        }
Exemplo n.º 4
0
 public LevelGenerationState(StateManager stateManager)
     : base(stateManager)
 {
     _camera = new Camera(Game.g_screenSize, new Vector2(0, 0), true) {MoveSpeed = 6};
     _nextCameraPosition = new Vector2(0, 0);
 }