Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Ijunior
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Renderer renderer = new Renderer();
- Player player = new Player(20, 10, '@');
- renderer.Draw(player);
- }
- }
- class Player
- {
- public Player(int x, int y, char symbol)
- {
- PositionX = x;
- PositionY = y;
- Symbol = symbol;
- }
- public int PositionX { get; private set; }
- public int PositionY { get; private set; }
- public char Symbol { get; private set; }
- }
- class Renderer
- {
- public void Draw(Player player)
- {
- Console.CursorVisible = false;
- Console.SetCursorPosition(player.PositionX, player.PositionY);
- Console.Write(player.Symbol);
- Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment