Ejemplo n.º 1
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="player"></param>
 /// <param name="grid"></param>
 /// <param name="render"></param>
 /// <param name="gameLoop"></param>
 /// <param name="map"></param>
 public InputManager(Player player, Grid grid, Renderer render, GameLoop gameLoop, Map map)
 {
     this.grid     = grid;
     this.player   = player;
     this.render   = render;
     this.gameLoop = gameLoop;
     this.map      = map;
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Random random = new Random();

            ObjectsList       obj  = new ObjectsList("ObjectsList.txt");
            List <ObjectData> test = new List <ObjectData>();
            Grid     g             = new Grid();
            Player   player        = new Player(0, random.Next(0, 8));
            GameLoop gameLoop      = new GameLoop();

            g.tiles[player.X, player.Y].Objects.Push(player);
            Renderer     render = new Renderer(player, g, gameLoop);
            InputManager input  = new InputManager(player, g, render, gameLoop, g.map);

            while (gameLoop.inGame)
            {
                gameLoop.Loop(player, g);
                g.UpdateKnownPlaces(player);
                switch (gameLoop.State)
                {
                case "Start":
                    render.RenderStartScreen();
                    input.StartScreenCommand();
                    break;

                case "Game":
                    render.RenderUI();
                    input.TurnCommand();
                    break;

                case "Credits":
                    render.RenderCredits();
                    input.CreditCommands();
                    break;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes the renderer.
 /// </summary>
 /// <param name="player"></param>
 /// <param name="grid"></param>
 /// <param name="gameLoop"></param>
 public Renderer(Player player, Grid grid, GameLoop gameLoop)
 {
     this.player   = player;
     this.grid     = grid;
     this.gameLoop = gameLoop;
 }