Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Homework39
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player('#', 10, 15);
- Renderer renderer = new Renderer();
- renderer.DrawPlayer(player);
- }
- }
- class Player
- {
- public Player(char playerSymbol, int x, int y)
- {
- PlayerSymbol = playerSymbol;
- X = x;
- Y = y;
- }
- public char PlayerSymbol { get; private set; }
- public int X { get; private set; }
- public int Y { get; private set; }
- }
- class Renderer
- {
- public void DrawPlayer(Player player)
- {
- Console.CursorVisible = false;
- Console.SetCursorPosition(player.X, player.Y);
- Console.Write(player.PlayerSymbol);
- Console.SetCursorPosition(0, 0);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement