Пример #1
0
        public EntityConsole()
            : base(80, 23)
        {
            var animation = new AnimatedConsole("default", 1, 1);
            var frame     = animation.CreateFrame();

            frame.Cells[0].Glyph = 1;

            player          = new Entity(animation);
            player.Position = new Point(Width / 2, Height / 2);
            player.Components.Add(new SadConsole.Components.EntityViewSyncComponent());
            playerPreviousPosition = player.Position;

            Children.Add(player);

            // Setup this console to accept keyboard input.
            UseKeyboard = true;
            IsVisible   = false;
        }
Пример #2
0
        public EntityConsole()
            : base(80, 23, 160, 46)
        {
            player = new Entity(Color.Yellow, Color.Black, 1, 10)
            {
                Position = new Point(Surface.Width / 2, Surface.Height / 2),
            };

            playerPreviousPosition = player.Position;
            SadComponents.Add(new SadConsole.Components.SurfaceComponentFollowTarget()
            {
                Target = player
            });
            //player.Components.Add(new SadConsole.Components.EntityViewSync());

            Children.Add(player);

            // Setup this console to accept keyboard input.
            UseKeyboard = true;
            IsVisible   = false;
        }
Пример #3
0
        public EntityConsole()
            : base(80, 23)
        {
            var         animation = new AnimatedConsole("default", 1, 1);
            CellSurface frame     = animation.CreateFrame();

            frame.Cells[0].Glyph = 1;
            frame.SetDecorator(0, 2, new CellDecorator(Color.Yellow, 69, SpriteEffects.None));

            player = new Entity(animation)
            {
                Position = new Point(Width / 2, Height / 2)
            };
            player.Components.Add(new SadConsole.Components.EntityViewSyncComponent());
            playerPreviousPosition = player.Position;

            Children.Add(player);

            // Setup this console to accept keyboard input.
            UseKeyboard = true;
            IsVisible   = false;
        }
Пример #4
0
        public EntityConsole()
            : base(80, 23)
        {
            var animation = new Animated("default", 1, 1);
            var frame     = animation.CreateFrame();

            frame.Cells[0].Glyph = 1;

            player                 = new Entity(animation);
            player.Position        = new Point(Width / 2, Height / 2);
            playerPreviousPosition = player.Position;

            // Setup this console to accept keyboard input.
            UseKeyboard = true;
            IsVisible   = false;

            EntityManager manager = new EntityManager();

            manager.Entities.Add(player);

            Children.Add(manager);
        }