예제 #1
0
        public void ShouldSpawnObjectsOnEntry()
        {
            var state = new FadeOutState(gameManagerMock.Object, true);

            state.OnEntry();
            gameManagerMock.Verify(foo => foo.FadeOut());
        }
예제 #2
0
        public void ShouldTransitionOnAfterAWhile()
        {
            var state = new FadeOutState(gameManagerMock.Object, true);

            state.OnEntry();
            timeProviderMock.Setup(foo => foo.Time).Returns(0);
            for (int i = 0; i < 10; i++)
            {
                // Just run a bunch to show it's not transitioning
                Assert.IsNull(state.OnDuring());
            }
            timeProviderMock.Setup(foo => foo.Time).Returns(FadeOutState.fadeoutTime + 1);

            Assert.IsTrue(state.OnDuring() is UpdatePointsState);
        }
예제 #3
0
        public AODText(Game game, string text, float lifeTime, Color color, Vector2 position, FadeOutState fadeOutState, Vector2 velocity, bool centerize)
        {
            font = game.Content.Load <SpriteFont>(@"msyh");

            this.game         = game;
            this.Text         = text;
            this.color        = color;
            this.position     = position;
            this.lifeTime     = lifeTime;
            this.FadeOutState = fadeOutState;
            this.velocity     = velocity;
            this.centerize    = centerize;
        }
예제 #4
0
 public AODText(GameWorld gameWorld, string text, float lifeTime, Color color, Vector2 position, FadeOutState fadeOutState, Vector2 velocity, bool centerize)
 {
     this.gameWorld    = gameWorld;
     this.game         = gameWorld.game;
     font              = gameWorld.GameFont;
     this.Text         = text;
     this.color        = color;
     this.position     = position;
     this.lifeTime     = lifeTime;
     this.FadeOutState = fadeOutState;
     this.velocity     = velocity;
     this.centerize    = centerize;
 }
예제 #5
0
        public static AODText CreateText(string text, float lifeTime, Color color, Vector2 position, GameWorld gameWorld, FadeOutState fadeOutState, Vector2 velocity)
        {
            AODText a = AODText.CreateText(text, lifeTime, color, position, gameWorld, fadeOutState);

            a.velocity = velocity;
            return(a);
        }
예제 #6
0
        /// <summary>
        /// 创建一行信息
        /// </summary>
        /// <param name="text">内容</param>
        /// <param name="lifeTime">存在时间</param>
        /// <param name="color">颜色</param>
        /// <param name="position">位置</param>
        public static AODText CreateText(string text, float lifeTime, Color color, Vector2 position, GameWorld gameWorld, FadeOutState fadeOutState)
        {
            AODText a = new AODText(gameWorld);

            a.Text         = text;
            a.color        = color;
            a.position     = position;
            a.lifeTime     = lifeTime;
            a.FadeOutState = fadeOutState;
            return(a);
        }
예제 #7
0
 public AODText(GameWorld gameWorld, string text, float lifeTime, Color color, Vector2 position, FadeOutState fadeOutState, Vector2 velocity, bool centerize, float scale)
     : this(gameWorld, text, lifeTime, color, position, fadeOutState, velocity, centerize)
 {
     this.scale = scale;
 }