-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
course project #28
base: main
Are you sure you want to change the base?
course project #28
Conversation
…collide with other physics objects
…file to their own
… server. session waits 2 connection to start after 3 sec.
battle_tanks/client/battle_tanks.cpp
Outdated
#include "game/game_objects/forest_map_game_object.hpp" | ||
#include "game/game_objects/game_object_frame_restorer_packet.hpp" | ||
|
||
enum class player_game_state : unsigned int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That specifically states about the network state, should be depicted in its name as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
battle_tanks/client/battle_tanks.cpp
Outdated
window->close(); | ||
} | ||
|
||
if (player_state == player_game_state::main_lobby) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's better to move state's handling into its own function/classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
battle_tanks/client/battle_tanks.cpp
Outdated
|
||
void set_text_color(sf::Text& text, const sf::Int32 current_hp) | ||
{ | ||
if (current_hp > 50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to have all settings like this one in one or more dedicated config files for easier track of all constants and fast configuration of the game flow from one place. Possibly moving it all into some sort of db later to configure them outside of the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
namespace bt | ||
{ | ||
typedef std::uint32_t uuid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
7a45b67
to
f9c7a5e
Compare
f9c7a5e
to
b43cbe3
Compare
how to run
controls
game play
shot to your opponent until one's HP less or equal "0", you will take damage from all collisions. so you can ram you enemy if you have more HP, be careful with rock and edges, you will take damage from it either.
network
if you want to play on two PCs. You should rebuild clients and change ip for connection to the server ip where you are going to run it. Same with port, but server can be run with port configuration ./battle_tanks_server.exe -port xxxx
client line to change:
game play
battle tanks game play.webm
PS
unfortunately a lot of hardcode there and not all code refactored and split to the layers and appropriate classes, strong connectivity and communication between some parts of the code and no UI at all. But still it's playable.