コード例 #1
0
 public static void Debug(string Message)
 {
     ConsoleGraphics.ResetCursor();
     Console.ForegroundColor = ConsoleColor.White;
     Console.BackgroundColor = ConsoleColor.Black;
     Console.WriteLine(Message);
 }
コード例 #2
0
        public override void Update()
        {
            if (NeedFree)
            {
                NeedFree = false;
                MainList[FreeIndex].Enabled = false;
                MainList.RemoveAt(FreeIndex);
            }

            for (int i = 0; i < MainList.Count; i++)
            {
                MainList[i].Update();
                if (MainList[i].rigidBody != null)
                {
                    MainList[i].rigidBody.GravityOn();
                }

                if (MainList[i].material != null)
                {
                    ConsoleGraphics.SetDrawPosition(MainList[i].position.x, MainList[i].position.y);
                    ConsoleGraphics.Draw(MainList[i].material, MainList[i]._C != null);
                }
            }


            ConsoleGraphics.ResetCursor();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: yargr96/renderer
 private void Init()
 {
     bt       = (Bitmap)Image.FromFile(path);
     hero     = new ConsolePicture(bt, 0, 0);
     material = hero;
     ConsoleGraphics.HexPicture(bt);
     //hero.Anim_pic = true;
 }
コード例 #4
0
 public override void Update()
 {
     position.x = position.x + Input.GetHor() * speed;
     if (position.x > 50)
     {
         position.x = 0;
         ConsoleGraphics.BakeSky(75, 80);
         Console.Beep(783, 200);
     }
     if (position.x < 0)
     {
         position.x = 50;
         ConsoleGraphics.BakeSky(75, 80);
         Console.Beep(783, 200);
     }
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: yargr96/renderer
 public override void Update()
 {
     position.x = position.x + Input.GetHor() * speed;
     if (position.x > 45)
     {
         position.x = 0;
         ConsoleGraphics.BakeSky(75, 80);
         Console.Beep(783, 200);
         Game.LoadScene(Game.cur_sc_id + 1);
     }
     if (position.x < 0)
     {
         position.x = 50;
         ConsoleGraphics.BakeSky(75, 80);
         Console.Beep(783, 200);
     }
 }
コード例 #6
0
        private void Create()
        {
            colors = new ConsoleColor[width, height];
            height = height - offsetY;

            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    ConsoleColor cc = ConsoleColor.Black;
                    Color        c  = b.GetPixel(x, y);

                    cc = ConsoleGraphics.ColorToConsole(c.R, c.G, c.B);

                    colors[x, y] = cc;
                }
            }

            if (Frames != 0)
            {
                offsetX = width / Frames;
            }
        }
コード例 #7
0
        public static void Render()
        {
            Render3D = (Bitmap)Image.FromFile(path);
            h        = Render3D.Height;
            w        = Render3D.Width;
            material = new ConsolePicture(Render3D, 0, 15);
            int a = 0;


            for (int i = 0; i < w - 1; i++)
            {
                a = i;
                int sh = 15;
                for (int k = 0; k < h - 1; k++)
                {
                    if (sh <= 0)
                    {
                        sh = 1;
                    }
                    if (material.colors[i, k] == ConsoleColor.Green)
                    {
                        //ConsoleGraphics.Draw(material,true);
                        wall = new Shape(sh, 2);
                        ConsoleGraphics.SetDrawPosition(i, sh);
                        ConsoleGraphics.Draw(wall.BakeConsolePicture(), true);
                        break;
                    }
                    else
                    {
                        wall = new Shape(sh, 2, ConsoleColor.White);
                        ConsoleGraphics.SetDrawPosition(i, sh);
                        ConsoleGraphics.Draw(wall.BakeConsolePicture(), true);
                    }
                    sh--;
                }
            }
        }