Class used to allaw delay between successive key event.
        // Pause variables
        //int pauseDelay = 300;
        //int pauseCountdown = 0;
        public StateManager(Game1 game)
            : base(game)
        {
            myGame = game;

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction();
        }
Ejemplo n.º 2
0
        public HelpScreen(Game1 game)
            : base(game)
        {
            myGame = game;

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction();
        }
Ejemplo n.º 3
0
        public StartScreen(Game1 game)
            : base(game)
        {
            myGame = game;

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            emptyTex = game.Content.Load<Texture2D>("empty2");
            delayedAction = new DelayedAction(100);
        }
Ejemplo n.º 4
0
        // Pause variables
        //int pauseDelay = 300;
        //int pauseCountdown = 0;
        public StateManager(MyGame game)
            : base(game)
        {
            myGame = game;

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction();
            myGame.mediator.register(this, MyEvent.G_PAUSE,MyEvent.G_RESUME);
        }
Ejemplo n.º 5
0
        public Player(Game1 game, SkinnedModel skinnedModel, Unit unit)
            : base(game, unit, new PlayerModel(game, skinnedModel))
        {
            foreach (ModelMesh mesh in skinnedModel.Model.Meshes)
                foreach (SkinnedEffect effect in mesh.Effects)
                    effect.EnableDefaultLighting();

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            crossHairTex = game.Content.Load<Texture2D>("crosshair");
            delayedAction = new DelayedAction(800);
            //run at first to show to the character otherwise the character dont show
            playerRun();
        }
Ejemplo n.º 6
0
        public Screen(MyGame game,int delayedActionDelay)
            : base(game)
        {
            myGame = game;

            spriteBatch = new SpriteBatch(game.GraphicsDevice);
            delayedAction = new DelayedAction(delayedActionDelay);

            background = game.Content.Load<Texture2D>("poster");

            smallFont = Game.Content.Load<SpriteFont>("SpriteFont1");
            mediumFont = Game.Content.Load<SpriteFont>("SpriteFontMedium");
            bigFont = Game.Content.Load<SpriteFont>("SpriteFontLarge");
        }
Ejemplo n.º 7
0
        //assal
        // Shot variables
        //int keyDelay = 800;
        //int keyCountdown = 0;
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            controller = new Controller(Constants.LEFT_HAND);

            //DONT Remove i need this.--Mahmoud Bahaa
            if (System.IO.File.Exists("fbDeprofiler.dll"))
                fbDeprofiler.DeProfiler.Run();

            Window.AllowUserResizing = true;

            mediator = new Mediator();
            events = new List<Event>();
            delayedAction = new DelayedAction(800);
            delayedAction2 = new DelayedAction();
            mediator.register(this, MyEvent.G_StartGame, MyEvent.G_StartScreen, MyEvent.G_HelpScreen, MyEvent.G_Exit);
            //mediator.fireEvent(MyEvent.G_StartGame);
        }
Ejemplo n.º 8
0
        public MyGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            controller = new Controller(Constants.LEFT_HAND);

            //DONT Remove i need this.--Mahmoud Bahaa
            if (System.IO.File.Exists("fbDeprofiler.dll"))
                fbDeprofiler.DeProfiler.Run();

            //TargetElapsedTime = TimeSpan.FromMilliseconds(100);

            Window.AllowUserResizing = true;

            mediator = new Mediator();
            events = new List<Event>();
            delayedAction = new DelayedAction(800);
            delayedAction2 = new DelayedAction();
            mediator.register(this, MyEvent.G_StartGame, MyEvent.G_StartScreen, MyEvent.G_HelpScreen, MyEvent.G_CreditScreen,
                MyEvent.G_StartLevel, MyEvent.G_NextLevel, MyEvent.G_NextLevel_END_OF_MUSIC, MyEvent.G_Exit);
            //mediator.fireEvent(MyEvent.G_StartGame);
        }