void Unitselect::JobDraw(){
	drawFillBox((WIDTH / 2 - 250) - 300 * static_cast<int>(Job::WARRIOR), HEIGHT / 4, 100, 200,
				selectjob_color[static_cast<int>(Job::WARRIOR)]);

	drawFillBox((WIDTH / 2 - 250) - 300 * static_cast<int>(Job::LANCER), HEIGHT / 4, 100, 200,
				selectjob_color[static_cast<int>(Job::LANCER)]);
}
void UIManager::DrawOfMenuUI()
{
	drawFillBox(menuUI.Position().x(), menuUI.Position().y(),
		        menuUI.Size().x(), menuUI.Size().y(), Color::black);

	drawTextureBox(menuUI.Position().x(), menuUI.Position().y(),
		           menuUI.Size().x(), menuUI.Size().y(),
		           10, 370, 990, 654, *textureManager.Find("Flame"));

	drawTextureBox(menuUI.Position().x(), menuUI.Position().y(),
		           menuUI.Size().x(), menuUI.Size().y(),
		           0, 0, 512, 256, *textureManager.Find("MenuText"));

	if (isSelectingMenu == true)
	{
		drawFillBox(-WINDOW_WIDTH / 2, -WINDOW_HEIGHT / 2,
			WINDOW_WIDTH, WINDOW_HEIGHT, Color(0, 0, 0, 0.6f));

		drawTextureBox(menuOfBackSelectStageUI.Position().x() + 30, 300,
			           menuOfBackSelectStageUI.Size().x() - 60, menuOfBackSelectStageUI.Size().y(),
			           0, 0, 512, 256, *textureManager.Find("MenuText"));

		drawFillBox(menuOfResetStageUI.Position().x(), menuOfResetStageUI.Position().y(),
			        menuOfResetStageUI.Size().x(), menuOfResetStageUI.Size().y(), Color::black);

		drawTextureBox(menuOfResetStageUI.Position().x(), menuOfResetStageUI.Position().y(),
			           menuOfResetStageUI.Size().x(), menuOfResetStageUI.Size().y(),
			           10, 370, 990, 654, *textureManager.Find("Flame"));

		drawTextureBox(menuOfResetStageUI.Position().x() + 35, menuOfResetStageUI.Position().y() + 20,
			           menuOfResetStageUI.Size().x() - 70, menuOfResetStageUI.Size().y() - 40,
			           0, 0, 512, 256, *textureManager.Find("ResetStageText"));

		drawFillBox(menuOfBackSelectStageUI.Position().x(), menuOfBackSelectStageUI.Position().y(),
			        menuOfBackSelectStageUI.Size().x(), menuOfBackSelectStageUI.Size().y(), Color::black);

		drawTextureBox(menuOfBackSelectStageUI.Position().x(), menuOfBackSelectStageUI.Position().y(),
			           menuOfBackSelectStageUI.Size().x(), menuOfBackSelectStageUI.Size().y(),
			           10, 370, 990, 654, *textureManager.Find("Flame"));

		drawTextureBox(menuOfBackSelectStageUI.Position().x() + 20, menuOfBackSelectStageUI.Position().y(),
			           menuOfBackSelectStageUI.Size().x() - 40, menuOfBackSelectStageUI.Size().y(),
			           0, 0, 512, 256, *textureManager.Find("BackStageSelectText"));


		drawFillBox(menuOfReturnGameUI.Position().x(), menuOfReturnGameUI.Position().y(),
			        menuOfReturnGameUI.Size().x(), menuOfReturnGameUI.Size().y(), Color::black);

		drawTextureBox(menuOfReturnGameUI.Position().x(), menuOfReturnGameUI.Position().y(),
			           menuOfReturnGameUI.Size().x(), menuOfReturnGameUI.Size().y(),
			           10, 370, 990, 654, *textureManager.Find("Flame"));

		drawTextureBox(menuOfReturnGameUI.Position().x() + 24, menuOfReturnGameUI.Position().y() + 10,
			           menuOfReturnGameUI.Size().x() - 48, menuOfReturnGameUI.Size().y() - 20,
			           0, 0, 512, 256, *textureManager.Find("BackGameText"));

	}
}
Beispiel #3
0
	void Draw()
{
	if (enemyflag == 1){
		drawFillBox(enemy_x, enemy_y, size, size, Color(1, 1, 1), 0, Vec2f(1, 1), Vec2f(0, 0));
		drawFillBox(t1, t2, size, size, Color(1, 0, 1), 0, Vec2f(1, 1), Vec2f(0, 0));
		drawFillBox(t3, t4, size, size, Color(1, 1, 0), 0, Vec2f(1, 1), Vec2f(0, 0));
		drawFillBox(t5, t6, size, size, Color(0, 0, 1), 0, Vec2f(1, 1), Vec2f(0, 0));

	}
}
Beispiel #4
0
	void draw()//判定してから書く
	{
		if (judge_num == JUDGE::EXCELENT)
			drawFillBox(-50,-50,100,100,Color::blue);
		if (judge_num == JUDGE::GOOD)
			drawFillBox(-50, -50, 100, 100, Color::red);
		if (judge_num == JUDGE::BAD)
			drawFillBox(-50, -50, 100, 100, Color::yellow);


	}
Beispiel #5
0
void Enemy::DrawHpBar()
{
	if (isActive == true && canMove == true && nowHp > 0 && isHit == true)
	{
		drawFillBox(position.x() - MAP_CHIP_SIZE / 2 + 10, position.y() - MAP_CHIP_SIZE / 2 + 5,
			MAP_CHIP_SIZE - 20, 10, Color::black);

		drawFillBox(position.x() - MAP_CHIP_SIZE / 2 + 10, position.y() - MAP_CHIP_SIZE / 2 + 5,
			(MAP_CHIP_SIZE - 20) * ((float)nowHp / (float)maxHp), 10, Color::green);
	}
}
Beispiel #6
0
void CEnemy2::Draw()
{
	if (Direction == 0)
	{
		drawFillBox(x, y, width, height, color);
	}
	else
	{
		drawFillBox(x, y, width, height, color);
	}
	Attack();

}
void UIManager::DrawOfCastleHP()
{
	if (GameManager::castle.Hp() >= 6)
		colorOfCastleHP = Color::blue;
	else
		colorOfCastleHP = Color::red;

	drawFillBox(GameManager::castle.Position().x() - MAP_CHIP_SIZE / 2 + 8, GameManager::castle.Position().y() - 42 + MAP_CHIP_SIZE,
		64, 16, Color::white);
	drawFillBox(GameManager::castle.Position().x() - MAP_CHIP_SIZE / 2 + 10, GameManager::castle.Position().y() - 40 + MAP_CHIP_SIZE,
		60, 12, Color::gray);
	drawFillBox(GameManager::castle.Position().x() - MAP_CHIP_SIZE / 2 + 10, GameManager::castle.Position().y() - 40 + MAP_CHIP_SIZE,
		60 * ((float)GameManager::castle.Hp() / 20.0f), 12, colorOfCastleHP);
}
Beispiel #8
0
void BoxGuiIn::Draw(const std::string& text, int f_size)
{
	drawFillBox(pos.x(), pos.y(), 
				size.x(), size.y(), 
				color, 
				0, scale, origin);
}
Beispiel #9
0
void Judge::Draw()
{
	if (isNowDrawing == true)
	{   //TODO::試し描画処理
		drawFillBox(0, 0, 100, 100, Color::white);
	}
}
Beispiel #10
0
void Fall_Block::Draw()
{
	drawFillBox(
		fall_block->pos.x(), fall_block->pos.y(),
		fall_block->size.x(), fall_block->size.y(),
		Color::blue);
}
Beispiel #11
0
// 背景の描画
void title::disp_title() {

  // TIPS: 色合いが気に入らないので、最背面に別の色をこっそり描画
  drawFillBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT,
    win::color(paint::White));

  // 海
  drawTextureBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT,
    anime.scroll_ * 2, 0, size::Sea_W, size::Sea_H,
    sea_, win::color(paint::White, 0.5f));

  // 波
  drawTextureBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT,
    anime.scroll_, 0, size::Sea_W, size::Sea_H,
    fog_, win::color(paint::SkyBlue, 0.5f));

  // 大陸
  drawTextureBox(0, 0, size::WIDTH, size::HEIGHT,
    0, 0, size::World_W, size::World_H,
    bg_, win::color(paint::Black),
    0, Vec2f(1.01f, 1.01f), Vec2f(size::Half_W, size::Half_H));
  drawTextureBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT,
    0, 0, size::World_W, size::World_H,
    bg_, win::color(paint::Orange));

  // ロゴ
  drawTextureBox(0, size::LogoPos_Y, size::Logo_W, size::Logo_H,
    0, size::Logo_H * anime.blink_, size::Logo_W, size::Logo_H,
    logo_, win::color(paint::White),
    0, Vec2f(3.f, 3.f), Vec2f(size::Logo_W / 2, 0));
}
Beispiel #12
0
int main() {
  AppEnv env(600, 400);

  Color color(1, 0, 0);
  Font  font("res/nicomoji-plus_v0.9.ttf");

  while (env.isOpen()) {
    env.begin();

    Vec2f pos = env.mousePosition();

    if (env.isPressButton(Mouse::LEFT)) {
      color = Color(1, 1, 1);
    } else {
      color = Color(1, 0, 0);
    }
    drawFillBox(pos.x() - 25, pos.y() - 25,
                50, 50, color);

    font.size(30);
    font.draw("マウス動かしてみて!", Vec2f(-100, -100), Color::white);
    font.draw("クリックしてみて!",   Vec2f(-100, -130), Color::white);

    env.end();
  }
}
Beispiel #13
0
void GuiOut::Draw()
{
	drawFillBox(pos.x(), pos.y(),
				size.x(), size.y(),
				Color::blue);
	//cout << "pos(" << pos.x() << "," << pos.y() << ")" << endl;
	//cout << "size(" << size.x() << "," << size.y() << ")" << endl;
}
void Enemy::display(Player player){
  for (int i = 0; i < monsters.size(); i++){
    if (monsters[i].alive){
      switch (monsters[i].type){
      case 1:
        drawFillBox(EX0 + monsters[i].x - player.cam_x, EY0 + monsters[i].y - player.cam_y, monsters[i].tex_x, monsters[i].tex_y, Color(0, 0.5, 0));
        break;
      case 2:
        drawFillBox(EX0 + monsters[i].x - player.cam_x, EY0 + monsters[i].y - player.cam_y, monsters[i].tex_x, monsters[i].tex_y, color256(153, 76, 0));
        break;
      case 3:
        drawFillBox(EX0 + monsters[i].x - player.cam_x, EY0 + monsters[i].y - player.cam_y, monsters[i].tex_x, monsters[i].tex_y, color256(153, 0, 76));
        break;
      }
    }
  }
}
Beispiel #15
0
void Player::Draw(const Vec2f& camera) {
  ++animeTime;

  // TIPS: カメラと自分の相対座標を求める
  const Vec2f DrawPos = pos - camera;

  //DEBUG
  //drawFillBox(DrawPos.x(), DrawPos.y(), dot_scale.x(), dot_scale.y(), Color::white);

  // 必殺ゲージ
  {
    const float gaugeRatio = countTimer / (60.0f * 5);
    drawFillBox(-eg::Width / 2 + 20, 0, 50, eg::Height / 2 - 20, Color::black);
    drawFillBox(-eg::Width / 2 + 20, 0, 50, (eg::Height / 2 - 20) * gaugeRatio, Color::magenta);
  }

  // HP ゲージ
  {
    const float gaugeRatio = (float)hp / 10.0f;
    const float posY = DrawPos.y() + (isInvincible ? 150 : 100);
    drawFillBox(DrawPos.x() - 50, posY, 100, 20, Color::black);
    drawFillBox(DrawPos.x() - 50, posY, 100 * gaugeRatio, 20, Color::lime);
  }

  if (isInvincible == false) {
    const auto blink = (animeTime / 10) % 2;

    drawTextureBox(DrawPos.x(), DrawPos.y(), dot_scale.x(), dot_scale.y(),
                   blink * texSize.x(), 0, texSize.x(), texSize.y(),
                   dot, Color::white,
                   0.0f, Vec2f::Ones(), Vec2f(dot_scale.x() * 0.5f, 0));
  }
  else {
    const auto blink = (animeTime / 5) % 3;

    drawTextureBox(DrawPos.x(), DrawPos.y(), real_scale.x(), real_scale.y(),
                   blink * texSize.x(), 0, texSize.x(), texSize.y(),
                   real, Color::white,
                   0.0f, Vec2f::Ones(), Vec2f(real_scale.x() * 0.5f, 0));
  }
}
// 描画
void CSceneManager::Draw(){
	// 描画準備
	m_app_env->setupDraw();
	
	if (m_state == State::UPDATE){
		m_scene->Draw();
	}

	drawFillBox(-m_scene->WIDTH / 2, -m_scene->HEIGHT / 2, m_scene->WIDTH, m_scene->HEIGHT, color256(0, 0, 0, m_alpha));
	// 画面更新
	m_app_env->update();
}
Beispiel #17
0
void Cjudge::Draw()  //判定してから書く
{
    if (is_draw_active == true && draw_time < draw_flame_count)
	{
		++draw_time;
		if (judge_num == JUDGEMENT_TYPE::EXCELENT)
			drawFillBox(draw_pos.x(), draw_pos.y(), draw_size.x(), draw_size.y(), Color::blue);
		if (judge_num == JUDGEMENT_TYPE::GOOD)
			drawFillBox(draw_pos.x(), draw_pos.y(), draw_size.x(), draw_size.y(), Color::red);
		if (judge_num == JUDGEMENT_TYPE::BAD)
			drawFillBox(draw_pos.x(), draw_pos.y(), draw_size.x(), draw_size.y(), Color::yellow);
	}
	if (draw_time >= draw_flame_count)
	{
		is_draw_active = false;
		is_combo = false;
		is_plus_score = false;
		

	}
}
Beispiel #18
0
// メインプログラム
// 
int main() {
	// アプリウインドウの準備
	AppEnv app_env(Window::WIDTH, Window::HEIGHT,
		false, true);

	Texture block1("res/block1.png");
	//Texture bg1("res/");

	int map_x = 0;
	int map_y = 0;
	int count = 0;

	Vec2f map_num[MAP_Y*MAP_X];

	for (map_y = MAP_Y - 1; map_y > -1 ;map_y--){
		for (map_x = 0; map_x < MAP_X; map_x++)
		{
			map_num[count] = Vec2f(Pos_x(size * (map_x)), Pos_y(size * map_y));
			count++;
		}
	}


	while (1)
	{
		if (!app_env.isOpen())return(0);
		app_env.setupDraw();

		Vec2f  mousepos = app_env.mousePosition();
		

			for (map_y = 0; map_y < MAP_Y; map_y++){
				for (map_x = 0; map_x < MAP_X; map_x++)
				{
					Draw2(map_num[(map_y*14)+map_x].x(), map_num[map_y*MAP_X+map_x].y());
				}
			}

		//EnemyMove();

		EnemyMove(map_num);

		Draw();



		drawFillBox(mousepos.x(), mousepos.y(), 20, 20, Color(1, 1, 1),0,Vec2f(1,1),Vec2f(10,10));

		app_env.update();
	}

	// アプリ終了
}
Beispiel #19
0
int main() {
  AppEnv env(600, 400);

  Vec2f player_pos   = Vec2f::Zero();
  Vec2f player_size  = Vec2f(50, 50);
  Color player_color = Color::white;

  Vec2f enemy_pos   = Vec2f(100, 0);
  Vec2f enemy_size  = Vec2f(50, 50);
  Color enemy_color = Color::red;

  while (env.isOpen()) {
    env.begin();

    player_pos = env.mousePosition();

    player_color = Color::white;
    if (player_pos.x() + player_size.x() > enemy_pos.x()) {
      if (player_pos.x() < enemy_pos.x() + enemy_size.x()) {
        if (player_pos.y() + player_size.y() > enemy_pos.y()) {
          if (player_pos.y() < enemy_pos.y() + enemy_size.y()) {
            player_color = Color::red;
          }
        }
      }
    }

    // enemy
    drawFillBox(enemy_pos.x(), enemy_pos.y(),
                enemy_size.x(), enemy_size.y(),
                enemy_color);

    // player
    drawFillBox(player_pos.x(), player_pos.y(),
                player_size.x(), player_size.y(),
                player_color);

    env.end();
  }
}
Beispiel #20
0
void UIManager::DrawOfChangeUpdateSpeedUI()
{
	drawFillBox(changeUpdateSpeedUI.Position().x(), changeUpdateSpeedUI.Position().y(),
		        changeUpdateSpeedUI.Size().x(), changeUpdateSpeedUI.Size().y(), Color::black);
	drawTextureBox(changeUpdateSpeedUI.Position().x(), changeUpdateSpeedUI.Position().y(),
		           changeUpdateSpeedUI.Size().x(), changeUpdateSpeedUI.Size().y(),
		           10, 370, 990, 654,
		           *textureManager.Find("Flame"));

	if (isChangeUpdateSpeed == false)
		font.draw("× 1", Vec2f(changeUpdateSpeedUI.Position().x() + 40, changeUpdateSpeedUI.Position().y() + 18), Color::white);
	else if (isChangeUpdateSpeed == true)
		font.draw("× 2", Vec2f(changeUpdateSpeedUI.Position().x() + 40, changeUpdateSpeedUI.Position().y() + 18), Color::white);
}
Beispiel #21
0
void UIManager::DrawOfPauseBar()
{
	drawFillBox(pausingUI.Position().x(), pausingUI.Position().y(),
		        pausingUI.Size().x(), pausingUI.Size().y(), Color::black);
	drawTextureBox(pausingUI.Position().x(), pausingUI.Position().y(),
		           pausingUI.Size().x(), pausingUI.Size().y(),
		           10, 370, 990, 654, *textureManager.Find("Flame"));
	if (isPausing == true)
		drawTextureBox(pausingUI.Position().x() + 64, pausingUI.Position().y() + 14,
			           50, 50, 0, 0, 512, 512, *textureManager.Find("PlayButton"));
	else if (isPausing == false)
		drawTextureBox(pausingUI.Position().x() + 64, pausingUI.Position().y() + 14,
			           50, 50, 0, 0, 512, 512, *textureManager.Find("StopButton"));
}
Beispiel #22
0
void Ui::Draw(Status status){
	drawFillBox(command_board.pos.x(), command_board.pos.y(),
		command_board.size.x(), command_board.size.y(),
		Color::red);
	drawTextureBox(command_board.pos.x(), command_board.pos.y() - 400, command_board.size.x(), command_board.size.y() + 800, 0, 0, 256, 256, tx2, Color::white);
	drawTextureBox(command.pos.x()+animation, command.pos.y(), command.size.x(), command.size.y(), 0, 0, 256, 256, tx, Color::blue);
	///drawTextureBox(command_board.pos.x() , command_board.pos.y()-400, command_board.size.x(), command_board.size.y()+800, 0, 0, 256, 256, tx2, Color::white);
	drawFillBox(status_board.pos.x(), status_board.pos.y(),
		status_board.size.x(), status_board.size.y(),
		Color::blue);
	/*drawFillBox(command.pos.x() + animation, command.pos.y(),
		command.size.x(), command.size.y(),
		Color::white);*/
	font.draw("ActiveNo." + std::to_string(number),
		Vec2f(-WIDTH / 3, -250 - font_size), Color::white);
	font.draw("体力    " + std::to_string(status.hp),
		Vec2f(-WIDTH / 3, -350 - font_size), Color::white);

	font.draw("攻撃力   " + std::to_string(status.power),
		Vec2f(-WIDTH / 20, -250 - font_size * 2), Color::white);

	font.draw("魔法攻撃力 " + std::to_string(status.magic_power),
		Vec2f(-WIDTH / 20, -300 - font_size * 3), Color::white);

	font.draw("防御力   " + std::to_string(status.defense),
		Vec2f(350, -150 - font_size * 4), Color::white);

	font.draw("魔法防御力 " + std::to_string(status.magic_defense),
		Vec2f(350, -200 - font_size * 5), Color::white);

	font.draw("移動", Vec2f(-830, 445), Color::white);
	font.draw("攻撃", Vec2f(-830, 445 - 150), Color::white);
	font.draw("スキル", Vec2f(-830, 445 - 300), Color::white);
	font.draw("STATUS", Vec2f(-830, 445 - 450), Color::white);
	font.draw("行動P" + std::to_string((int)cost), Vec2f(-830, 445 - 600), Color::white);
}
Beispiel #23
0
void CEnemy2::Attack()
{
	if (app_env->isPressKey(GLFW_KEY_UP))
	{
		shotflag = 1;
	}

	if (shotflag == 1){
		if (x > GM->Player->x){
			Direction = 1;   //shot_x -= 5;
		}
		else
		{
			Direction = 2;	//shot_x += 5;
		}

	}
	if (Direction == 1)
		shot_x -= 5;

	if (Direction == 2)
		shot_x += 5;

	if (shotflag == 1)
		drawFillBox(shot_x, shot_y, shotwidth, shotheight, Color(1, 0, 0, 1));

	if (shot_x < -Window::WIDTH / 2 || shot_x > Window::WIDTH / 2){
		shotflag = 0;
		shot_x = x;
		shot_y = y + height / 2;
	}

	for (auto &i : GM->enemy)
	{
		if (Collision::IsHit(shot_x, shot_y, shotwidth, shotheight, i->x, i->y, i->width, i->height))
		{
			color = Color(0, 0, 1, 1);
			shotflag = 0;
			shot_x = x;
			shot_y = y + height / 2;
		}
		else
		{
			color = Color(0, 0, 1, 1);
		}
	}

}
Beispiel #24
0
void CBlade::Draw()
{
	/*
	static int hoge = 90;
	if (GM->Player->Speed > 0)	hoge -= 15;
	if (GM->Player->Speed < 0)	hoge += 15;
	
	drawFillBox(x, y, width, height, color, 3.14 / 180 * hoge, Vec2f(1, 1), Vec2f(0, 0));

	if (hoge < -90)
	{
		hoge = 90;
	}
	*/
	drawFillBox(x, y, width, height, color);
}
Beispiel #25
0
void Map::draw(){

    for (int y = 0; y < static_cast<int>(map_chip.size()); y++)
    {
        for (int x = 0; x < static_cast<int>(map_chip[y].size()); x++)
        {
            map_chip[y][x]->draw();

        }
    }
#ifdef DEBUG
    drawBox(p.po.x(), p.po.y(), p.si.x(), p.si.y(), 10, Color::green);
#endif
    drawFillBox(goal_pos.x(), goal_pos.y(), goal_size.x(), goal_size.y(), Color::yellow);

}
Beispiel #26
0
void UIManager::DrawOfChangedPanel()
{
	for (int i = 0; i < 10; ++i)
	{
		for (int j = 0; j < 10; ++j)
		{
			if (isChangedPanel[i][j] == true && isStartedChangePanelToMaxNum == true)
				drawTextureBox(panelPos[i][j].x(), panelPos[i][j].y(),
					           128, 100, panelCutPos[i][j].x(), panelCutPos[i][j].y(),
					           102.4f, 51.2f, panelView);

			else if (isChangedPanel[i][j] == true && isStartedChangePanelToMinNum == true)
				drawFillBox(panelPos[i][j].x(), panelPos[i][j].y(),
					        128, 100, Color::black);
		}
	}
}
Beispiel #27
0
void UIManager::DrawOfWaveBar()
{
	//WAVE UI
	if (GameManager::stageWaveManager.IsChangeWave() == true)
	{
		drawFillBox(waveBarPos.x(), waveBarPos.y(), 300, 150, Color::black);
		drawTextureBox(waveBarPos.x(), waveBarPos.y(), 300, 150,
			           10, 370, 990, 654,
			           *textureManager.Find("Flame"));
		font.size(60);
		font.draw("Wave" + std::to_string(GameManager::stageWaveManager.NowWaveNum()), Vec2f(waveBarPos.x() + 50, waveBarPos.y() + 40), Color::white);
	}

	font.size(40);
	font.draw("Wave", Vec2f(170, 440), Color::black);
	font.draw(std::to_string(GameManager::stageWaveManager.NowWaveNum()), Vec2f(310, 440), Color::black);
	font.draw(" / ", Vec2f(350, 440), Color::black);
	font.draw(std::to_string(GameManager::stageWaveManager.MaxWaveNum()), Vec2f(400, 440), Color::black);
}
Beispiel #28
0
void Result::Draw(){
    if (iswin)
    {

        //drawFillBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, Color::red);
        drawTextureBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, 0, 0, 1024, 1024, win_texture);
        if (!winse.isPlaying()){
            winse.play();
        }
    }
    else
    {
        drawFillBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, Color::green);
        drawTextureBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, 0, 0, 1024, 1024, lose_texture);

        if (!loosse.isPlaying()){
            loosse.play();
        }
    }
}
Beispiel #29
0
int main() {
  AppEnv env(600, 400);

  Vec2f pos   = Vec2f::Zero();
  Vec2f size  = Vec2f(50, 50);
  float speed = 4;

  while (env.isOpen()) {
    env.begin();

    if (env.isPressKey('D')) { pos.x() += speed; } // 右に移動
    if (env.isPressKey('A')) { pos.x() -= speed; } // 左に移動
    if (env.isPressKey('W')) { pos.y() += speed; } // 上に移動
    if (env.isPressKey('S')) { pos.y() -= speed; } // 下に移動

    drawFillBox(pos.x(),  pos.y(),
                size.x(), size.y(),
                Color::white);

    env.end();
  }
}
Beispiel #30
0
void Astar::parentDraw(Vec2i goal_pos){

	if (goal_pos == enemy_pos){
		drawFillBox(goal_pos.x() * 50, goal_pos.y() * 50, 50, 50, Color::blue);
		return;
	}

	switch (mapchip.map[goal_pos.y()][goal_pos.x()].parent)
	{
	case UP:
		parentDraw(Vec2i(goal_pos.x(), goal_pos.y() + 1));
		break;
	case DOWN:
		parentDraw(Vec2i(goal_pos.x(), goal_pos.y() - 1));
		break;
	case LEFT:
		parentDraw(Vec2i(goal_pos.x() - 1, goal_pos.y()));
		break;
	case RIGHT:
		parentDraw(Vec2i(goal_pos.x() + 1, goal_pos.y()));
		break;
	}
}