about summary refs log tree commit diff homepage
path: root/client.c
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
commita2b5beb434b38aa8d0856166950053f8cf456f42 (patch)
tree546e8c17934ca27ad452183a215a4e8e39257da0 /client.c
parentAdd simplified speed control (diff)
downloadtorus-a2b5beb434b38aa8d0856166950053f8cf456f42.tar.gz
torus-a2b5beb434b38aa8d0856166950053f8cf456f42.zip
Add teleportation
"Spawns" in the old code.
Diffstat (limited to 'client.c')
-rw-r--r--client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/client.c b/client.c
index 9aa052a..867b4de 100644
--- a/client.c
+++ b/client.c
@@ -271,6 +271,11 @@ static void clientMap(void) {
 	clientMessage(msg);
 }
 
+static void clientTele(uint8_t port) {
+	struct ClientMessage msg = { .type = ClientTele, .port = port };
+	clientMessage(msg);
+}
+
 static struct {
 	enum {
 		ModeNormal,
@@ -402,6 +407,8 @@ static void inputNormal(bool keyCode, wchar_t ch) {
 		break; case Esc: modeNormal(); input.shift = 0;
 		break; case 'q': endwin(); exit(EX_OK);
 
+		break; case 'Q': clientTele(input.color % ARRAY_LEN(Ports));
+
 		break; case '\\': input.delta = (input.delta == 1 ? 4 : 1);
 
 		break; case 'h': clientMove(-input.delta,  0);