// 塗り潰し円(回転、拡大縮小つき) // center_x, center_y 円の中心位置 // radius_x, radius_y 半径(横と縦) // division 円の分割数(数値が大きいと滑らかな円になる) // color 色 // angle_rad 回転角度(ラジアン) // scaling 横、縦の拡大縮小率 // origin 矩形の原点位置 void drawFillCircle(const float center_x, const float center_y, const float radius_x, const float radius_y, const int division, const Color& color, const float angle_rad, const Vec2f& scaling, const Vec2f& origin) { // 回転、拡大縮小の行列を生成 auto matrix = transformMatrix2D(angle_rad, Vec3f(center_x, center_y, 0.0f), Vec3f(scaling.x(), scaling.y(), 1.0f)); // 行列をOpenGLに設定 glPushMatrix(); glMultMatrixf(matrix.data()); // 描画 drawFillCircle(-origin.x(), -origin.y(), radius_x, radius_y, division, color); // 行列を元に戻す glPopMatrix(); }
void Player::Draw() { //drawFillBox(pos.x()-size.x(), pos.y()-size.y(), // size.x()*2, size.y()*2, Color::red); drawFillCircle(pos.x(), pos.y(), size.x(), size.y(), 20, Color::red); }
// 描画 void CSmallEnemy::Draw(AppEnv &app_env){ if (m_state == State::NONE){ return; } else if(m_state == State::LIVE){ drawFillCircle(m_pos.x(), m_pos.y(), m_r.x(), m_r.y(), 30, m_color); } for (auto &FireWorks : m_fireworks){ FireWorks->Draw(app_env); } }
void CircleGuiIn::Draw(const std::string& text,int f_size) { Vec2f font_size; my_font.read("res/meiryo.ttc"); my_font.size(f_size); drawFillCircle(pos.x(), pos.y(), radius.x(), radius.y(), 100, color, 0, scale, origin); font_size=my_font.drawSize(text); my_font.draw(text, pos - (font_size / 2), Color::black); }
void dispPlayPoint(int play_point){ float x = -Window::WIDTH / 2 + 50 + 10; float y = -Window::HEIGHT / 2 + 25 + 10; int ten_points = play_point / 10; while (ten_points > 0){ drawFillCircle(x, y, 15, 15, 20, Color(1, 0, 0)); x += 15 * 2 + 5; ten_points -= 1; } int one_points = play_point % 10; while (one_points > 0){ drawFillCircle(x, y, 10, 10, 20, Color(1, 1, 0)); x += 10 * 2 + 5; one_points -= 1; } }
int main() { Vec2f pos(0,0); Vec2f size(50, 50); float rotate = 0; float angle = 0; float rotateSpeed = 3; float length = 0; Vec2f mousePos; Vec2f sPos(0, 0); bool active = false; while (env.isOpen()) { env.begin(); mousePos = env.mousePosition(); if (env.isPushButton(Mouse::LEFT)) { // マウスの位置を支点に sPos = mousePos; //ラジアン角度を求める rotate = (atan2(pos.y() - sPos.y(), pos.x() - sPos.x()))* 180/M_PI; length = sqrt(((pos.x() - sPos.x()) * (pos.x() - sPos.x())) + ((pos.y() - sPos.y()) * (pos.y() - sPos.y()))); active = true; } // 長押ししている間振り子の動き if (active) { pos = Pendulum::Gravity(pos, sPos, rotate , rotateSpeed, length); } if (env.isPullButton(Mouse::LEFT)) { active = false; } drawFillCircle(pos.x(), pos.y(), size.x(), size.y(), 20, Color::red); env.end(); } return 0; }
void Draw()// 描画処理 { if (icon.is_active) drawFillCircle(icon.pos_x, icon.pos_y, icon.size.x(), icon.size.y(), 30, Color::red); }
int main() { CApp::get(); Media sio("res/SIO.wav"); int pos_x[5] = { -200, -100, 0, 100, 200 }; bool is_hit[BULLET_MAX]; for (int i = 0; i < BULLET_MAX; ++i) { is_hit[i] = true; } float icon_x[] = { -200,200,-100,100,-200, -100, 100,200,100,-100, 100,200,-100,-200,200, 200,100,-100,-200,-200, -200,-100,100,200,200, 200,100,-100,-200 }; float icon_y[] = { 950/4, 2200/4, 2400/4, 2600/4, 3500/4, 4400/4, 4600/4, 4800/4, 5000/4, 5200/4, 5400/4, 5600/4, 5800/4, 6050/4, 7000/4, 7100/4, 7300/4, 7450/4, 7600/4, 8700/4, 8800/4, 9000/4, 9150/4, 9300/4, 10400/4, 10500/4, 10700/4, 10850/4, 11000/4, }; Vec2f icon_size = Vec2f(15.5f,6.25f); Cnode Note[BULLET_MAX]; // ノートを29個分生成 Cjudge judge = Cjudge(); float geter_icon_pos_y[BULLET_MAX]; for (int i = 0; i < BULLET_MAX; ++i) { geter_icon_pos_y[i] = 0; } sio.play(); bool temp_flag[BULLET_MAX]; for (int i = 0; i < BULLET_MAX; ++i) { temp_flag[i] = false; } while (CApp::get().isOpen()) { CApp::get().begin(); deltaTime = clock() - lastFrameTime; // 移動用デルタタイム lastFrameTime = clock(); for (int i = 0; i < 5; ++i) { drawFillCircle(pos_x[i], -200, 30, 7.5, 30, Color::red); } for (int i = 0; i < BULLET_MAX; ++i) { Note[i].Init(icon_x[i], icon_y[i], icon_size); // 一回のみ初期化 Note[i].Draw(); // 描画処理 Note[i].Move(deltaTime * 0.15f); // 移動処理 } for (int i = 0; i < BULLET_MAX; ++i) { geter_icon_pos_y[i] = Note[i].Get_icon_pos_y(); } if (CApp::get().isPushKey('A')) { for (int i = 0; i < BULLET_MAX; ++i) { if (!temp_flag[i] && Inside(geter_icon_pos_y[i], -150, -250)) { temp_flag[i] = true; break; } } } for (int i = 0; i < BULLET_MAX; ++i) { //if (!Note[i].Is_active()) continue; if (temp_flag[i] == true) { Note[i].Is_dead(); judge.Is_draw_active(geter_icon_pos_y[i]); judge.draw(); } } CApp::get().end(); } }
int main() { AppEnv env(1640, 1480); Texture ziki("res/ziki.png"); int a; Player player; player.pos = Vec2f(0, 0); player.size = Vec2f(ziki.width(), ziki.height()); player.dir = Right; Shot shots[Shot_Max]; for (int i = 0; i < Shot_Max; ++i){ shots[i].active = false; shots[i].size = Vec2f(5, 5); } while (env.isOpen()) { env.begin(); if (env.isPressKey(GLFW_KEY_RIGHT)){ player.dir = Right; } if (env.isPressKey(GLFW_KEY_LEFT)){ player.dir = Left; } if (env.isPushKey('A')){ for (int i = 0; i < Shot_Max; ++i){ if (!shots[i].active){ shots[i].dir = player.dir; shots[i].pos = player.pos; shots[i].active = true; break; } } } //弾の移動 for (int i = 0; i < Shot_Max; ++i){ if (shots[i].active){ shots[i].pos.x() += (Shot_Speed * shots[i].dir); } } drawTextureBox(player.pos.x() + (player.dir * -(player.size.x() * 0.5f)), player.pos.y(), player.size.x(), player.size.y(), 0, 0, player.size.x(), player.size.y(), ziki, Color::white, 0, Vec2f(player.dir, 1), Vec2f::Zero()); for (int i = 0; i < Shot_Max; ++i){ if (shots[i].active){ drawFillCircle(shots[i].pos.x(), shots[i].pos.y(), shots[i].size.x(), shots[i].size.y(), 2, Color::red); } } env.end(); } }
int main() { // アプリウインドウの準備 AppEnv app_env(Window::WIDTH, Window::HEIGHT); while (1){ int hi_score = 0; { std::ifstream fstr("score.txt"); if (fstr) { fstr >> hi_score; } } Texture title_image("res/title.png");//サイズ512*256 Texture pstart_image("res/push_start.png");//サイズ512*128 Texture njp_image("res/NJ-P.png");//サイズ128*256 Texture suriken_image("res/surikenn.png");//サイズ64*64 Texture player_image("res/player.png");//サイズ16*16 Texture ktn_image("res/katana.png");//サイズ64*128 Texture setu_image("res/Setumei2.png");//サイズ1024*1024 Texture gst_image("res/gstart.png");//サイズ512*128 Texture lizlt_image("res/FOR_P.png");//サイズ1024*1024 Texture titleback_image("res/titleback.png");//サイズ512*128 Texture yasiki_image("res/yasiki.png");//サイズ512*256 Texture gover_image("res/p.png");//サイズ900*900 Texture setu2_image("res/setumei3.png");//サイズ900*900 Media bg_music("res/bgmusic.wav"); Media gstart_music("res/gamestart.wav"); Media gclear_music("res/gameclear.wav"); Media gover_music("res/gameover.wav"); Media atk_music("res/atk.wav"); float pstart_angle = 0.0; float gst_angle = 0.0; int play_time = 60 * 20; int play_point = 0; int i1 = 0; int i2 = 0; int i3 = 0; int i4 = 0; int i5 = 0; int i6 = 0; int i7 = 0; int i8 = 0; int i9 = 0; int i10 = 0; int i11 = 0; int i12 = 0; float random1 = 0; float random2 = 0; float random3 = 0; float random4 = 0; float random5 = 0; float random6 = 0; float random7 = 0; float random8 = 0; float random9 = 0; float random10 = 0; float random11 = 0; float random12 = 0; int G1 = 1; int G2 = 1; int G3 = 1; int G4 = 1; int G5 = 1; int G6 = 1; int G7 = 1; int G8 = 1; int G9 = 1; int G10 = 1; int G11 = 1; int G12 = 1; bool on_emy1 = true; bool on_emy2 = true; bool on_emy3 = true; bool on_emy4 = true; bool on_emy5 = true; bool on_emy6 = true; bool on_emy7 = true; bool on_emy8 = true; bool on_emy9 = true; bool on_emy10 = true; bool on_emy11 = true; bool on_emy12 = true; int vx1 = 0; int vx2 = 0; int vx3 = 0; int vx4 = 0; int vx5 = 0; int vx6 = 0; int vy1 = 0; int vy2 = 0; int vy3 = 0; int vy4 = 0; int vy5 = 0; int vy6 = 0; int x1 = 0; int x = 0; int y = 0; app_env.bgColor(Color(0.3, 0.3, 0.3)); // メインループ float ktn_angle = 0; bool ktn = false; float A = 4; int r = 0; int r1 = 0; gstart_music.play(); gstart_music.looping(true); gstart_music.gain(0.5); while (1) { int hi_score = 0; { std::ifstream fstr("score.txt"); if (fstr) { fstr >> hi_score; } } { // ウィンドウが閉じられたらアプリを終了 if (!app_env.isOpen()) return 0; // 描画準備 app_env.setupDraw(); dispPlayPoint(hi_score); if (app_env.isPushButton(Mouse::LEFT)) break; if (app_env.isPushButton(Mouse::RIGHT)) break; drawTextureBox(0 - 512 / 2, 0, 512, 256, 0, 0, 512, 256, title_image, Color(1, 1, 1)); pstart_angle += 0.1; float pstart_color = (std::sin(pstart_angle)); if (pstart_color > 0){ pstart_color = 1; } std::cout << pstart_color << std::endl; drawTextureBox(0 - 512 / 2, -330, 512, 128, 0, 0, 512, 128, pstart_image, Color(pstart_color, pstart_color, pstart_color)); // ここにゲームの処理を書く // K = 1; // 画面を更新 app_env.update(); } app_env.flushInput(); } while (1){ // ウィンドウが閉じられたらアプリを終了 if (!app_env.isOpen()) return 0; // 描画準備 app_env.setupDraw(); drawTextureBox(-1000 / 2, -900 / 2 + 10, 1024, 1024, 0, 0, 1000, 900, setu_image, Color(1, 1, 1)); if (app_env.isPushKey(GLFW_KEY_ENTER)){ gstart_music.looping(false); gstart_music.stop(); break; } gst_angle += 0.1; float gst_color = (std::sin(gst_angle)); if (gst_color > 0){ gst_color = 1; } drawTextureBox(0 - 512 / 2, -900 / 2 - 5 + 10, 512, 128, 0, 0, 512, 128, gst_image, Color(gst_color, gst_color, gst_color)); app_env.update(); } app_env.flushInput(); /* while (1){ // ウィンドウが閉じられたらアプリを終了 if (!app_env.isOpen()) return 0; // 描画準備 app_env.setupDraw(); drawTextureBox(-900 / 2, -900 / 2, 1024, 1024, 0, 0, 900, 900, setu2_image, Color(1, 1, 1)); if (app_env.isPushKey(GLFW_KEY_ENTER)){ gstart_music.looping(false); gstart_music.stop(); break; } app_env.update(); } app_env.flushInput(); */ bg_music.play(); bg_music.looping(true); bg_music.gain(0.1); while (1){ { if (!app_env.isOpen()) return 0; app_env.setupDraw(); float angle = 0; angle = angle + 0.1; Vec2f mouse_pos = app_env.mousePosition(); drawFillCircle(mouse_pos.x(), mouse_pos.y(), 8, 8, 100, Color(1, 0, 0)); ktn_angle -= 0.49; if (app_env.isPushButton(Mouse::LEFT)){ ktn = true; } if (ktn == true){ atk_music.play(); atk_music.gain(0.2); drawTextureBox(mouse_pos.x(), mouse_pos.y(), 64, 128, 0, 0, 64, 128, ktn_image, Color(1, 1, 1), M_PI*ktn_angle, Vec2f(1, 1), Vec2f(1, 1)); A -= 1; if (A < 0){ ktn = false; A = 4; } } drawTextureBox(-900 / 2 + 30, -900 / 2, 128, 256, 0, 0, 128, 256, njp_image, Color(1, 1, 1)); time_t date; srand(time(&date)); r1 = rand() % 4; random1 = rand() % 450 * -1; random2 = rand() % 450; // random3 = rand() % 450 * -1; random4 = rand() % 450 * -1; random5 = rand() % 450; // random6 = rand() % 450 * -1; random7 = rand() % 450 * -1; random8 = rand() % 450; // random9 = rand() % 450 * -1; random10 = rand() % 450 * -1; random11 = rand() % 450; // random12 = rand() % 450 * -1; float x1 = -450 + vx1; float x2 = -450 + vx2; // float x3 = -450 + vx3; float x4 = 450 + vx4; float x5 = 450 + vx5; // float x6 = 450 + vx6; float y7 = -450 + vy1; float y8 = -450 + vy2; // float y9 = -450 + vy3; float y10 = 450 + vy4; float y11 = 450 + vy5; // float y12 = 450 + vy6; float y1 = random1; float y2 = random2; // float y3 = random3; float y4 = random4; float y5 = random5; // float y6 = random6; float x7 = random7; float x8 = random8; // float x9 = random9; float x10 = random10; float x11 = random11; // float x12 = random12; on_emyA(G1, x1, y1, mouse_pos, A, on_emy1, play_point); on_emy(r1, r, on_emy1, x1, random1, vx1, suriken_image); on_emyRf(on_emy1, i1, G1, vx1); on_emyA(G2, x2, y2, mouse_pos, A, on_emy2, play_point); on_emy(r1, r, on_emy2, x2, random2, vx2, suriken_image); on_emyRf(on_emy2, i2, G2, vx2); /* on_emyA(G3, x3, y3, mouse_pos, A, on_emy3, play_point); on_emy(r1, r, on_emy3, x3, random3, vx3, suriken_image); on_emyRf(on_emy3, i3, G3, vx3); */ on_emyA(G4, x4, y4, mouse_pos, A, on_emy4, play_point); on_emyR(r1, r, on_emy4, x4, random4, vx4, suriken_image); on_emyRf(on_emy4, i4, G4, vx4); on_emyA(G5, x5, y5, mouse_pos, A, on_emy5, play_point); on_emyR(r1, r, on_emy5, x5, random5, vx5, suriken_image); on_emyRf(on_emy5, i5, G5, vx5); /* on_emyA(G6, x6, y6, mouse_pos, A, on_emy6, play_point); on_emyR(r1, r, on_emy6, x6, random6, vx6, suriken_image); on_emyRf(on_emy6, i6, G6, vx6); */ on_emyA(G7, x7, y7, mouse_pos, A, on_emy7, play_point); on_emy(r1, r, on_emy7, random7, y7, vy1, suriken_image); on_emyRf(on_emy7, i7, G7, vy1); on_emyA(G8, x8, y8, mouse_pos, A, on_emy8, play_point); on_emy(r1, r, on_emy8, random8, y8, vy2, suriken_image); on_emyRf(on_emy8, i8, G8, vy2); /* on_emyA(G9, x9, y9, mouse_pos, A, on_emy9, play_point); on_emy(r1, r, on_emy9, random9, y9, vy3, suriken_image); on_emyRf(on_emy9, i9, G9, vy3); */ on_emyA(G10, x10, y10, mouse_pos, A, on_emy10, play_point); on_emyR(r1, r, on_emy10, random10, y10, vy4, suriken_image); on_emyRf(on_emy10, i10, G10, vy4); on_emyA(G11, x11, y11, mouse_pos, A, on_emy11, play_point); on_emyR(r1, r, on_emy11, random11, y11, vy5, suriken_image); on_emyRf(on_emy11, i11, G11, vy5); /* on_emyA(G12, x12, y12, mouse_pos, A, on_emy12, play_point); on_emyR(r1, r, on_emy12, random12, y12, vy6, suriken_image); on_emyRf(on_emy12, i12, G12, vy6); */ /* if (K == 1){ drawTextureBox(-512 / 2 + 80, -100, 512, 256, 0, 0, 512, 256, yasiki_image, Color(1, 1, 1)); } if (K == 1){ if (vx1 >= 350 || vx2 >= 350 || vx3 >= 350 || vx4 <= -390 || vx5 <= -390 || vx6 <= -390) { if (random1 <= 80 && random1 >= -80 || random2 <= 100 && random2 >= -100 || random3 <= 100 && random3 >= -100 || random4 <= 100 && random4 >= -100 || random5 <= 100 && random5 >= -100 || random6 <= 100 && random6 >= -100){ K = 0; E = 1; bg_music.looping(false); break; } } } if (K == 1){ if (vy1 >= 350 || vy2 >= 350 || vy3 >= 350 || vy4 <= -460 || vy5 <= -460 || vy6 <= -460) { if (random7 <= 256 && random7 >= -256 || random8 <= 256 && random8 >= -256 || random9 <= 256 && random9 >= -256 || random10 <= 256 && random10 >= -256 || random11 <= 256 && random11 >= -256 || random12 <= 256 && random12 >= -256){ K = 0; E = 1; bg_music.looping(false); break; } } } */ // ここにゲームの処理を書く { dispPlayPoint(play_point); { float x = -900 / 2; float y = -900 / 2; float width = 30; float height = (play_time * 250) / (60 * 20); drawFillBox(x, y, width, height, Color(1, 1, 0)); drawBox(x, y, width, 250, 2, Color(1, 1, 1)); } play_time -= 1; if (play_time == 0) break; if (play_point > hi_score){ std::ofstream fstr("score.txt"); if (fstr){ fstr << play_point << std::endl; } } } app_env.update(); } app_env.flushInput(); } int M = 1; while (1){ if (!app_env.isOpen()) return 0; app_env.setupDraw(); if (E == 1){ bg_music.stop(); drawTextureBox(-450, -450, 1024, 1024, 0, 0, 900, 900, gover_image, Color(1, 1, 1)); if (M == 1){ gover_music.play(); gover_music.gain(0.5); M = 0; } if (app_env.isPressKey(GLFW_KEY_ENTER)){ gover_music.looping(false); gover_music.stop(); break; } } if (E == 0){ bg_music.stop(); drawTextureBox(-900 / 2, -900 / 2-100, 1024, 1024, 0, 0, 900, 900, lizlt_image, Color(1, 1, 1)); drawTextureBox(-512 / 2, -330, 512, 128, 0, 0, 512, 128, titleback_image, Color(1, 1, 1)); dispPlayPoint(play_point); if (M == 1){ gclear_music.play(); gclear_music.looping(true); gclear_music.gain(0.5); M = 0; } if (app_env.isPressKey(GLFW_KEY_ENTER)){ gclear_music.looping(false); gclear_music.stop(); break; } } app_env.update(); } app_env.flushInput(); } // アプリ終了 }
int main() { AppEnv env(3000, 2048, false, true); //ゲームの素材(主人公) Texture anb_top("res/anb1.png");//正面 Texture anb_side("res/anb2.png");//横 Texture anb_back("res/anb3.png");//後ろ //素材その他 Texture title("res/title_top.png"); Texture title2("res/title2.png"); Texture owari("res/owari.png"); Texture door("res/door.png"); Texture door2("res/door2.png"); Texture titledoorhan("res/titledoorhan.png"); Texture akari("res/akari.png"); Texture hp("res/heart.png"); Texture open("res/open.png"); Texture closed("res/closed.png"); Texture end("res/endcard.png"); //音源 Media nock("res/nock.wav"); Media keyclose("res/keyclose.wav"); //キャラの移動x,y int x = -1500; int y = -1024; // int stage_count = 0; int life = 3; int stage_clear=0; int block_x = 200; int block_y = 200; int akari_count = 0; int atari_count = 0; //stage_clear = 1; //**************************************おおもと************************************** while (true){ env.begin(); //::::::::::::::::::::::タイトル画面:::::::::::::::::::::::: while (env.isOpen()) { env.begin(); drawTextureBox(-1500, -1024, 3000, 2048, 0, 0, 4096, 2048, title); drawTextureBox(-1050, -600, 200, 200, 0, 0, 512, 512, open); drawTextureBox(100, -600, 200, 200, 0, 0, 512, 512, closed); if (!(-330 < x || -830 > x + 300 || -174 < y || -1024 > y + 600)){ drawTextureBox(-828, -1010, 510, 840, 0, 0, 512, 512, titledoorhan); if (env.isPressKey(GLFW_KEY_SPACE)){ x = -40; y = -1024; nock.play(); break; } } //右ドア if (stage_clear == 1){ drawTextureBox(100, -600, 200, 200, 0, 0, 512, 512, open); if (!(835 < x || 325 > x + 300 || -184 < y || -1024 > y + 600)){ drawTextureBox(320, -1010, 510, 840, 0, 0, 512, 512, titledoorhan); if (env.isPressKey(GLFW_KEY_SPACE)){ x = -40; y = -1024; nock.play(); stage_count = 11; break; } } } else { if (env.isPushKey(GLFW_KEY_SPACE)){ if (!(835 < x || 325 > x + 300 || -184 < y || -1024 > y + 600)){ keyclose.play(); } } } if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 300, 600, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); if (x <-1500){ x = -1500; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 300, 600, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); if (x > 1200){ x = 1200; } } else { drawTextureBox(x, y, 300, 600, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } //if(!( □+x<x || □x >x+300 || □+y <y || □y > y+600)) env.end(); } //:::::::::::::::::::::::ゲーム本編::::::::::::::::::::::::::: while (env.isOpen()) { Vec2f pos = env.mousePosition(); env.begin(); //--------------------チュートリアル--------------------- //背景 if (stage_count == 0){ drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1)); //ドア drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ stage_count++; x = -40; y = -1024; nock.play(); } } //drawTextureBox(-40, 30, 80, 160, 0, 0, 256, 512, door2); // キャラの移動&移動制限 if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); if(y< -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } //マップ&当たり判定 //if(!( □+x<x || □x >x+80 || □+y <y || □y > y+160)) drawFillBox(500, -1024, 600, 2048, Color(0, 0, 0, 1)); if (!(1100 < x || 500 > x + 80 || 1024 < y || -1024 > y + 100)){ x = -40; y = -1024; } drawFillBox(-1100, -1024, 600, 2048, Color(0,0,0, 1));//0.02 if (!(-500 < x || -1100 > x + 80 || 1024 < y || -1024 > y + 160)){ x = -40; y = -1024; } drawFillBox(-300, 0, 500, 200, Color(0,0,0,1)); if (!(200 < x || -300 > x + 80 || 200 < y || 0 > y + 160)){ x = -40; y = -1024; } } //----------------------ステージ1-------------------------------------------------------------- if (stage_count == 1){ drawFillBox(-1024, -1024, 2048, 2048, Color(40 / 255, 34 / 255, 42 / 255, 1)); drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ stage_count++; x = -40; y = -1024; nock.play(); } } // キャラの移動&移動制限 if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 0.4)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 0.4)); if (x < -1024.0f){ x = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 0.4)); if (y < -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 0.4)); if (x > 1024.0f){ x = 1024.0f; } } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 0.4)); } //マップ&当たり判定 //if(!( <x || >x+80 || <y ||> y+160)) //if(!(ax2 < bx1 || ax1 > bx2 || ay1< by2 || ay2 >by1)) drawFillBox(500, -1024, 100, 2048, Color(1, 1, 1, 0.02)); if (!(600 < x || 500 > x + 80 || 1024 < y || -1024 > y + 100)){ x = -40; y = -1024; } drawFillBox(-500, -1024, 100, 2048, Color(1, 1, 1, 0.02));//0.02 if (!(-400 < x || -500 > x + 80 || 1024 < y || -1024 > y + 160)){ x = -40; y = -1024; } drawFillBox(-400, 0, 500, 200, Color(1, 1, 1, 0.02)); if (!(100 < x || -400 > x + 80 || 200 < y || 0 > y + 160)){ x = -40; y = -1024; } drawFillBox(0, -500, 500, 200, Color(1, 1, 1, 0.02)); if (!(500 < x || 0 > x + 80 || -300 < y || -500 > y + 160)){ x = -40; y = -1024; } drawFillBox(-150, 500, 400, 200, Color(1, 1, 1, 0.02)); if (!(250 < x || -150 > x + 80 || 700 < y || 500 > y + 160)){ x = -40; y = -1024; } //キャラの明かり drawFillCircle(x + 40, y + 80, 130, 130, 100, Color(1, 1, 1, 0.13)); } //--------------------2ステージ------------------------------------------------------------ if (stage_count == 2){ drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1)); drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ stage_count++; x = -40; y = -1024; nock.play(); } } // キャラの移動&移動制限 if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); if (x < -1024.0f){ x = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); if (y < -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); if (x > 1024.0f){ x = 1024.0f; } } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } //明かり的な? drawFillCircle(x + 40, y + 80, 130, 130, 100, Color(0, 0, 0, 0.1)); //マップ&当たり判定 //if(!( <x || >x+80 || <y ||> y+160)) //if(!(ax2 < bx1 || ax1 > bx2 || ay1< by2 || ay2 >by1)) drawFillBox(500, -1024, 100, 2048, Color(1, 1, 1)); if (!(600 < x || 500 > x + 80 || 1024 < y || -1024 > y + 100)){ x = -40; y = -1024; } drawFillBox(-500, -1024, 100, 2048, Color(1, 1, 1));//0.02 if (!(-400 < x || -500 > x + 80 || 1024 < y || -1024 > y + 160)){ x = -40; y = -1024; } drawFillBox(-400, 0, 500, 200, Color(1, 1, 1)); if (!(100 < x || -400 > x + 80 || 200 < y || 0 > y + 160)){ x = -40; y = -1024; } drawFillBox(0, -500, 500, 200, Color(1, 1, 1)); if (!(500 < x || 0 > x + 80 || -300 < y || -500 > y + 160)){ x = -40; y = -1024; } drawFillBox(-150, 500, 400, 200, Color(1, 1, 1)); if (!(250 < x || -150 > x + 80 || 700 < y || 500 > y + 160)){ x = -40; y = -1024; } } //---------------------ステージ3------------------------------------------------------------------------- if (stage_count == 3){ drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1)); drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ x = -1500; y = -1024; stage_count = 0; stage_clear = 1; nock.play(); break; } } if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); if (x < -1024.0f){ x = -40; y = -1024; } } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); if (y < -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); if (x > 944.0f){ x = -40; y = -1024; } } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } drawFillBox(block_x, block_y, 200, 200, Color::black); if (!(block_x + 200 < x || block_x > x + 80 || block_y + 200 < y || block_y > y + 160)){ x = -40; y = -1024; } if (!(200 < x || 0 > x + 80 || 400 < y || 200 > y + 160)){ block_x = 0; } } //--------------------------------------------すてーじ1-------------------------------------------- if (stage_count == 11){ if (life == 3){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 2){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 1){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); } else { stage_count = 0; life = 3; x = -1500; y = -1024; break; } drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1)); drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ x = -40; y = -1024; stage_count++; nock.play(); } } if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1,1,1, 1)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); if (x < -1024.0f){ x = -40; y = -1024; } } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); if (y < -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); if (x > 944.0f){ x = -40; y = -1024; } } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } drawFillCircle(x + 40, y + 80, 130, 130, 100, Color(0, 0, 0, 0.1)); drawFillBox(100, -1024, 300, 500, Color::white); if (!(400 < x || 100 > x + 80 || -524 < y || -1024 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-1024, -1024, 800, 400, Color::white); if (!(-224 < x || -1024 > x + 80 || -624 < y || -1024 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-600, -224, 1000, 300, Color::white); if (!(400 < x || -600 > x + 80 || -124 < y || -224 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(400, 70, 600, 300, Color::white); if (!(1100 < x || 400 > x + 80 || 370 < y || 70 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-600, 24, 300, 300, Color::white); if (!(-300 < x || -600 > x + 80 || 324 < y || 300 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-600, 524, 300, 200, Color::white); if (!(-300 < x || -600 > x + 80 || 724 < y || 524 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-300, 524, 300, 100, Color::white); if (!(0 < x || -300 > x + 80 || 624 < y || 524 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(0, 350, 400, 276, Color::white); if (!(400 < x || 0 > x + 80 || 626 < y || 350 > y + 160)){ x = -40; y = -1024; life--; } } //-------------------------------------すてーじ2---------------------------------------- if (stage_count == 12){ if (life == 3){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 2){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 1){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); } else { stage_count = 0; life = 3; x = -1500; y = -1024; akari_count = 0; break; } drawFillBox(-1024, -1024, 2048, 2048, Color(0, 0, 0, 1)); drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ x = -40; y = -1024; stage_count++; akari_count = 0; nock.play(); } } if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); if (x < -1024.0f){ x = -40; y = -1024; } } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); if (y < -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); if (x > 944.0f){ x = -40; y = -1024; } } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } drawFillBox(-1024, -1024, 800, 600, Color::black); if (!(-224<x ||-1024 >x + 80 ||-424 <y ||-1024 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(200, -1024, 500, 800, Color::black); if (!(700<x ||200 >x + 80 ||-224 <y || -1024> y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-724, -250, 2000, 300, Color::black); if (!(1276<x || -724 >x + 80 || 50<y || -250> y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-1024, 300, 1748, 200, Color::black); if (!(724<x ||-1024 >x + 80 ||500 <y ||300 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(60, 700, 1000, 424, Color::black); if (!(1060<x ||60 >x + 80 || 1124<y ||700 > y + 160)){ x = -40; y = -1024; life--; } akari_count++; if (akari_count < 90){ drawTextureBox(-50, -350, 64, 64, 0, 0, 64, 64, akari); } if (akari_count > 90 && akari_count < 180){ drawTextureBox(-900, -350, 64, 64, 0, 0, 64, 64, akari); } if (akari_count>180 && akari_count < 270){ drawTextureBox(-900, 150, 64, 64, 0, 0, 64, 64, akari); } if (akari_count>270 && akari_count < 360){ drawTextureBox(850, 150, 64, 64, 0, 0, 64, 64, akari); } if (akari_count>360 && akari_count < 450){ drawTextureBox(850, 550, 64, 64, 0, 0, 64, 64, akari); } if (akari_count>450 && akari_count < 540){ drawTextureBox(-40, 600, 64, 64, 0, 0, 64, 64, akari); } if (akari_count > 630){ akari_count = 0; } } //------------------------------------------すてーじ3---------------------------- if (stage_count == 13){ if (life == 3){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 2){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 1){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); } else { stage_count = 0; life = 3; x = -40; y = -1024; akari_count = 0; break; } atari_count++; drawFillBox(-1024, -1024, 2048, 2048, Color(0, 0, 0, 1)); if (atari_count == 600){ if (!(1024 < x || -1024 > x + 80 || 1024 < y || -1024 > y + 160)){ x = -40; y = -1024; life--; } } if(atari_count > 600){ atari_count = 0; } drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ x = -40; y = -1024; stage_count++; akari_count = 0; nock.play(); } } if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); if (x < -1024.0f){ x = -40; y = -1024; } } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); if (y < -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); if (x > 944.0f){ x = -40; y = -1024; } } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } //----------------------------------------すてーじ14------------------------------- } if (stage_count == 14){ if (life == 3){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1376, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 2){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); drawTextureBox(1218, -1024, 128, 128, 0, 0, 128, 128, hp); } else if (life == 1){ drawTextureBox(1050, -1024, 128, 128, 0, 0, 128, 128, hp); } else { stage_count = 0; life = 3; x = -1500; y = -1024; akari_count = 0; break; } drawFillBox(-1024, -1024, 2048, 2048, Color(1, 1, 1, 1)); drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door); if (!(60 < x || -40 > x + 80 || 1024 < y || 824 > y + 160)){ drawTextureBox(-40, 824, 100, 200, 0, 0, 256, 512, door2); if (env.isPressKey(GLFW_KEY_SPACE)){ x = -40; y = -1024; stage_count++; akari_count = 0; nock.play(); } } drawFillBox(-200, -300, 100, 100, Color::white); if (!(-100<x || -300 >x + 80 || -200 <y || -300 > y + 160)){ x = 100; y = -700; } drawFillBox(100, 0, 100, 100, Color::white); if (!(200<x || 100>x + 80 || 100<y || 0> y + 160)){ x = 300; y = -50; } drawFillBox(-500, -300, 100, 100, Color::white); if (!(-400<x || -500>x + 80 || -400 <y || -300 > y + 160)){ x = 200; y = -100; } drawFillBox(-700, -400, 100, 100, Color::white); if (!(-600<x || -700>x + 80 || -300<y || -400> y + 160)){ x = 700; y = -200; } drawFillBox(-500, -300, 100, 100, Color::white); if (!(-400<x || -500 >x + 80 || -400 <y || -300 > y + 160)){ x = 400; y = 500; } drawFillBox(300, 0, 100, 100, Color::white); if (!(400<x || 300>x + 80 || 100 <y || 0 > y + 160)){ x = -200; y = -900; } drawFillBox(-800, -300, 100, 100, Color::white); if (!(-700<x || -800 >x + 80 || -200 <y || -300> y + 160)){ x = -600; y = 300; } drawFillBox(-300, -400, 100, 100, Color::white); if (!(-200<x || -300 >x + 80 || -300 <y || -400> y + 160)){ x = -500; y = 800; } drawFillBox(300, 300, 100, 100, Color::white); if (!(400<x || 300>x + 80 || 400 <y || 300> y + 160)){ x = 900; y = -300; } drawFillBox(0, 600, 100, 100, Color::white); if (!(100<x || 0>x + 80 || 700 <y || 600> y + 160)){ x = 800; y = 700; } drawFillBox(700, 0, 100, 100, Color::white); if (!(800<x || 700 >x + 80 || 100 <y || 0> y + 160)){ x = -700; y = 800; } drawFillBox(500, -200, 100, 100, Color::white); if (!(600<x || 500 >x + 80 || -100 <y || -200 > y + 160)){ x = -400; y = 400; } drawFillBox(900, -400, 100, 100, Color::white); if (!(1000<x || 900 >x + 80 || 900<y || -400 > y + 160)){ x = -1000; y = 800; } drawFillBox(400, -600, 100, 100, Color::white); if (!(500<x || 400 >x + 80 || -500 <y || -600> y + 160)){ x = -200; y = -800; } drawFillBox(300, -800, 100, 100, Color::white); drawFillBox(500, -900, 100, 100, Color::white); if (!(600<x || 500 >x + 80 || -800 <y || -900> y + 160)){ x = 300; y = -50; } if (env.isPressKey(GLFW_KEY_UP)){ y += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_back, Color(1, 1, 1, 1)); if (y > 864.0f){ y = 864.0f; } } else if (env.isPressKey(GLFW_KEY_LEFT)){ x -= 5; drawTextureBox(x, y, 80, 160, 0, 0, -256, 512, anb_side, Color(1, 1, 1, 1)); if (x < -1024.0f){ x = -40; y = -1024; } } else if (env.isPressKey(GLFW_KEY_DOWN)){ y -= 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); if (y < -1024.0f){ y = -1024.0f; } } else if (env.isPressKey(GLFW_KEY_RIGHT)){ x += 5; drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_side, Color(1, 1, 1, 1)); if (x > 944.0f){ x = -40; y = -1024; } } else { drawTextureBox(x, y, 80, 160, 0, 0, 256, 512, anb_top, Color(1, 1, 1, 1)); } drawFillBox(-400, 400, 200, 824, Color::black); if (!(-200<x ||-400 >x + 80 ||600 <y ||400 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(200, 400, 200, 824, Color::black); if (!(400<x || 200>x + 80 ||1224 <y ||400 > y + 160)){ x = -40; y = -1024; life--; } drawFillBox(-100, 0, 200, 200, Color::black); if (!(100 < x || -100 > x + 80 || 200 < y || 0 > y + 160)) { x = -40; y = -1024; life--; } } //-------------------------------エンド画面------------------------------------------ if (stage_count == 15){ drawTextureBox(-1500, -1024, 3000, 2048, 0, 0, 4096, 2048, end); if (env.isPushButton(Mouse::LEFT)){ x = -1500; y = -1024; break; } } if (env.isPushKey(GLFW_KEY_CAPS_LOCK)){ stage_count++; } env.end(); } //ここまでが本編while if (!env.isOpen()){ return 0; } env.end(); } //*********************************************ここまで************************************** }