Advertisement
baadgeorge

source1

May 31st, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. # pragma once
  2. #include <windows.h>
  3. #include <conio.h>
  4. #include <iostream>
  5. #include "Classes.h"
  6.  
  7. using namespace std;
  8.  
  9. #define KEY_DOWN(vk_code)((GetAsyncKeyState(vk_code)) & 0x8000 ? 1 : 0)
  10.  
  11. void PressKey(int VkCode);
  12.  
  13. HDC hdc;
  14.  
  15. int main()
  16. {
  17. int X_0 = 300;
  18. int Y_0 = 0;
  19. int Scale_0 = 1;
  20. double Angle_0 = 30.0;
  21. //double current_Angle;
  22. //double Angle_step = 10.0;
  23. int Step = 20;
  24. system("color F0");
  25.  
  26. HWND hwnd = GetConsoleWindow();
  27.  
  28. if (hwnd != NULL)
  29. {
  30. hdc = GetWindowDC(hwnd);
  31. if (hdc != 0)
  32. {
  33.  
  34. Grinder _Grinder(X_0, Y_0, Scale_0, Angle_0);
  35. Rock _Rock(X_0, Y_0, Scale_0);
  36. River _River(X_0, Y_0, Scale_0);
  37. while (1)
  38. {
  39. if (KEY_DOWN(VK_ESCAPE))
  40. break;
  41. _River.Show();
  42. //current_Angle = _Grinder.GetAngleWH();
  43.  
  44. _Grinder.Show();
  45.  
  46. //if (current_Angle < 90.0)
  47. //{
  48. //current_Angle += 10.0;
  49. //}
  50. //else current_Angle = 0;
  51. //_Grinder.SetAngleWH(current_Angle);
  52. _Rock.Show();
  53.  
  54. _Rock.MoveTo(_Rock.GetX() + Step, _Rock.GetY());
  55.  
  56. //_Grinder.Show();
  57.  
  58.  
  59. Sleep(100);
  60. _River.Hide();
  61. _Grinder.Hide();
  62. _Rock.Hide();
  63.  
  64. }
  65. }
  66. }
  67.  
  68. }
  69. void PressKey(int VkCode)
  70. {
  71. while (1)
  72. {
  73. if (KEY_DOWN(VkCode))
  74. {
  75. break;
  76. }
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement