Exemplo n.º 1
0
 public void Draw()
 {
     if (Flags.ShowCollisionRecs)
     {
         foreach (var collisionComponent in _collisionComponents)
         {
             if (!collisionComponent.Inactive)
             {
                 Functions_Draw.DrawDebug(collisionComponent.CollisionRectangle);
                 Functions_Draw.DrawDebug(collisionComponent.CollisionRectangle.Center);
             }
         }
         //collision.DrawMinkowski();
     }
     if (Flags.ShowMovementCenters)
     {
         foreach (var movementComponent in _movementComponents)
         {
             if (!movementComponent.Inactive)
             {
                 Functions_Draw.DrawDebug(movementComponent.Position, Color.Yellow);
             }
         }
     }
 }
Exemplo n.º 2
0
 public static void Draw()
 {
     for (int i = 0; i < _textIterator; i++)
     {
         try
         {
             Functions_Draw.Draw(_messages[i].Text, Assets.GetFont("Test"), pos);
         }
         catch
         {
             Functions_Draw.Draw("Error", Assets.GetFont("Test"), pos);
         }
         pos.Y += 25;
     }
     Reset();
 }
Exemplo n.º 3
0
        private void DrawComponent(DrawComponent component)
        {
            if (component.Inactive)
            {
                return;
            }

            UpdatePosition(component);
            if (component.DrawRec.Intersects(_camera.CullRec)) //TODO can confirm, this causes the pop ins
            {
                if (component.GetRotationFromMovementVector)
                {
                    RotateFromMovementVector(component);
                }
                Functions_Draw.Draw(component);
            }
        }
Exemplo n.º 4
0
        public override Screen HandleInput(GameTime gameTime)
        {
            if (InputReader.IsKeyTriggered(Keys.Escape))
            {
                OpenMenuScreen();
            }
            if (InputReader.IsKeyTriggered(Keys.F1))
            {
                ToggleAllDebug();
            }
            if (InputReader.IsKeyTriggered(Keys.F2))
            {
                Flags.ShowDrawRecs = !Flags.ShowDrawRecs;
            }
            if (InputReader.IsKeyTriggered(Keys.F3))
            {
                Flags.ShowCollisionRecs = !Flags.ShowCollisionRecs;
            }
            if (InputReader.IsKeyTriggered(Keys.F4))
            {
                Flags.ShowDebuggingText = !Flags.ShowDebuggingText;
            }
            if (InputReader.IsKeyTriggered(Keys.F5))
            {
                Flags.ShowMovementCenters = !Flags.ShowMovementCenters;
            }
            if (InputReader.IsKeyPressed(Keys.F10))
            {
                Functions_Draw.Draw("Error", Assets.GetFont("Test"), new Vector2(100, 100));
            }

            /* if (InputReader.IsKeyTriggered(Keys.N)) //TODO Create GenerationTesterScreen to test generation lmao
             * {
             *  _levelGenerator.ApplySimpleCellularAutomata(_currentLevel);
             *  _ecs.PurgeForNextLevel();
             *  _ecs.ProcessLevel(_currentLevel, _currentLevelTracker);
             * }
             */
            SimpleCameraMovement(gameTime);

            return(this);
        }
Exemplo n.º 5
0
        public void Initialize()
        {
            SpriteBatch = new SpriteBatch(_game.GraphicsDevice);
            Functions_Draw.setSpriteBatch(SpriteBatch);

            #region Bootroutine
            if (Flags.BootRoutine == BootRoutine.Game)
            {
                FlushAndLoad(new ScreenMainMenu(this));
            }
            else if (Flags.BootRoutine == BootRoutine.TestingRoom)
            {
                FlushAndLoad(new ScreenGame(this));
            }
            else if (Flags.BootRoutine == BootRoutine.Generation)
            {
                FlushAndLoad(new ScreenGenerationTester(this));
            }
            #endregion
        }
Exemplo n.º 6
0
 public void DrawMinkowski()
 {
     foreach (var actor in _moveableCollisionComponents)
     {
         if (actor.Collision.Inactive)
         {
             continue;
         }
         foreach (var target in _collisionComponents)
         {
             if (target.Inactive)
             {
                 continue;
             }
             if (actor.Movement.IsMoving && !actor.Collision.Equals(target))
             {
                 Functions_Draw.DrawDebug(CollisionPhysicsSubsystem.CalculateMinkowskiDifference(actor.Collision.CollisionRectangle, target.CollisionRectangle));
             }
         }
     }
 }
Exemplo n.º 7
0
 public override void Draw()
 {
     Functions_Draw.Draw(DrawComponent);
     Functions_Draw.Draw(Text, Font, TextLocation);
 }
Exemplo n.º 8
0
 public virtual void Draw()
 {
     Functions_Draw.Draw(DrawComponent);
 }