Advertisement
Rodunskiy

Untitled

May 13th, 2025
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. namespace CSLight
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             Renderer renderer = new Renderer();
  8.             Player player = new Player(15,15,'@');
  9.  
  10.             renderer.Draw(player.positionX, player.positionY, player.Symbol);
  11.         }
  12.     }
  13.  
  14.     class Renderer
  15.     {
  16.         public void Draw(int x, int y, char character)
  17.         {
  18.             Console.CursorVisible = false;
  19.             Console.SetCursorPosition(x, y);
  20.             Console.Write(character);
  21.             Console.ReadKey(true);
  22.         }
  23.     }
  24.  
  25.     class Player
  26.     {
  27.         public Player(int x, int y, char symbol)
  28.         {
  29.             positionX = x;
  30.             positionY = y;
  31.             Symbol = symbol;
  32.         }
  33.  
  34.         public int positionX { get; private set; }
  35.         public int positionY { get; private set; }
  36.         public char Symbol { get; private set; }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement