Ejemplo n.º 1
0
        public PipePair(Renderer renderer, float offset)
        {
            _renderer   = renderer;
            _rectangle0 = new Rectangle(1f, -3.4f, 0.25f, 3f, 2f, Rectangle.RectMode.Left);
            _rectangle1 = new Rectangle(1f, 3.4f, 0.25f, -3f, 2f, Rectangle.RectMode.Left);

            Group = _renderer.CreateRenderGroup();
            _renderer.AddRectangleToGroup(Group, _rectangle0);
            _renderer.AddRectangleToGroup(Group, _rectangle1);

            Offset       = offset;
            MovePosition = offset;
        }
Ejemplo n.º 2
0
 public Background(Renderer renderer)
 {
     _renderer  = renderer;
     _rectangle = new Rectangle(0f, 0f, 2f, 2f, 0f);
     Group      = _renderer.CreateRenderGroup();
     _renderer.AddRectangleToGroup(Group, _rectangle);
 }
Ejemplo n.º 3
0
        public Player(Renderer renderer)
        {
            _renderer  = renderer;
            _rectangle = new Rectangle(0f, 0f, _width, _height, 1f);
            Group      = _renderer.CreateRenderGroup();
            _renderer.AddRectangleToGroup(Group, _rectangle);

            Alive = true;
        }
Ejemplo n.º 4
0
        protected override void OnLoad(EventArgs e)
        {
            CursorVisible = false;

            _renderer   = new Engine.Renderer();
            _background = new Background(_renderer);
            _player     = new Player(_renderer);
            _pipes      = new Pipes(_renderer, 3, 0.74f);

            _titlescreen = _renderer.CreateRenderGroup();
            _renderer.AddRectangleToGroup(_titlescreen, new Rectangle(0f, 0f, 2f, 2f, 3f));

            _deathscreen = _renderer.CreateRenderGroup();
            _renderer.AddRectangleToGroup(_deathscreen, new Rectangle(0f, 0f, 2f, 2f, 4f));
            _renderer.RenderGroupVisible(_deathscreen, false);

            WindowState = WindowState.Fullscreen;

            base.OnLoad(e);
        }