示例#1
0
 public QuestionmarkBlock(Vector2 location)
 {
     stateMachine  = new QuestionmarkBlockStateMachine();
     Location      = location;
     Destination   = stateMachine.MakeDestinationRectangle(Location);
     coinAnimation = new CoinCollectedFromBlockAnimation(new Vector2(Location.X, Location.Y - Destination.Height));
 }
 public CoinBrickBlock(Vector2 location)
 {
     state           = new CoinBrickBlockStateMachine();
     Location        = location;
     initialLocation = location;
     fallingSpeed    = new Vector2(0, 0);
     fallingAcce     = new Vector2(0, 0.5f);
     destinationRect = state.MakeDestinationRectangle(Location);
     coinAnimation   = new CoinOutOfBlockAnimation(new Vector2(Location.X, Location.Y - Destination.Height));
 }
示例#3
0
        public CoinCollectedFromBlockAnimation(Vector2 location)
        {
            this.coinSprite = ItemSpriteFactory.Instance.CreateCoinSprite();
            this.State      = AnimationState.NotStart;
            Rectangle spriteDestination       = coinSprite.MakeDestinationRectangle(location);
            int       halfOfDestinationHeight = spriteDestination.Height / 2;

            this.endLocationY = location.Y - halfOfDestinationHeight;
            this.location     = new Vector2(location.X, endLocationY);
            Vector2 scoreLocation = new Vector2(spriteDestination.X, spriteDestination.Y - spriteDestination.Height);

            this.scoreAnimation = new ScoreTextAnimation(scoreLocation, "200");
        }
示例#4
0
 public void AddAnimation(IAnimationInGame animation)
 {
     animationList.Add(animation);
 }