Created
August 2, 2020 02:29
-
-
Save LoadDragon0000000000/e0d18b164468fe31124a2100eb84c1e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "DxLib.h" | |
#include <math.h> | |
const float DEGTORAD = 0.017453293f; // 度数表記をラジアンに変換する定数 | |
int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int) { | |
// ---ここから設定--- | |
ChangeWindowMode(TRUE), SetMainWindowText("きれいなジャンプ"), SetGraphMode(640, 480, 32), | |
SetDoubleStartValidFlag(TRUE); DxLib_Init(), SetDrawScreen(DX_SCREEN_BACK); | |
// ---ここまで設定--- | |
float PlayerY = 320.0f; | |
float JumpCount = 80; // ボタンが押された長さ(ここでは仮に80とする) | |
int JumpTimer = 0; | |
// ゲームループ | |
while (ScreenFlip() == 0 && ProcessMessage() == 0 && ClearDrawScreen() == 0) { | |
++JumpTimer; | |
PlayerY -= (20 + JumpCount + (-0.3270f) * (JumpTimer)) / 60; | |
DrawCircle(320, PlayerY, 30, GetColor(255, 0, 0), true); | |
} | |
DxLib_End(); return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment