fork(1) download
  1. #include <Siv3D.hpp>
  2.  
  3. typedef struct
  4. {
  5. int x, y, flag,f;
  6. float prd;
  7. float mvsp;
  8. }Mario;
  9.  
  10. void Main()
  11. {
  12. const Texture img(L"image/ball.png");
  13. const int H = 1280;
  14. const int W = 720;
  15. const int F = 20;
  16. const int MotionSpeed = 2;
  17. double ForSin = 0.01;
  18. const Font font(30);
  19. Window::Resize(H, W);
  20. Mario mario;
  21. mario.y = 0;
  22. mario.x = 720/2;
  23. mario.prd = 0;
  24. mario.flag = 1;
  25. mario.f = 0;
  26. mario.mvsp = 0;
  27. while (System::Update())
  28. {
  29.  
  30. if (Input::KeyX.clicked)
  31. {
  32. mario.flag = 1;
  33. mario.f = F;
  34. }
  35. if (Input::KeyX.pressed && mario.flag == 1 && mario.prd < F*1.25)
  36. {
  37. ForSin -= 0.0125;
  38. mario.prd -=MotionSpeed*ForSin;
  39. }
  40.  
  41. if (mario.flag == 1) mario.prd+=MotionSpeed;
  42. if (mario.y > W - 64)
  43. {
  44. ForSin = 1;
  45. mario.f = 0;
  46. mario.prd = 0;
  47. mario.flag = 0;
  48. mario.y = W - 64;
  49. }
  50. mario.y = mario.y - (mario.f - mario.prd);
  51.  
  52.  
  53.  
  54. if (Input::KeyZ.pressed)
  55. {
  56. mario.mvsp++;
  57. if (mario.flag)
  58. {
  59. mario.mvsp -= 0.5;
  60. }
  61. }
  62. if (Input::KeyC.pressed)
  63. {
  64. mario.mvsp--;
  65. if (mario.flag)
  66. {
  67. mario.mvsp += 0.5;
  68. }
  69. }
  70. if (mario.flag == 0)
  71. {
  72. if (mario.mvsp < 0 && mario.flag == 0) mario.mvsp += 0.5;
  73. if (0 < mario.mvsp && mario.flag == 0) mario.mvsp -= 0.5;
  74.  
  75. }
  76. mario.x = mario.x - mario.mvsp;
  77. img.draw(int(mario.x),int(mario.y));
  78.  
  79.  
  80.  
  81. font(mario.y).draw(256,0);
  82. font(mario.prd).draw(256,36);
  83. font(mario.f).draw(256,72);
  84. font(mario.flag).draw(256,108);
  85. font(L"PosY:").draw(0, 0);
  86. font(L"JumpPow:").draw(0, 36);
  87. font(L"PJumpPow:").draw(0, 72);
  88. font(L"onAir?:").draw(0, 108);
  89. }
  90. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:21: fatal error: Siv3D.hpp: No such file or directory
 #include <Siv3D.hpp>
                     ^
compilation terminated.
stdout
Standard output is empty