Beispiel #1
0
        public BattleScreen(MiGame game, MiTileEngine tileEngine)
            : base(game)
        {
            if (Instance == null)
            {
                flash           = new MiAnimatingComponent(Game, 0, 0, 1280, 800, 0, 0, 0, 0);
                this.tileEngine = tileEngine;
                inputResponses[Controller.START] = Escaped;
                inputResponses[Controller.LEFT]  = Lefted;
                inputResponses[Controller.RIGHT] = Righted;
                inputResponses[Controller.UP]    = Upped;
                inputResponses[Controller.DOWN]  = Downed;
                inputResponses[Controller.A]     = Pressed;

                positions = new Dictionary <Character, Point>();

                cursor       = new MiAnimatingComponent(game, 0, 0, 0, 0);
                cursor.Color = Color.Yellow;

                selectedValidMoves = new Dictionary <Point, int>();
                selectedAOE        = new Dictionary <Point, int>();

                random = new Random();
            }
            else
            {
                throw new Exception("Battle Screen Already Initialized");
            }
        }
Beispiel #2
0
        public BattleScreen(MiGame game, MiTileEngine tileEngine)
            : base(game)
        {
            if (Instance == null)
            {
                flash = new MiAnimatingComponent(Game, 0, 0, 1280, 800, 0, 0, 0, 0);
                this.tileEngine = tileEngine;
                inputResponses[Controller.START] = Escaped;
                inputResponses[Controller.LEFT] = Lefted;
                inputResponses[Controller.RIGHT] = Righted;
                inputResponses[Controller.UP] = Upped;
                inputResponses[Controller.DOWN] = Downed;
                inputResponses[Controller.A] = Pressed;

                positions = new Dictionary<Character, Point>();

                cursor = new MiAnimatingComponent(game, 0, 0, 0, 0);
                cursor.Color = Color.Yellow;

                selectedValidMoves = new Dictionary<Point, int>();
                selectedAOE = new Dictionary<Point, int>();

                random = new Random();
            }
            else
            {
                throw new Exception("Battle Screen Already Initialized");
            }
        }
Beispiel #3
0
        protected override void Initialize()
        {
            // Set the game resolution
            MiResolution.SetVirtualResolution(1280, 800);
            MiResolution.SetResolution(900, 600, false);

            // Initialize Input Handler
            inputHandler = new InputHandler(this);

            // Initialize Tile Engine
            tileEngine = new MiTileEngine(this, 100, 100);
            tileEngine.AddTileType('g', "Town View\\Carpet", true);
            tileEngine.AddTileType('r', "Town View\\TownFloor", false);
            tileEngine.AddTileType('t', "Town View\\Carpet_WS", false);
            tileEngine.AddTileType('w', "Town View\\E_Carpet", false);
            tileEngine.AddTileType('q', "Town View\\Carpet_WA", false);
            tileEngine.AddTileType('h', "Town View\\TownFloor_v2", true);

            // Initialize Location Data
            LocationData.Init();

            // Initialize screens
            StartScreen.Instance   = new StartScreen(this);
            WorldScreen.Instance   = new WorldScreen(this);
            TownScreen.Instance    = new TownScreen(this, tileEngine);
            BattleScreen.Instance  = new BattleScreen(this, tileEngine);
            MessageScreen.Instance = new MessageScreen(this);
            ChoiceScreen.Instance  = new ChoiceScreen(this);

            // Initialize Scripts
            Scripts.Init(this);
            AI.Init(this);

            // Set active screen
            StartScreen.Instance.Activate();

            // Run Tutorial
            ScriptEngine.ExecuteScript(Scripts.Tutorial);

            base.Initialize();
        }
Beispiel #4
0
        protected override void Initialize()
        {
            // Set the game resolution
            MiResolution.SetVirtualResolution(1280, 800);
            MiResolution.SetResolution(900, 600, false);

            // Initialize Input Handler
            inputHandler = new InputHandler(this);

            // Initialize Tile Engine
            tileEngine = new MiTileEngine(this, 100, 100);
            tileEngine.AddTileType('g', "Town View\\Carpet", true);
            tileEngine.AddTileType('r', "Town View\\TownFloor", false);
            tileEngine.AddTileType('t', "Town View\\Carpet_WS", false);
            tileEngine.AddTileType('w', "Town View\\E_Carpet", false);
            tileEngine.AddTileType('q', "Town View\\Carpet_WA", false);
            tileEngine.AddTileType('h', "Town View\\TownFloor_v2", true);

            // Initialize Location Data
            LocationData.Init();

            // Initialize screens
            StartScreen.Instance = new StartScreen(this);
            WorldScreen.Instance = new WorldScreen(this);
            TownScreen.Instance = new TownScreen(this, tileEngine);
            BattleScreen.Instance = new BattleScreen(this, tileEngine);
            MessageScreen.Instance = new MessageScreen(this);
            ChoiceScreen.Instance = new ChoiceScreen(this);

            // Initialize Scripts
            Scripts.Init(this);
            AI.Init(this);

            // Set active screen
            StartScreen.Instance.Activate();

            // Run Tutorial
            ScriptEngine.ExecuteScript(Scripts.Tutorial);

            base.Initialize();
        }
Beispiel #5
0
        public TownScreen(MiGame game, MiTileEngine tileEngine)
            : base(game)
        {
            if (Instance == null)
            {
                playerAvatar      = new MiAnimatingComponent(Game, 0, 0, tileEngine.TileWidth, tileEngine.TileHeight);
                PlayerMoveEnabled = true;

                this.tileEngine = tileEngine;

                inputResponses[Controller.START] = Escape;
                inputResponses[Controller.UP]    = MoveUp;
                inputResponses[Controller.DOWN]  = MoveDown;
                inputResponses[Controller.LEFT]  = MoveLeft;
                inputResponses[Controller.RIGHT] = MoveRight;
                inputResponses[Controller.A]     = ExamineFront;
            }
            else
            {
                throw new Exception("Town Screen Already Initialized");
            }
        }