- Click on each pair of answers that should be scored as equivalent,
- (and click any word twice to split it out from a group). Remember,
+ Click/tap on each pair of answers that should be scored as equivalent,
+ (or click a word twice to split it out from a group). Remember,
what goes around comes around, so it's best to be generous when
judging.
+
+ Also, for an especially fun or witty answer, you can give kudos
+ by clicking the star on the right. You may only do this for one
+ word/group.
+
);
})}
@@ -771,6 +876,32 @@ class ActivePrompt extends React.PureComponent {
);
}
+ let move_on_button = null;
+ if (this.props.idle) {
+ move_on_button =(
+
+ );
+ }
+
if (this.props.players_answered.has(this.props.player.name)) {
return (
@@ -877,9 +1008,16 @@ class Game extends React.PureComponent {
});
}
- remove_player(info) {
+ disable_player(info) {
+ const idx = this.state.other_players.findIndex(o => o.id === info.id);
+ if (idx < 0)
+ return;
+
+ const other_players_copy = [...this.state.other_players];
+ other_players_copy[idx].active = false;
+
this.setState({
- other_players: this.state.other_players.filter(o => o.id !== info.id)
+ other_players: other_players_copy
});
}
@@ -954,12 +1092,29 @@ class Game extends React.PureComponent {
}
set_player_answering(player) {
+ /* Set the player as actively answering now. */
this.setState({
players_answering: {
...this.state.players_answering,
[player]: {active: true}
}
});
+ /* And arrange to have them marked idle very shortly.
+ *
+ * Note: This timeout is intentionally very, very short. We only
+ * need it long enough that the browser has latched onto the state
+ * change to "active" above. We actually use a CSS transition
+ * delay to control the user-perceptible length of time after
+ * which an active player appears inactive.
+ */
+ setTimeout(() => {
+ this.setState({
+ players_answering: {
+ ...this.state.players_answering,
+ [player]: {active: false}
+ }
+ });
+ }, 100);
}
set_answering_idle(value) {
@@ -1019,12 +1174,30 @@ class Game extends React.PureComponent {
}
set_player_judging(player) {
+ /* Set the player as actively judging now. */
this.setState({
players_judging: {
...this.state.players_judging,
[player]: {active: true}
}
});
+ /* And arrange to have them marked idle very shortly.
+ *
+ * Note: This timeout is intentionally very, very short. We only
+ * need it long enough that the browser has latched onto the state
+ * change to "active" above. We actually use a CSS transition
+ * delay to control the user-perceptible length of time after
+ * which an active player appears inactive.
+ */
+ setTimeout(() => {
+ this.setState({
+ players_judging: {
+ ...this.state.players_judging,
+ [player]: {active: false}
+ }
+ });
+ }, 100);
+
}
set_judging_idle(value) {
@@ -1083,18 +1256,43 @@ class Game extends React.PureComponent {
render() {
const state = this.state;
- const players_total = 1 + state.other_players.length;
if (state.scores) {
+
+ const players_total = state.players_answered.size;
+
+ let perfect_score = 0;
+ for (let i = 0;
+ i < state.active_prompt.items &&
+ i < state.scores.words.length;
+ i++)
+ {
+ perfect_score += state.scores.words[i].players.length;
+ }
+
return (