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