/*広告*/

/*STGの作り方 中間ソース2*/

/*目次へ戻る*/

#include "DxLib.h" void my_init_back_img(void); void my_init_variable(void); void my_move_back(void); void my_draw_back(void); void my_draw_score_board(void); void my_timer(void); int my_get_key(void); int key[256]; double back_img_y; int back_img; int gamecount; int Color_White; int Color_Gray; int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int){ ChangeWindowMode(TRUE); DxLib_Init(); SetDrawScreen(DX_SCREEN_BACK); my_init_back_img(); my_init_variable(); while (ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 && my_get_key()==0){ my_move_back(); my_draw_back(); my_draw_score_board(); my_timer(); } DxLib_End(); return 0; } void my_init_back_img(){ back_img = LoadGraph("../back_img.jpg"); } void my_init_variable(){ gamecount = 0; Color_White = GetColor(255, 255, 255); Color_Gray = GetColor(100, 100, 100); back_img_y = 0; } void my_move_back(){ back_img_y++; if (back_img_y > 480){ back_img_y = 0; } } void my_draw_back(){ DrawGraph(0, back_img_y, back_img, TRUE); DrawGraph(0, back_img_y - 480, back_img, TRUE); DrawLine(0, 240, 440, 240, Color_White); DrawLine(220, 0, 220, 480, Color_White); DrawFormatString(220, 240, Color_White, "(0,0)"); } void my_draw_score_board(){ DrawBox(440,0,640,480,Color_Gray,true); DrawFormatString(460, 20, Color_White, "gamecount = %d", gamecount); } void my_timer(){ gamecount++; } int my_get_key(){ char keys[256]; GetHitKeyStateAll(keys); for (int i = 0; i < 256; i++){ if (keys[i] != 0){ key[i]++; } else{ key[i] = 0; } } return 0; }

/*ページの先頭へ*/

/*目次へ戻る*/

/*HOME*/

/*Copyright 2016 K.N/petitetech.com*/

/*広告*/