rebuild.bat:
@CD common
@CALL _rebuild
@CD ../server
@CALL _rebuild
@cd ../client
@CALL _rebuild
_rebuild.bat:
:lm
@color 07
@mingw32-make rebuild
@IF NOT %ERRORLEVEL%==0 (
@color 0C
@PAUSE
@GOTO lm
)
Tortuga is a 3/4 top down multiplayer RPG set in a large archipelago occupied by warring pirate clans. The emphasis of this game is on multiplayer competition, exploration in an open world, and solo adventuring. The game runs on a Minecraft like server system with a goal of about 50-100 players on a single server. The player characters are tied to the server where they are created, and are susceptible to permadeath: deletion of a character upon death. The servers are designed to allow a large amount of modification by the hosts.
fuckyeah.jpg
#ifndef PLAYER_HPP_
#define PLAYER_HPP_
#include "vector2.hpp"
#include <string>
class Player {
public:
Player() = default;
Player(int playerID, int channel, std::string handle, std::string avatar);
void Update(int delta);
int SetPlayerID(int id) {return playerID = id;}
int GetPlayerID() const {return playerID;}
int SetChannel(int ch) {return channel = ch;}
int GetChannel() const {return channel;}
Vector2 SetPosition(Vector2 v) {return position = v;}
Vector2 ShiftPosition(Vector2 v) {return position += v;}
Vector2 GetPosition() const {return position;}
Vector2 SetMotion(Vector2 v) {return motion = v;}
Vector2 ShiftMotion(Vector2 v) {return motion += v;}
Vector2 GetMotion() const {return motion;}
std::string SetHandle(std::string s) {return handle = s;}
std::string GetHandle() const {return handle;}
std::string SetAvatar(std::string s) {return avatar = s;}
std::string GetAvatar() const {return avatar;}
private:
int playerID = -1;
int channel = -1; //for networking
Vector2 position;
Vector2 motion;
std::string handle;
std::string avatar;
};
#endif
Why does it even look like this? Should I just make this into a public struct with fewer methods? I really don’t think this is necessary. I should actually call this “ClientData”.
Edit: Also, I’m deleting the “PlayerManager” class. Chris was right, I should just use std containers unless there’s a good reason not to.
OK, this really needs addressing. When people reblog and add new comments, this always ends up as a horrible mess of blockqutes:
foo:
bar:
hello
world
Instead, Tumblr needs to add some sort of simple parsing system, so that it results in this:
bar:
hello
foo:
world
Is that too much to ask?
strncpy() is better than strcpy() right?
Info: I can’t send a std::string over the network, so I’m using a char array.
Edit: oh, it doesn’t append a null if the source is longer than the length…
#include <iostream>
using namespace std;
struct Rect {
int l, r;
int t, b;
};
int main() {
Rect r = {0, r.l + 10, 0, r.t + 10};
cout << r.l << endl;
cout << r.r << endl;
cout << r.t << endl;
cout << r.b << endl;
return 0;
}
So apparently you can reference an object during it’s own construction.
Packet is being sent and received, and I’ve got a bare-bones ping-pong working.
Here’s what I believe:
Working hard with very little output is ok at this stage, because I’m laying down a lot more of the foundation that is evident. Eventually, once the foundation is complete, the visible progress will increase exponentially.
I’m holding onto this belief religiously, in the hopes that it’s actually true.
