Advertisement
SnowPhoenix347

5.3

Nov 8th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 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 renderer = new Renderer();
  10.             renderer.RenderPlayer(4, 4, "dog");
  11.         }
  12.     }
  13.  
  14.     class Player
  15.     {
  16.         public int PositionX;
  17.         public int PositionY;
  18.         public string IcoPlayer;
  19.  
  20.         public Player(int positionX = 0, int positionY = 0, string icoPlayer = "object")
  21.         {
  22.             PositionX = positionX;
  23.             PositionY = positionY;
  24.             IcoPlayer = icoPlayer;
  25.         }
  26.     }
  27.    
  28.     class Renderer
  29.     {
  30.         Player player = new Player();
  31.        
  32.         public void RenderPlayer(int x, int y, string ico)
  33.         {
  34.             x = player.PositionX;
  35.             y = player.PositionY;
  36.             ico = player.IcoPlayer;
  37.             Console.SetCursorPosition(x,y);
  38.             Console.WriteLine(ico);
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement