comments.appendChild(dd);
}
+ // When we enter the endgame, we disable the art-generation form,
+ // (just hide it)
+ socket.on('endgame', () => {
+ zombo_form.style.display = "none";
+ });
+
socket.on('comment', function(comment) {
const comments = document.querySelector("#comments_" + comment.image_id);
add_comment(comments, comment);
socket.emit('inform-name', socket.request.session.name);
}
+ // And if we're in the endgame, let them know that
+ if (state.endgame) {
+ socket.emit('endgame');
+ }
+
// Replay old comments and images to a newly-joining client
socket.emit('reset');
state.images.forEach((image) => {
});
function endgame() {
+ state.endgame = true;
+
+ // Tell all clients we are in the endgame, (which will disable
+ // any additional image generation, both showing that Coda is
+ // correc that Zombo.com has been rendered inert, and also
+ // making clear to the boys that they have everything they
+ // need).
+ io.emit('endgame');
+
// Before revealing Coda's final image, have her comment on
// each of the weaknesses, in order to bring them to the top
// of the feed.