Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.39 KB | None | 0 0
  1.  
  2. void SelectionsHome2::GameStart()
  3. {
  4.    
  5.    
  6. }
  7.  
  8. void SelectionsHome2::GameEnd()
  9. {
  10.    
  11. }
  12.  
  13. void SelectionsHome2::GameTick(double deltaTime)
  14. {
  15.     POINT mousePosition;
  16.     mousePosition = GAME_ENGINE->GetMousePosition();
  17.    
  18.         if (mousePosition.x >= 150 && mousePosition.x < 250 && mousePosition.y >= 150 && mousePosition.y && GAME_ENGINE->IsMouseButtonPressed(VK_LBUTTON))
  19.         {
  20.             m_Displacement += 1 + (100 * (int)deltaTime);
  21.             m_Opacity = 0;
  22.         }
  23.  
  24.  
  25.         if (m_Displacement == 200)
  26.         {
  27.             m_Displacement = 0;
  28.             m_Opacity = 255;
  29.         }
  30.  
  31.    
  32. }
  33.  
  34. void SelectionsHome2::GamePaint(RECT rect)
  35. {
  36.  
  37.  
  38.  
  39.     GAME_ENGINE->SetColor(COLOR(0, 0, 0));
  40.     GAME_ENGINE->DrawRect(150, 150, 250, 250);
  41.  
  42.     GAME_ENGINE->SetColor(COLOR(255, 0, 0, 150));
  43.     GAME_ENGINE->FillRect(150 - m_Displacement, 150 - m_Displacement, 200 - m_Displacement, 200 - m_Displacement);
  44.     GAME_ENGINE->FillRect(200 + m_Displacement, 150 - m_Displacement, 250 + m_Displacement, 200 - m_Displacement);
  45.     GAME_ENGINE->FillRect(150 - m_Displacement, 200 + m_Displacement, 200 - m_Displacement, 250 + m_Displacement);
  46.     GAME_ENGINE->FillRect(200 + m_Displacement, 200 + m_Displacement, 250 + m_Displacement, 250 + m_Displacement);
  47.  
  48.  
  49.     GAME_ENGINE->SetColor(COLOR(0, 0, 0, m_Opacity));
  50.     GAME_ENGINE->FillRect(150, 150, 250, 250);
  51.     GAME_ENGINE->SetColor(COLOR(255,255,255, m_Opacity));
  52.     GAME_ENGINE->DrawString(String("Click here"), 167, 190);
  53.    
  54.  
  55.  
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement