'we traveling vertically?
Private m_xVelocityBoris As Integer 'How fast are we
'traveling vertically?
Const MAX_DY_BORIS_FLYING = 4
Private m_y_accelerationBorris As Integer
Private m_world_I_Inhabit As PlayFieldManager
Private m_myModeOfMovement As ModeOfMovement
Public Enum ModeOfMovement As Integer
Flying = 1
End Enum
'When did we last update a flipped image
Private m_lastTickCountWhenImageFlipped As Integer
Const DTIME_TO_FLAP_WINGS = 400 'Every 600 ms we should
'flap our wings
'–
'These are the current image states for Hank
'–
Private Enum BorisImagesIndexes
flyLeft1 = 1
flyLeft2 = 2
End Enum
'–
'[in] X,Y : Position to start Hank at
'[in] worldHankInhabits : Playfield in which Hank lives
'–
Sub New(ByVal x As Integer, ByVal y As Integer, _
ByVal world_I_Inhabit As PlayFieldManager)
'–
'Get the bitmaps for our character
'–
Dim col As Collection
col = g_FlyingBirdPictureCollection()
m_world_I_Inhabit = world_I_Inhabit
ChangeMyMovementState(ModeOfMovement.Flying)
'Start him off as falling.
'Initialize our base class with these…
MyBase.Initialize_DrawableMultiPlayfiedBitmapObject( _
x, y, col, True)
'Set the image index
Me.CurrentFrameIndex = BorisImagesIndexes.flyLeft1
'Set Boris' speed
m_xVelocityBoris = -4
m_y_accelerationBorris = 1
'–
'Set the collision rectangle for Hank
'–
Const BORIS_COLLISION_STARTX = 11
Const BORIS_COLLISION_DX = 31
Const BORIS_COLLISION_STARTY = 6
Const BORIS_COLLISION_DY = 7