これがそのプログラムです。
#include "DxLib.h"
int Key[256];
int GetHitKeyStateAll_2(int GetHitKeyStateAll_InputKey[]){
char GetHitKeyStateAll_Key[256];
GetHitKeyStateAll( GetHitKeyStateAll_Key );
for(int i=0;i<256;i++){
if(GetHitKeyStateAll_Key[i]==1) GetHitKeyStateAll_InputKey[i]++;
else GetHitKeyStateAll_InputKey[i]=0;
}
return 0;
}
int x=340, y=400;
int muki=1;
int jampfrag;
int jampp;
int kyara;
void walk(){
if(Key[KEY_INPUT_RIGHT]>=1){
muki=1;
x=x+2;
}
if(Key[KEY_INPUT_LEFT]>=1){
muki=2;
x=x-2;
}
}
void jamp(){
jampp=(400-y)/8;
if(Key[KEY_INPUT_UP]==1&&jampfrag==0){
jampfrag=1;
}
if(jampfrag==1){
y=y-6+jampp;
}
if(y==359){
jampp=2;
y++;
}
if(jampfrag==2){
y=y+jampp;
}
if(y==400&&jampfrag==2){
jampfrag=0;
}
}
void Draw(){
if(muki==1){
DrawGraph( x, y, kyara, TRUE);
}
if(muki==2){
DrawGraph( x, y, kyara, TRUE);
}
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){
ChangeWindowMode(TRUE);//ウィンドウモード
if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//初期化と裏画面化
kyara= LoadGraph("画像/キャラクタ00.png");
while(ProcessMessage()==0 && ClearDrawScreen()==0 && GetHitKeyStateAll_2(Key)==0 && Key[KEY_INPUT_ESCAPE]==0){
//↑メッセージ処理 ↑画面をクリア ↑入力状態を保存 ↑ESCが押されていない
//ココ!!
walk();
jamp();
Draw();
}
DxLib_End();
return 0;
}
プログラムが間違っているのでしょうか?それとも何かほかに問題があるのでしょうか?