/// <summary>
 ///     Animates the frog jump.
 ///     Precondition: none
 ///     Postcondition: Frog animation queued to new timer
 /// </summary>
 /// <param name="frog">The frog.</param>
 /// <param name="frogDirection">The frog direction.</param>
 public void AnimateFrogJump(Frog frog, GameObject.Direction frogDirection)
 {
     this.player        = frog;
     this.direction     = frogDirection;
     this.FrogJumping   = true;
     this.frogJumpTicks = 0;
     this.animateFrogJumpSprite();
     this.setupJumpAnimationTimer();
     this.jumpTimer.Start();
 }
Exemple #2
0
        public static bool isScreenEdge(GameObject.Direction Dir, Rectangle Position)
        {
            switch (Dir)
            {
            case (GameObject.Direction.UP):
                return(Position.Y <= 0);

            case (GameObject.Direction.DOWN):
                return(Position.Y + Position.Height >= graphics.GraphicsDevice.Viewport.Height);

            case (GameObject.Direction.LEFT):
                return(Position.X <= 0);

            case (GameObject.Direction.RIGHT):
                return(Position.X + Position.Width >= graphics.GraphicsDevice.Viewport.Width);
            }
            return(false);
        }
 private void playerMoved(object sender, GameObject.Direction direction)
 {
     this.animationManager.AnimateFrogJump(this.player, direction);
 }
 private void onPlayerMoved(GameObject.Direction direction)
 {
     this.PlayerMoved?.Invoke(this, direction);
 }