-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Structural logic
To be later defined more accurately
class Ship
{
int id;
int health;
Vector3 position;
Quaternion rotation;
Vector3 velocity;
Vector3 forceVector;
}
Network logic
enum GamePacketType {Connect, Disconnect, Ship, Asteroid}
struct GamePacket
{
GamePacketType type;
Stream dataStream;
}
enum EntityEventType {Spawn, State, Remove}
GamePacketType Ship
{
int id;
EntityEventType type;
switch(type)
{
case EntityEventType.State:
ships[id].health;
ships[id].position;
ships[id].rotation;
ships[id].velocity;
ships[id].forceVector;
break;
case EntityEventType.Spawn:
ships[id] = new Ship();
ships[id].position;
ships[id].rotation;
break;
case EntityEventType.Remove:
destroy ships[id];
break;
}
}
GamePacketType Asteroid
{
}
Reactions are currently unavailable