/*広告*/

/*STGの作り方 関数表示プログラム*/

/*目次へ戻る*/

#include "DxLib.h" void my_init_point(void); void my_init_color(void); void my_move_point(void); void my_to_center(void); void my_draw_back(void); void my_draw_point(void); void my_draw_score_board(void); double x,y,draw_x,draw_y; int count; int Color_White; int Color_Gray; int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int){ ChangeWindowMode(TRUE); DxLib_Init(); SetDrawScreen(DX_SCREEN_BACK); my_init_point(); my_init_color(); while (ScreenFlip() == 0 && ProcessMessage() == 0){ my_draw_back(); if(count % 10 == 1){ my_move_point(); my_to_center(); my_draw_point(); } my_draw_score_board(); count++; } DxLib_End(); return 0; } void my_init_point(){ x = -220; y = 0; draw_x = 0; draw_y = 0; } void my_init_color(){ Color_White = GetColor(255, 255, 255); Color_Gray = GetColor(100, 100, 100); } void my_move_point(){ x = x + 8; y = 1 * x; } void my_to_center(){ draw_x = x + 220; draw_y = ((-1) * y) + 240; } void my_draw_back(){ 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(490, 20, Color_White, "C言語入門"); DrawFormatString(475, 40, Color_White, "STGの作り方"); DrawFormatString(460, 60, Color_White, "関数表示プログラム"); DrawFormatString(500, 360, Color_White, "count:%d",count); DrawFormatString(500, 380, Color_White, "x座標:%d",(int)x); DrawFormatString(500, 400, Color_White, "y座標:%d",(int)y); } void my_draw_point(){ DrawCircle(draw_x,draw_y, 3, Color_White, 1); }

/*ページの先頭へ*/

/*目次へ戻る*/

/*HOME*/

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

/*広告*/