Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace drawPlayer
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player(7,10);
- Renderer render = new Renderer();
- render.DrawUnit(player.X,player.Y);
- }
- class Renderer
- {
- public void DrawUnit(int x, int y, char ch = '@')
- {
- Console.SetCursorPosition(x, y);
- Console.Write(ch);
- Console.WriteLine("\n\n\n");
- Console.ReadKey();
- }
- }
- class Player
- {
- private int _x;
- private int _y;
- public int X
- {
- get
- {
- return _x;
- }
- private set
- {
- _x = value;
- }
- }
- public int Y
- {
- get
- {
- return _y;
- }
- private set
- {
- _y = value;
- }
- }
- public Player (int x, int y)
- {
- _x = x;
- _y = y;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement