/// <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()) }; }
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(); } }
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; }
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); } }
/// <summary> /// Initializes a new instance of the <see cref="Frog" /> class. /// </summary> public Frog() { Sprite = new FrogSprite(); SetSpeed(SpeedXDirection, SpeedYDirection); }
/// <summary> /// Initializes a new instance of the <see cref="Frog" /> class. /// </summary> public Frog() { Sprite = new FrogSprite(); CurrentHeading = Heading.Up; SetSpeed(SpeedXDirection, SpeedYDirection); }