diff options
author | June McEnroe <june@causal.agency> | 2017-08-29 18:33:59 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2017-08-29 18:33:59 -0400 |
commit | af645c09089d1ed8e99c760f05234ac3df402901 (patch) | |
tree | 34d0e446f96cd3c9944b651ad98cf07dfe7a3df7 /client.c | |
parent | Add respawning (diff) | |
download | torus-af645c09089d1ed8e99c760f05234ac3df402901.tar.gz torus-af645c09089d1ed8e99c760f05234ac3df402901.zip |
Add four additional spawns
Diffstat (limited to '')
-rw-r--r-- | client.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client.c b/client.c index f477602..5a41dbc 100644 --- a/client.c +++ b/client.c @@ -65,8 +65,11 @@ static void clientPut(uint8_t color, char cell) { clientMessage(&msg); } -static void clientSpawn(void) { - struct ClientMessage msg = { .type = CLIENT_SPAWN }; +static void clientSpawn(uint8_t spawn) { + struct ClientMessage msg = { + .type = CLIENT_SPAWN, + .data.s.spawn = spawn, + }; clientMessage(&msg); } @@ -185,7 +188,7 @@ static void readInput(void) { case ESC: mode = MODE_NORMAL; break; case 'q': endwin(); exit(EX_OK); - case 'Q': clientSpawn(); break; + case 'Q': clientSpawn(inputColor < SPAWN_COUNT ? inputColor : 0); break; case 'a': clientMove(1, 0); // fallthrough case 'i': insertMode(1, 0); break; |