Advertisement
SnowPhoenix347

5.3

Nov 9th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FifthProject
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Renderer render = new Renderer();
  10.             render.RenderPlayer();
  11.         }
  12.     }
  13.  
  14.     class Player
  15.     {
  16.         private int _positionX = 3;
  17.         private int _positionY = 5;
  18.  
  19.         public int PositionX
  20.         {
  21.             get
  22.             {
  23.                 return _positionX;
  24.             }
  25.         }
  26.         public int PositionY
  27.         {
  28.             get
  29.             {
  30.                 return _positionY;
  31.             }
  32.         }
  33.     }
  34.  
  35.     class Renderer
  36.     {
  37.         Player player = new Player();
  38.         public void RenderPlayer()
  39.         {
  40.             int x = player.PositionX;
  41.             int y = player.PositionY;
  42.             Console.SetCursorPosition(x, y);
  43.             Console.WriteLine("Player");
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement