Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SelectionsHome2::GameStart()
- {
- }
- void SelectionsHome2::GameEnd()
- {
- }
- void SelectionsHome2::GameTick(double deltaTime)
- {
- POINT mousePosition;
- mousePosition = GAME_ENGINE->GetMousePosition();
- if (mousePosition.x >= 150 && mousePosition.x < 250 && mousePosition.y >= 150 && mousePosition.y && GAME_ENGINE->IsMouseButtonPressed(VK_LBUTTON))
- {
- m_Displacement += 1 + (100 * (int)deltaTime);
- m_Opacity = 0;
- }
- if (m_Displacement == 200)
- {
- m_Displacement = 0;
- m_Opacity = 255;
- }
- }
- void SelectionsHome2::GamePaint(RECT rect)
- {
- GAME_ENGINE->SetColor(COLOR(0, 0, 0));
- GAME_ENGINE->DrawRect(150, 150, 250, 250);
- GAME_ENGINE->SetColor(COLOR(255, 0, 0, 150));
- GAME_ENGINE->FillRect(150 - m_Displacement, 150 - m_Displacement, 200 - m_Displacement, 200 - m_Displacement);
- GAME_ENGINE->FillRect(200 + m_Displacement, 150 - m_Displacement, 250 + m_Displacement, 200 - m_Displacement);
- GAME_ENGINE->FillRect(150 - m_Displacement, 200 + m_Displacement, 200 - m_Displacement, 250 + m_Displacement);
- GAME_ENGINE->FillRect(200 + m_Displacement, 200 + m_Displacement, 250 + m_Displacement, 250 + m_Displacement);
- GAME_ENGINE->SetColor(COLOR(0, 0, 0, m_Opacity));
- GAME_ENGINE->FillRect(150, 150, 250, 250);
- GAME_ENGINE->SetColor(COLOR(255,255,255, m_Opacity));
- GAME_ENGINE->DrawString(String("Click here"), 167, 190);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement