diff options
author | June McEnroe <programble@gmail.com> | 2017-08-29 18:33:59 -0400 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2017-08-29 18:33:59 -0400 |
commit | 931289b9c11fbf1ba61442f83b3199e44bebaaf2 (patch) | |
tree | 277a960369d79e64a0b783b22b52c51220d2587a /client.c | |
parent | Add respawning (diff) | |
download | torus-931289b9c11fbf1ba61442f83b3199e44bebaaf2.tar.gz torus-931289b9c11fbf1ba61442f83b3199e44bebaaf2.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 5e70b17..810369d 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; |