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;
- namespace ConsoleApplication1
- {
- class Movements : Info
- {
- public void Action()
- {
- //This cleans up player after it moves
- Console.SetCursorPosition(x, y);
- Console.Write(" ");
- x = x + xspeed;
- y = y + yspeed;
- //this is the control input from the player
- if (Console.KeyAvailable)
- {
- ConsoleKeyInfo Keyinfo = Console.ReadKey(true);
- switch (Keyinfo.Key)
- {
- case ConsoleKey.W:
- y = y - 1;
- figure = "^.^";
- break;
- case ConsoleKey.S:
- y = y + 1;
- figure = "v.v";
- break;
- case ConsoleKey.A:
- x = x - 1;
- figure = "<.<";
- break;
- case ConsoleKey.D:
- x = x + 1;
- figure = ">.>";
- break;
- case ConsoleKey.T:
- pla.Screen();
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment