C/C++の宿題片付けます 128代目at TECH
C/C++の宿題片付けます 128代目 - 暇つぶし2ch486:デフォルトの名無しさん
09/07/03 01:10:05
>>468
#include "DxLib.h"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    int cmd[] = { KEY_INPUT_UP, KEY_INPUT_UP, KEY_INPUT_DOWN, KEY_INPUT_DOWN,
        KEY_INPUT_LEFT, KEY_INPUT_RIGHT, KEY_INPUT_LEFT, KEY_INPUT_RIGHT,
        KEY_INPUT_B, KEY_INPUT_A };
    int key, cnt, num;

    ChangeWindowMode(TRUE);
    DxLib_Init();

    DrawString(5, 5, "Waiting for your namco command...", GetColor(0xFF, 0xFF, 0xFF));

    cnt = 0;
    num = sizeof(cmd) / sizeof(int);
    while(key = WaitKey()){
        if(cmd[cnt] == key) cnt++;
        else cnt = 0;
        if(cnt >= num) break;
    }
    DrawString(5, 30, "Your namco command was accepted! Press any key to exit.", GetColor(0xFF, 0xFF, 0xFF));
    WaitKey();

    DxLib_End();

    return 0;
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch