bool Dice::IsHit(int x, int y) //Dice.cpp
{
if (x >= m_Left && x <= m_Left + m_Width)
{
if (y >= m_Top && y <= m_Top + m_Height);
Throw();
return true;
}
else
{
return false;
}
return true;
}
void DiceGame::MouseButtonAction(bool isLeft, bool isDown, int x, int y, WPARAM wParam) //DiceGame.cpp
{
// Insert the code that needs to be executed when the game registers a mouse button action
if (isLeft == true && isDown == true) // is it a left mouse click?
{
m_Dice1->IsHit(x, y);
m_Dice2->IsHit(x, y);
GAME_ENGINE->Repaint();
}
}