Advertisement
alexey3017

Untitled

Mar 24th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 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 Learn1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Render render = new Render();
  13.             Player player = new Player(5, 2);
  14.  
  15.             render.DrawPlayer(player.X, player.Y);
  16.         }
  17.     }
  18.  
  19.     class Player
  20.     {
  21.         public int X { get; }
  22.  
  23.         public int Y { get; }
  24.  
  25.         public Player(int x, int y)
  26.         {
  27.             X = x;
  28.             Y = y;
  29.         }
  30.     }
  31.    
  32.     class Render
  33.     {
  34.         public void DrawPlayer(int x, int y, char symbol = '@')
  35.         {
  36.             Console.SetCursorPosition(x, y);
  37.             Console.Write(symbol);
  38.             Console.WriteLine();
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement