public override void Draw()
        {
            var resPos = Position + _bodyOffset - Vector2.UnitY * (Z + _jumpChargeZ);

            var frame = 0;

            if (FacingDirection > 0 && FacingDirection < 180)
            {
                frame = 1;
            }
            DrawCntrl.DrawSprite(BodySprite, frame, Test.RoundVector2(resPos + (Vector2.UnitY * Test.CurrentScene.GetLift(Position))));

            if (frame == 0)
            {
                float ratio = ((float)FacingDirection - 270) / 90f;

                if (ratio > 1)
                {
                    ratio = 1;
                }
                if (ratio < -1)
                {
                    ratio = -1;
                }

                DrawCntrl.DrawSprite(
                    FaceSprite,
                    Test.RoundVector2(
                        resPos + _facePos +
                        (Vector2.UnitX * FaceOffsetMax * ratio) +
                        (Vector2.UnitY * Test.CurrentScene.GetLift(Position))
                        )
                    );
            }
        }
 public override void Draw()
 {
     DrawCntrl.DrawSprite(
         Sprite,
         Test.RoundVector2(Position - (Vector2.UnitY * Z) + (Vector2.UnitY * Test.CurrentScene.GetLift(Position)))
         );
 }
 public override void Draw()
 {
     if (Sprite != null)
     {
         DrawCntrl.CurrentColor = Color.White;
         DrawCntrl.DrawSprite(Sprite, Position + Vector2.One * Scene.CellSize / 2);
     }
 }
        public override void Draw()
        {
            var center = Position + SecondPosition / 2;

            DrawCntrl.CurrentColor = Color.White;

            var v = Vector2.UnitY * amp * (float)Math.Sin(_ang);

            DrawCntrl.DrawRectangle(center - Mask / 2, center + Mask / 2, false);

            DrawCntrl.DrawSprite(SpritesDefault.LaserOrb, Test.RoundVector2(Position + v));
            DrawCntrl.DrawSprite(SpritesDefault.LaserOrb, Test.RoundVector2(Position + SecondPosition + v));
        }
Esempio n. 5
0
 public override void DrawBegin()
 {
     if (!Destroyed)
     {
         var c = new Color(Color.White, (float)_life.Counter / _lifetime);
         DrawCntrl.DrawSprite(
             Sprite,
             0,
             Test.RoundVector2(Position + (Vector2.UnitY * Test.CurrentScene.GetLift(Position))),
             Vector2.One,
             -Dir,
             c
             );
     }
 }
Esempio n. 6
0
        public static void DrawText(string text, int x, int y)
        {
            DrawCntrl.CurrentFont = Font;
            string[] lines = text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);

            var yAdd = 0;

            foreach (string line in lines)
            {
                DrawCntrl.DrawSprite(Sprites.Font, _fillerFrame, x * CharSize.X, (y + yAdd) * CharSize.Y, line.Length, 1, 0, BackgroundColor);
                DrawCntrl.CurrentColor = ForegroundColor;
                DrawCntrl.DrawText(line, x * CharSize.X, (y + yAdd) * CharSize.Y);
                yAdd += 1;
            }
        }
        public override void Draw()
        {
            DrawCntrl.CurrentColor = Color.Red;

            if (CurrentState == State.Pursuing)
            {
                DrawCntrl.DrawSprite(SpritesDefault.EnemyPaw, 0, Test.RoundVector2(Position), Vector2.One, -_tracedPawprint.Dir, Color.White);
            }
            //DrawCntrl.DrawCircle(Test.RoundVector2(Position), 8, false);

            /*
             * foreach(Vector2 pt in _patrolPoints)
             * {
             *      DrawCntrl.DrawCircle(pt, 2, false);
             * }
             */
            DrawCntrl.CurrentColor = Color.White;
        }
Esempio n. 8
0
        public void DrawTileMap()
        {
            _tileDeg += 0.1f;
            if (_tileDeg > Math.PI * 2)
            {
                _tileDeg -= (float)Math.PI * 2;
            }

            DrawCntrl.CurrentColor = Color.White;

            for (var y = 0; y < TileMap.GetLength(1); y += 1)
            {
                for (var x = 0; x < TileMap.GetLength(0); x += 1)
                {
                    if (TileMap[x, y] > 0)
                    {
                        DrawCntrl.DrawSprite(SpritesDefault.Tile, TileMap[x, y] - 1, x * CellSize, y * CellSize + GetLift(new Vector2(x, y) * CellSize));
                    }
                }
            }
        }
Esempio n. 9
0
 public override void Draw()
 {
     DrawCntrl.CurrentColor = Color.White;
     DrawCntrl.DrawSprite(SpritesDefault.Coin, Position);
 }
 public override void DrawBegin()
 {
     DrawCntrl.CurrentColor = Color.White;
     DrawCntrl.DrawSprite(SpritesDefault.Clouds, Id, Position + DrawCntrl.CurrentCamera.Pos * Parallax);
 }
 public override void Draw()
 {
     DrawCntrl.CurrentColor = Color.White;
     //DrawCntrl.DrawCircle(Position, 16, false);
     DrawCntrl.DrawSprite(SpritesDefault.Sign, Position);
 }
Esempio n. 12
0
 public static void DrawChar(char ch, int x, int y)
 {
     DrawCntrl.DrawSprite(Sprites.Font, _fillerFrame, x * CharSize.X, y * CharSize.Y, 1, 1, 0, BackgroundColor);
     DrawCntrl.DrawFrame(_fontChars[ch], new Vector2(x, y) * CharSize, Vector2.One, 0, Vector2.Zero, ForegroundColor, SpriteEffects.None);
 }
Esempio n. 13
0
 public static void DrawRectangle(int x1, int y1, int w, int h)
 {
     DrawCntrl.DrawSprite(Sprites.Font, _fillerFrame, x1 * CharSize.X, y1 * CharSize.Y, w, h, 0, BackgroundColor);
 }
Esempio n. 14
0
 public static void DrawRectangle(Vector2 pos, Vector2 size)
 {
     DrawCntrl.DrawSprite(Sprites.Font, _fillerFrame, pos * CharSize, size, 0, BackgroundColor);
 }