Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "DxLib.h"
- #include "talk.h"
- #pragma warning(disable: 4996)
- #ifndef DEF_TAITOLH_H //二重include防止
- #define DEF_TAITOLH_H
- int tai = 1;
- int cheak = 0;
- int haikei = 1;
- int sound1 = 0;
- int sound2 = 0;
- //FILE* fp;
- //char filename[] = "test.dat";
- int buf_r[1], buf_w[1];
- int yomikomi = 0;
- typedef struct {
- int Seen;
- }SaveData_t;
- void taitol() {
- if (tai == 1) {
- SetFontSize(40); //サイズを64に変更
- if (haikei < 40&&++haikei > 0) {
- //LoadGraphScreen(0, 0, "BlendGraph.bmp", FALSE);
- int gh = LoadGraph("BlendGraph.bmp");
- DrawExtendGraph(0, 0, 1980, 1580, gh, TRUE);//画像の倍率を変える
- }
- if (haikei<70&&++haikei>=40) {
- int gh2 = LoadGraph("Back.bmp");
- DrawExtendGraph(0, 0, 1980, 1580, gh2, TRUE);//画像の倍率を変える
- }
- if(haikei == 70){ haikei = 1; }
- DrawFormatString(200, 360, GetColor(255, 255, 0), "kiLLers");
- DrawFormatString(200, 400, GetColor(255, 255, 0), "スペースキーを押してスタート");
- DrawFormatString(50, 450, GetColor(255, 255, 0), "yomikomiは%d,buf_r[yomikomi]は%d", yomikomi, buf_r[1]);
- if (Key[KEY_INPUT_SPACE] == 1) {
- startmark = 1;
- mark = 1;
- sound1 = LoadSoundMem("gun-gird1.mp3");
- PlaySoundMem(sound1, DX_PLAYTYPE_NORMAL);
- }
- if (mark == 1) {
- DrawFormatString(200, 500, GetColor(255, 255, 0), "キーAを押して続きから");
- DrawFormatString(200, 550, GetColor(255, 255, 0), "キーBを押して最初から");
- last = 0;
- }
- if (startmark==1&&Key[KEY_INPUT_B] == 1) {
- sound2 = LoadSoundMem("gun-fire05.mp3");
- PlaySoundMem(sound2, DX_PLAYTYPE_NORMAL);
- tai = 0;
- mark = 0;
- startmark = 2;
- }
- if (startmark == 1 && Key[KEY_INPUT_A] == 1) {
- //if (!(fp = fopen(filename, "wb")))
- //return;
- //if (fwrite(buf_w, sizeof(int), 1, fp) != 1) {
- //fclose(fp);
- //return;
- //}
- //fclose(fp);
- //SaveData_t Data;
- mark = 0;
- last = 1;//★ファイルのプログラムの後に書くとなぜか変数の値が反映されないので、ファイルの前に書いた。
- FILE* fp = fopen("test.dat", "r");
- if (!fp) return ;
- if (fscanf(fp, " Seen =%d", &Seen) != 1) return ;
- fclose(fp);
- printf("Seen = %d\n", Seen);
- //↓Seen以外の変数を扱いたい場合のプログラム。
- //FILE* fp = fopen("test.dat", "r");
- //if (!fp) return ;
- //if (fscanf(fp, " Seen =%d,talk =%d", &Seen,&talk) != 1) return ;
- //fclose(fp);
- //printf("Seen = %d\n,talk =%d\n", Seen,talk);
- //return 0;
- }
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement