Advertisement
vovanhik_24

#39

Sep 27th, 2023 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1.         static void Main(string[] args)
  2.         {
  3.             Player player = new Player(10, 10);
  4.             PlayerRender render = new PlayerRender();
  5.  
  6.             render.Draw(player.PositionX, player.PositionY);
  7.         }
  8.  
  9.         class Player
  10.         {
  11.             public Player(int positionX, int positionY)
  12.             {
  13.                 PositionX = positionX;
  14.                 PositionY = positionY;
  15.             }
  16.  
  17.             public int PositionX { get; private set; }
  18.             public int PositionY { get; private set; }
  19.         }
  20.  
  21.         class PlayerRender
  22.         {
  23.             public void Draw(int positionX, int positionY)
  24.             {
  25.                 char playerSign = '@';
  26.                 Console.SetCursorPosition(positionX, positionY);
  27.                 Console.WriteLine(playerSign);
  28.             }
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement