void WillowGame::DrawWizard() { ++m_Ticker; if(m_Ticker > 20) { ++m_MoveTick; if(m_MoveTick > 3) m_MoveTick = 0; m_Ticker = 0; } int width = m_BmpWizardPtr->GetWidth()/4; int height = m_BmpWizardPtr->GetHeight(); DOUBLE2 wizardPos(120,650); MATRIX3X2 matWizard; matWizard.SetAsTranslate(wizardPos); RECT clip; clip.left = width * m_MoveTick; clip.right = clip.left + width; clip.top = 0; clip.bottom = height; GAME_ENGINE->SetTransformMatrix(matWizard * m_MatView); GAME_ENGINE->DrawBitmap(m_BmpWizardPtr,0,0,clip); }
void WillowGame::DrawBridge() { int logWidth = m_BmpBridgePtr->GetWidth(); int nrLogs = 20; int logXPos(1915); for(int i = 0; i < nrLogs; ++i) { logXPos += (logWidth * i); MATRIX3X2 matBridgePart; matBridgePart.SetAsTranslate(logXPos,464); GAME_ENGINE->SetTransformMatrix(matBridgePart * m_MatView); GAME_ENGINE->DrawBitmap(m_BmpBridgePtr,0,0); logXPos = 1915; } }
void PowerUpBombs::Paint(MATRIX3X2 matTransform) { RECT frame; frame.left=0; frame.right=0; frame.top=0; frame.bottom=0; int width=0; int heightStart=0; int heightEnd=0; //Standing still, no action if ( m_CurrentState == STATE_IDLE ) { // See SpriteSheet for values width=WIDTH; heightStart=0; heightEnd=HEIGHT; frame.left=width*m_TickCount+1; frame.right=width+width*m_TickCount-1; frame.top=heightStart+2; frame.bottom=heightEnd; } MATRIX3X2 matTranslate; matTranslate.SetAsTranslate(m_Pos); GAME_ENGINE->SetTransformMatrix(matTranslate*matTransform); GAME_ENGINE->DrawBitmap(m_BmpPowerUpBombsSpriteSheetPtr,0,0,frame); GAME_ENGINE->SetColor(COLOR(0,255,0,128)); GAME_ENGINE->SetTransformMatrix(matTransform); //GAME_ENGINE->FillHitRegion(m_HitRegionPtr); }
void WillowGame::TickCamera() { MATRIX3X2 matCamera; matCamera.SetAsTranslate(m_PosCamera); m_MatView = matCamera.Inverse(); }