/// <summary>
        ///     Initializes a new instance of the <see cref="Frog" /> class.
        /// </summary>
        public Frog()
        {
            Sprite = new FrogSprite();

            DeathAnimationFrames = new List <FrogDeathFrame> {
                new FrogDeathFrame(new FrogDeathOne()),
                new FrogDeathFrame(new FrogDeathTwo()),
                new FrogDeathFrame(new FrogDeathThree()),
                new FrogDeathFrame(new FrogDeathFour())
            };
        }
示例#2
0
 private void generateLives()
 {
     this.lives = new FrogSprite[this.gameManager.Lives];
     for (var i = 0; i < this.gameManager.Lives; i++)
     {
         var life      = new FrogSprite();
         var xLocation = i * (life.Width + 5);
         life.RenderAt(xLocation, 0);
         this.canvas.Children.Add(life);
         this.lives[i] = life;
         this.createVisibleClock();
     }
 }
示例#3
0
        public PlayerManager(double topBoundary, double bottomBoundary, double leftBoundary, double rightBoundary)
        {
            this.Player       = new Frog();
            this.PlayerSprite = (FrogSprite)this.Player.Sprite;
            this.PlayerSprite.IsHitTestVisible = false;

            this.topBoundary    = topBoundary;
            this.bottomBoundary = bottomBoundary;
            this.leftBoundary   = leftBoundary;
            this.rightBoundary  = rightBoundary;

            this.PlayerSprite.NewSpriteCreated += this.onNewSpriteCreated;
        }
示例#4
0
        private void generateLandingSpotFrogs()
        {
            this.landingSpots = new Dictionary <LilyPad, FrogSprite>();
            foreach (var t in this.gameManager.GetFrogHomes())
            {
                var newLandingSpotFrog = new FrogSprite {
                    Visibility = Visibility.Collapsed
                };
                VisualStateManager.GoToState(newLandingSpotFrog, "Spinning", true);
                var xLocation = t.HitBox.X;
                var yLocation = t.HitBox.Y;
                newLandingSpotFrog.RenderAt(xLocation, yLocation);
                this.canvas.Children.Add(newLandingSpotFrog);

                this.landingSpots.Add(t, newLandingSpotFrog);
            }
        }
示例#5
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Frog" /> class.
 /// </summary>
 public Frog()
 {
     Sprite = new FrogSprite();
     SetSpeed(SpeedXDirection, SpeedYDirection);
 }
示例#6
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Frog" /> class.
 /// </summary>
 public Frog()
 {
     Sprite         = new FrogSprite();
     CurrentHeading = Heading.Up;
     SetSpeed(SpeedXDirection, SpeedYDirection);
 }