/*広告*/
/*STGの作り方 Sin値利用プログラム*/
#include "DxLib.h" #include <math.h> int my_get_key(void); int key[256]; int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int){ ChangeWindowMode(TRUE); DxLib_Init(); SetDrawScreen(DX_SCREEN_BACK); int gamecount = 0; int Color_White = GetColor(255,255,255); float x = 0; float angle = 0; while (ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 && my_get_key()==0){ angle++; float angle2 = angle * (DX_PI / 180); x = sin(angle2) * 200 + 320; DrawFormatString(x,240,Color_White, "Sin"); } DxLib_End(); return 0; } 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; }/*Copyright 2016 K.N/petitetech.com*/
/*広告*/