about summary refs log tree commit diff homepage
path: root/torus.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-04 13:22:21 -0500
committerJune McEnroe <june@causal.agency>2019-01-04 13:22:21 -0500
commit7f49436baea5d29586c7ac10c4586ef59d788e5d (patch)
treebd869e0b981faa3a05f8069fcd8254ec0ead208e /torus.h
parentAdd simplified speed control (diff)
downloadtorus-7f49436baea5d29586c7ac10c4586ef59d788e5d.tar.gz
torus-7f49436baea5d29586c7ac10c4586ef59d788e5d.zip
Add teleportation
"Spawns" in the old code.
Diffstat (limited to 'torus.h')
-rw-r--r--torus.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/torus.h b/torus.h
index a18f515..ba552eb 100644
--- a/torus.h
+++ b/torus.h
@@ -104,6 +104,17 @@ static const size_t TilesSize = sizeof(struct Tile[TileRows][TileCols]);
 static const uint32_t TileInitX = 0;
 static const uint32_t TileInitY = 0;
 
+static const struct {
+	uint32_t tileX;
+	uint32_t tileY;
+} Ports[] = {
+	{ TileInitX, TileInitY },
+	{ TileCols * 3 / 4, TileRows * 3 / 4 }, // NW
+	{ TileCols * 1 / 4, TileRows * 3 / 4 }, // NE
+	{ TileCols * 1 / 4, TileRows * 1 / 4 }, // SE
+	{ TileCols * 3 / 4, TileRows * 1 / 4 }, // SW
+};
+
 enum {
 	MapRows = 11,
 	MapCols = 11,
@@ -152,6 +163,7 @@ struct ClientMessage {
 		ClientFlip,
 		ClientPut,
 		ClientMap,
+		ClientTele,
 	} type;
 	union {
 		struct {
@@ -162,5 +174,6 @@ struct ClientMessage {
 			uint8_t color;
 			uint8_t cell;
 		} put;
+		uint8_t port;
 	};
 };