Skip to content

Commit 4860429

Browse files
committed
Increasing duration of battle
1 parent 2911ff9 commit 4860429

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Nessa grande exploração espacial e procura de novos mundos, esses dois encontr
9797

9898
### 2.3. Gameplay
9999

100+
O gameplay deste jogo pode ser acessado por este [link](https://youtu.be/oDbqc0H2Fv4).
100101

101102
## 3. Jogabilidade
102103

-16.8 KB
Binary file not shown.

src/BattleEnd.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ BattleEnd::BattleEnd(int id_winner){
1515

1616
sprite = vector<Sprite>(N_SPRITES + 2);
1717

18-
string path = "victory/" + to_string(id_winner) + "/";
18+
string path = "victory/" + to_string(id_winner) + "/";
1919

2020
for(int i = 1; i <= N_SPRITES; i++){
2121
sprite[i] = Sprite(path + to_string(i) + ".png", 1, 5);
@@ -31,14 +31,16 @@ void BattleEnd::update(float delta){
3131

3232
if(sprite[current_sprite].is_finished()){
3333
if(back_selected && current_sprite > 1)
34-
current_sprite--;
34+
current_sprite--;
3535
else if(not back_selected && current_sprite < N_SPRITES)
3636
current_sprite++;
3737
}
3838

3939
InputManager * input_manager = InputManager::get_instance();
4040

41-
if(input_manager->joystick_button_press(InputManager::SELECT, 0)){
41+
if(input_manager->joystick_button_press(InputManager::SELECT, 0) ||
42+
input_manager->joystick_button_press(InputManager::B, 0)
43+
){
4244
for(int i = 1; i <= N_SPRITES; i++)
4345
sprite[i].restart_count();
4446

src/BattleState.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ void BattleState::update(float delta){
8585
}
8686

8787
if(input_manager->joystick_button_press(InputManager::SELECT, 0)){
88+
music.stop();
8889
Game::get_instance().push(new MenuState(true));
8990
m_quit_requested = true;
9091
return;

src/TimeCounter.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using std::to_string;
55
TimeCounter::TimeCounter(){
66
remaining_seconds = total_time;
77

8-
text = new Text("font/8-BIT WONDER.ttf", 50, Text::TextStyle::SOLID, "99",
8+
text = new Text("font/8-BIT WONDER.ttf", 50, Text::TextStyle::SOLID, "99",
99
{255, 255, 255, 255});
1010

1111
bg = Sprite("hud/time_board.png");
@@ -21,15 +21,15 @@ TimeCounter::~TimeCounter(){
2121
void TimeCounter::update(float delta){
2222
text->set_pos(640, 664, true, true);
2323
timer.update(delta);
24-
remaining_seconds -= delta * 0.01;
24+
remaining_seconds -= delta * 0.01 / 3;
2525
//FIXME
2626
if(remaining_seconds < 0)
2727
remaining_seconds = 0;
2828
text->set_text(get_time_string());
2929
}
3030

3131
void TimeCounter::render(){
32-
bg.render(box.get_draw_x(), box.get_draw_y());
32+
bg.render(box.get_draw_x(), box.get_draw_y());
3333
text->render();
3434
}
3535

0 commit comments

Comments
 (0)