Fixed client movement.
This commit is contained in:
@@ -27,7 +27,7 @@ public:
|
||||
void Close();
|
||||
private:
|
||||
void ReadFromServer();
|
||||
void SendToServer();
|
||||
void SendSnapshotToServer();
|
||||
|
||||
int Receive(char* data, size_t length);
|
||||
int CreateMessage(MessageType type, std::string message, char* data);
|
||||
@@ -60,6 +60,7 @@ private:
|
||||
// Use to check if we should send disconnect message
|
||||
// if game is turned of by closing window.
|
||||
bool m_WasStarted = false;
|
||||
IsWASDKeyDown m_IsWASDKeyDown;
|
||||
|
||||
// Events
|
||||
EventBroker* m_EventBroker;
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
#define BOARDSIZE 16
|
||||
#define MAXCONNECTIONS 8
|
||||
#define INPUTSIZE 128
|
||||
#define PLAYERSPEED 0.2f;
|
||||
|
||||
typedef boost::shared_ptr<boost::asio::ip::udp::socket> socket_ptr;
|
||||
typedef boost::shared_ptr<std::string> string_ptr;
|
||||
typedef boost::shared_ptr<std::queue<string_ptr>> messageQueue_ptr;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -4,9 +4,17 @@
|
||||
struct SnapshotDefinitions
|
||||
{
|
||||
// "+Forward" is 8 characters * sizeof(char) = 8
|
||||
char* inputForward = new char[8];
|
||||
char* InputForward = new char[8];
|
||||
// "+Right" is 6 characters * sizeof(char) = 6
|
||||
char* inputRight = new char[6];
|
||||
char* InputRight = new char[6];
|
||||
};
|
||||
|
||||
struct IsWASDKeyDown
|
||||
{
|
||||
bool W = false;
|
||||
bool A = false;
|
||||
bool S = false;
|
||||
bool D = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user