apetavern / grubs

A worms-inspired artillery game for s&box with randomly generated levels.
MIT License
34 stars 7 forks source link

Don't allow duplicate colors. #271

Closed dch-GH closed 1 year ago

dch-GH commented 1 year ago

This PR makes player colors unique per player, making them more distinct. Also adds color indicators to the player list in the main menu. image Also fixes an issue where only the local player time played was being shown as each player in the list's time played.

https://github.com/apetavern/sbox-grubs/assets/66768086/f950096d-41a9-45b9-a343-b644a0c51871

If a player tries to click a color that is taken, its button is darkened and does nothing. If the player doesn't select a color, they get assigned a random unused color. If all colors are taken (at a large player count) a random untaken color is assigned, if failing resulting in color overlap (again, only at really large player counts for this type of game).

https://github.com/apetavern/sbox-grubs/assets/66768086/b7683d20-fc70-4952-b10f-33959cfd3d8e

matekdev commented 1 year ago

ready to go