Advertisement
Guest User

Untitled

a guest
May 2nd, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "gamemgr.h"
  3. #include <ctime>
  4.  
  5. int main(){
  6. srand(time(NULL));
  7. }
  8.  
  9. int xPos = rand() % 500;
  10. int yPos = 25;
  11. int xInc = XBALLINC, yInc = YBALLINC;
  12.  
  13. void DrawEnclosure(HWND hwnd, HDC hdc) {
  14.  
  15. MoveToEx(hdc, 25, 25, NULL); LineTo(hdc, 475, 25);
  16. MoveToEx(hdc, 25, 25, NULL); LineTo(hdc, 25, 475);
  17. MoveToEx(hdc, 25, 475, NULL); LineTo(hdc, 475, 475);
  18. MoveToEx(hdc, 475, 475, NULL); LineTo(hdc, 475, 25);
  19. }
  20.  
  21. void DrawBlocks(HWND hwnd, HDC hdc) {
  22. RECT r;
  23.  
  24. GetClientRect(hwnd, &r);
  25. if (yPos < 25)
  26. yInc = XBALLINC;
  27. if (yPos > 475 - BALLHEIGHT)
  28. yInc = -YBALLINC;
  29. yPos += yInc;
  30.  
  31. RoundRect(hdc, xPos, yPos,
  32. xPos + BALLWIDTH, yPos + BALLHEIGHT, 2, 2);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement