Exemple #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            TextureFactory factory = TextureFactory.Instance;

            factory.Initialize(GraphicsDevice, Content);

            spriteBatch       = new SpriteBatch(GraphicsDevice);
            font              = Content.Load <SpriteFont>("Fonts/default");
            replacementEffect = Content.Load <Effect>("Shaders/ColorReplacement");

            var actorPlaceHolderTexture = factory.GetTexture("actor");

            var AriStats = Stats.GetUniformRandom(15, 2, new List <IAction> {
                new AttackAction(), new HealAction(), new DefendAction()
            });
            var ZinoStats = Stats.GetUniformRandom(15, 2, new List <IAction> {
                new AttackAction(), new HealAction(), new DefendAction()
            });

            actors = new List <Actor> {
                new Actor("Ari", HSV.FromHue(120), AriStats, actorPlaceHolderTexture, new BattleUI(), true),
                new Actor("Zino", HSV.FromHue(300), ZinoStats, actorPlaceHolderTexture, new BattleUI(), true)
            };

            eventCounter = 0;
            currentEvent = new EventDeterminerEvent(this);
            currentEvent.Initialize(actors);
        }
Exemple #2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            time = gameTime;
            input.Update();

            if (currentEvent.Update(this, input))
            {
                previousEvent = currentEvent;
                currentEvent  = nextEvent;
                nextEvent     = null;

                currentEvent.Initialize(actors);
            }

            base.Update(gameTime);
        }