Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ConsoleApp33
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Player player1 = new Player(5, 10);
  13.             Renderer renderer = new Renderer();
  14.             renderer.DrawPlayer(player1.X, player1.Y);
  15.             Console.ReadKey();
  16.         }
  17.     }
  18.     class Player
  19.     {
  20.         public int X { get; protected set; }
  21.         public int Y { get; protected set; }
  22.         public Player(int posX, int posY)
  23.         {
  24.             X = posX;
  25.             Y = posY;
  26.         }
  27.     }
  28.     class Renderer
  29.     {
  30.         public void DrawPlayer(int x, int y, char ch = '#')
  31.         {
  32.             Console.SetCursorPosition(x, y);
  33.             Console.Write(ch);
  34.             Console.CursorVisible = false;
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement