If IsGoner Then
If Doompause >= DOOMTIMEOUT Then
GFX.TranslateTransform(Convert.ToSingle(PlayerLoc.X) + (Me.CHARWIDTH >> 1) - ScreenLeft, Convert.ToSingle(PlayerLoc.Y) + (Me.CHARWIDTH >> 1))
'Move the center point to the center of the character's midpoint.
GFX.RotateTransform(RotateAngle)
'Spin the character clockwise.
RotateAngle += SPINOUTSPEED
If IsJumping Then
GFX.DrawImage(PlayerBmp, -Me.CHARWIDTH >> 1, -Me.CHARHEIGHT >> 1, New Rectangle((CHARWIDTH * WALKINGFRAMECOUNT << 1) + CharDirec * CHARWIDTH, 0, CHARWIDTH, CHARHEIGHT), GraphicsUnit.Pixel)
'Draw the character centered on the point 0, 0
Else
GFX.DrawImage(PlayerBmp, -Me.CHARWIDTH >> 1, -Me.CHARHEIGHT >> 1, New Rectangle(CHARWIDTH * CharDirec * WALKINGFRAMECOUNT + AnimCycler * CHARWIDTH, 0, CHARWIDTH, CHARHEIGHT), GraphicsUnit.Pixel)
'This draws the character to the display, based on the current character location, frame, and state.
End If
PlayerLoc.Offset(0, PlayerVeloc + GRAVITY >> 1)
'Gravity-based calculations that we have already done in CharacterMovement.
PlayerVeloc += GRAVITY
GFX.ResetTransform()
Else
RotateAngle = 0.0F
'Reset the rotateangle for our tumbling-spinning character.
Doompause += 1
'Increment the delay counter.
If IsJumping Then
GFX.DrawImage(PlayerBmp, PlayerLoc.X - ScreenLeft, PlayerLoc.Y, New Rectangle((CHARWIDTH * WALKINGFRAMECOUNT << 1) + CharDirec * CHARWIDTH, 0, CHARWIDTH, CHARHEIGHT), GraphicsUnit.Pixel)
'Jumping draw only.
Else
GFX.DrawImage(PlayerBmp, PlayerLoc.X - ScreenLeft, PlayerLoc.Y, New Rectangle(CHARWIDTH * CharDirec * WALKINGFRAMECOUNT + AnimCycler * CHARWIDTH, 0, CHARWIDTH, CHARHEIGHT), GraphicsUnit.Pixel)
'This draws the character to the display, based on the current character location, frame, and state.
End If
End If
Else
If IsJumping Then
GFX.DrawImage(PlayerBmp, PlayerLoc.X - ScreenLeft, PlayerLoc.Y, New Rectangle((CHARWIDTH * WALKINGFRAMECOUNT << 1) + CharDirec * CHARWIDTH, 0, CHARWIDTH, CHARHEIGHT), GraphicsUnit.Pixel)
'Jumping draw only.
Else
GFX.DrawImage(PlayerBmp, PlayerLoc.X - ScreenLeft, PlayerLoc.Y, New Rectangle(CHARWIDTH * CharDirec * WALKINGFRAMECOUNT + AnimCycler * CHARWIDTH, 0, CHARWIDTH, CHARHEIGHT), GraphicsUnit.Pixel)
'This draws the character to the display, based on the current character location, frame, and state.
End If
End If |