using System;
using System.Collections.Generic;
using System.Text;
using Vortex;
using Vortex.Drawing;
using Vortex.Demo.Pacman;
using Vortex.SceneFramework;
using Vortex.Input;

namespace Vortex.Demo.Pacman {

    class PacmanGame : Game {
        public const string WINDOW_TITLE = "Pacman Demo (Powered by Vortex2D.NET)";
		//resolution of screen
		public readonly static Vector2 SCREEN_SIZE = new Vector2(800, 600);
		///<summary>Size of game map tile</summary>
		public const int TILE_SIZE = 16;

        public static MenuScene MainMenuScene { get; private set; }
		public static LevelScene LevelScene { get; private set; }

        public PacmanGame() : base() {
            Window.Title = WINDOW_TITLE;
			Window.Size = SCREEN_SIZE;
			//Game.DebugInfoEnabled = false;
        }

        protected override void Load() {

            MainMenuScene = new MenuScene();
			LevelScene = new LevelScene();
            //Screen.PushScene(MainMenuScene);
			Screen.PushScene(MainMenuScene, SceneSwitchEffects.Fade, 0.8f);
        }

		protected override void Unload() {
		}

        protected override void Update(GameTime time) {
            Screen.Update(time.FrameTime);
			if (Keyboard.IsPressed(Key.B)) {
				Screen.PopScene(SceneSwitchEffects.Fade, 1.0f);
			}
        }

        protected override void Render(Canvas2D canvas) {
            Screen.Draw(canvas);
        }
    }
}
