Advertisement
Guest User

Untitled

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