예제 #1
0
        // TODO: Get level id
        public Session(Rectangle screenBounds)
        {
            _screenBounds = screenBounds;
            _world = new World(new Vector2(0, 10));

            _player = new Player();
            _player.Lives = 3;

            _level = new Level(_world, screenBounds, _player);
        }
예제 #2
0
        public Gamefield(int width, int height, Ball ball, Player player)
        {
            this.Width = width;
            this.Height = height;
            this.Ball = ball;
            this.Player = player;
            this.IsAlive = true;
            this.GameObjects = new List<GameObject>()
            {
                this.Player,
                this.Ball,
            };

            InitializeBoard();
        }
예제 #3
0
        public Level(World world, Rectangle screenBounds, Player player)
        {
            _paddle = new Paddle(world, screenBounds);
            _ball = new Ball(world, _paddle, player);
            _walls = new Walls(world, screenBounds, _ball, _paddle);

            // TODO: Load level from file/resource
            for (int y = 0; y < 5; y++)
            {
                for (int x = 0; x < 10; x++)
                {
                    _blocks.Add(new Block(world, screenBounds, x, y, player, _ball, _paddle));
                }
            }
        }