File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,7 @@ void print_splash_screen(const std::filesystem::path& assets_dir)
41
41
42
42
std::cout << ' \n ' << std::setfill (' ' ) << std::setw (19 );
43
43
44
- for (const char & c : " copyright (c) 2021 cpp-gamedev" )
45
- {
46
- std::cout << c;
47
- utils::sleep (std::chrono::milliseconds{50 });
48
- }
44
+ utils::slow_print (" copyright (c) 2021 cpp-gamedev" , std::chrono::milliseconds{50 });
49
45
}
50
46
51
47
void print_move_table (const models::Pokemon& pkmn)
Original file line number Diff line number Diff line change 1
1
#pragma once
2
2
3
3
#include < array>
4
- #include < string>
5
- #include < vector>
4
+ #include < string>
5
+ #include < vector>
6
6
7
7
#include " models.hpp"
8
8
Original file line number Diff line number Diff line change 2
2
#include " models.hpp"
3
3
#include " utils.hpp"
4
4
5
+ using namespace std ::chrono_literals;
6
+
5
7
using namespace anim ;
6
8
using namespace models ;
7
9
using namespace utils ;
8
10
9
11
int main ()
10
12
{
11
- constexpr std::chrono::milliseconds delay{1000 };
12
13
const auto assets_dir = find_upwards (" assets" );
13
14
Manifest manifest = check_manifest (assets_dir.parent_path () / " manifest.json" );
14
15
@@ -27,15 +28,14 @@ int main()
27
28
28
29
if (ai.hp > 0 )
29
30
{
30
- sleep (delay );
31
+ sleep (1000ms );
31
32
ai.make_move (player, random_range<std::size_t >(1 , 4 ));
32
33
clear_screen ();
33
34
}
34
-
35
35
}
36
36
37
37
clear_screen ();
38
- slow_print ((ai.hp == 0 ) ? " You Won :)" : " You Lost :(" , delay / 20 );
38
+ slow_print ((ai.hp == 0 ) ? " You Won :)" : " You Lost :(" , 50ms );
39
39
40
40
return EXIT_SUCCESS;
41
41
}
You can’t perform that action at this time.
0 commit comments