MovePlayerRacketLeft() public method

public MovePlayerRacketLeft ( ) : void
return void
        static void Main(string[] args)
        {
            IRenderer      renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();

            int sleep = 300;

            Engine gameEngine = new Engine(renderer, keyboard, sleep);

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };

            ShootingEngine gameShootingEngine = new ShootingEngine(renderer, keyboard, 200);

            keyboard.OnActionPressed += (sender, eventInfo) =>
            {
                gameShootingEngine.ShootRacket();
            };

            Initialize(gameEngine);

            gameEngine.Run();
        }
        static void Main(string[] args)
        {
            IRenderer renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();

            Engine gameEngine = new Engine(renderer, keyboard, 220);
            //newEngine newGameEngine = new newEngine(renderer, keyboard, 220);

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };
            keyboard.OnActionPressed += (sender, eventInfo) =>
            {
                gameEngine.ShootPlayerRacket();
            };

            Initialize(gameEngine);

            //

            gameEngine.Run();
        }
示例#3
0
        static void Main()
        {
            IRenderer      renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();

            Engine gameEngine = new Engine(renderer, keyboard, 200);

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };

            Initialize(gameEngine);
            gameEngine.Run();
        }
        static void Main()
        {
            IRenderer renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();

            Engine gameEngine = new Engine(renderer, keyboard,500); //setting sleep length manually with integer number

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };

            Initialize(gameEngine);
            SetBorders(gameEngine); // my implementation for borders

            gameEngine.Run();
        }
        static void Main(string[] args)
        {
            IRenderer renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();

            Engine gameEngine = new Engine(renderer, keyboard, 200);// Task2: SleepTimeAsField

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };

            Initialize(gameEngine);

            //

            gameEngine.Run();
        }
        static void Main(string[] args)
        {
            IRenderer renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();

            Engine gameEngine = new Engine(renderer, keyboard, 200);
            //indestructable blocks
            for (int i = 1; i < WorldRows; i++)
            {
                //gameEngine.AddObject(new IndestructibleBlock(new MatrixCoords(i, 0)));
                //gameEngine.AddObject(new IndestructibleBlock(new MatrixCoords(i, WorldCols - 1)));
                gameEngine.AddObject(new UnpassableBlock(new MatrixCoords(i, 0)));
                gameEngine.AddObject(new UnpassableBlock(new MatrixCoords(i, WorldCols - 1)));
            }
            for (int i = 0; i < WorldCols; i++)
            {
                //gameEngine.AddObject(new IndestructibleBlock(new MatrixCoords(1, i)));
                gameEngine.AddObject(new UnpassableBlock(new MatrixCoords(1, i)));
            }
            //end

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };

            Initialize(gameEngine);

            //

            gameEngine.Run();
        }
        static void Main(string[] args)
        {
            // 2. User input speed
            Console.WriteLine("Enter speed: ");
            int speed = int.Parse(Console.ReadLine());

            IRenderer renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();

            Engine gameEngine = new Engine(renderer, keyboard, speed);

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };

            Initialize(gameEngine);

            //

            gameEngine.Run();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Enter level: ");

            IRenderer renderer = new ConsoleRenderer(WorldRows, WorldCols);
            IUserInterface keyboard = new KeyboardInterface();
            int sleep = int.Parse(Console.ReadLine());                        // 02.Sleep field

            Engine gameEngine = new Engine(renderer, keyboard, sleep);

            keyboard.OnLeftPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketLeft();
            };

            keyboard.OnRightPressed += (sender, eventInfo) =>
            {
                gameEngine.MovePlayerRacketRight();
            };

            //13.
            //keyboard.OnActionPressed += (sender, eventInfo) =>
            //{
            //    gameEngine.ShootPlayerRacket();
            //};

            Initialize(gameEngine);

            //

            gameEngine.Run();
        }