Problem with last step

136 views
Skip to first unread message

Don Morrison

unread,
Aug 14, 2023, 9:39:12 PM8/14/23
to nodeGame

I’m sure I’m just doing something silly and will smack my head when I get it figured out, but I’m stumped, and hope maybe you can point me in a productive direction.

I have a two player game (just playing rock, paper, scissors) which mostly seems to be working as I’d like. At the very end, though, it’s supposed to display a page giving the player’s final score, with a “next” button, which is supposed to then redirect elsewhere (into Qualtrics). But when I get to that page it just briefly flashes the page without waiting for the user to read it or press the button, and then appears, like Wagner’s ring cycle, to go right back to the beginning, thus,

Screenshot from 2023-08-14 21-35-18.png

I’ve instrumented the relevant function in logic.js and nothing in there seems to be being called. I’ve tried doing the same in player.js, but when it does its go back to the beginning thing the console in the browser gets overwritten so I’ve no idea what’s being spewed there.

Any thought on what causes something like this, and where I should look for my stupidity?

Thanks!



Don Morrison df...@cmu.edu
“Mathematicians are machines for turning coffee into theorems.”
– Alfréd Rényi

Don Morrison

unread,
Aug 14, 2023, 9:56:18 PM8/14/23
to nodeGame

On Mon, Aug 14, 2023 at 9:38 PM Don Morrison df...@cmu.edu wrote:

At the very end, though, it’s supposed to display a page giving the
player’s final score, with a “next” button, which is supposed to
then redirect elsewhere (into Qualtrics). But when I get to that
page it just briefly flashes the page without waiting for the user
to read it or press the button, and then appears, like Wagner’s
ring cycle, to go right back to the beginning, thus,

Oh, maybe it’s supposed to do that?

So, my normal development cycle is to open a couple of browser panes, and on each iteration after nodemon restarts the game I refresh the panes, which seems to work fine. Except I now see that it is only in this case that I get that flash of death as Valhalla burns and I go back to the beginning; if instead I type in fresh URLs way back when I start, then when I get to the end I am allowed to see my end screen!

So I guess I don’t really have anything to fix, I just have to recognize that my development cycle ritual is not suitable for testing the end game. I do wonder why not though. I’m guessing you can probably tell me!

Thanks, and sorry to have bothered you.



Don Morrison df...@cmu.edu
“‘To say that Benedict Farley makes pies is like saying that Wagner
wrote semiquavers.’ ‘Oh, they’re good pies, are they?’ ‘No, horrible.
But there are a great many of them.’”
– Clive Exton, after Agatha Christie, The Dream

Stefano B

unread,
Aug 15, 2023, 4:15:01 AM8/15/23
to node...@googlegroups.com
Hi Don,

I am not sure, but perhaps nodemon is looking for changes in the game directory and as you save the results of the game, it restarts it?

Cheers,
Stefano

--
You received this message because you are subscribed to the Google Groups "nodeGame" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodegame+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodegame/CAO9hiFXTjtyOuYthqWjR_55rjhA3vQiyukr5nPEh0pcryE73rw%40mail.gmail.com.

Don Morrison

unread,
Aug 15, 2023, 7:21:51 AM8/15/23
to node...@googlegroups.com

On Tue, Aug 15, 2023 at 4:15 AM Stefano B stefanoba...@gmail.com wrote:

I am not sure, but perhaps nodemon is looking for changes in the
game directory and as you save the results of the game, it restarts
it?

Ah, a clever thought, though sadly not borne out by the evidence: when nodemon restarts things (which I think it does only when it sees a change to a .js file) it leaves a trace in the console spew, and there is none.

However, just for fun, I’ll try it without nodemon and see what I see. Perhaps nodemon is interfering in some other way.

Thanks!



Don Morrison d...@ringing.org
“There are men whose sense of humour is so ill developed that they
still bear a grudge against Copernicus because he dethroned them
from the central position in the universe.”
– W. Somerset Maugham, A Writer’s Notebook

Don Morrison

unread,
Aug 16, 2023, 3:08:24 PM8/16/23
to node...@googlegroups.com
On Tue, Aug 15, 2023 at 7:21 AM Don Morrison d...@ringing.org wrote:

On Tue, Aug 15, 2023 at 4:15 AM Stefano B stefanoba...@gmail.com wrote:

I am not sure, but perhaps nodemon is looking for changes in the
game directory and as you save the results of the game, it restarts
it?

Ah, a clever thought, though sadly not borne out by the evidence:
when nodemon restarts things (which I think it does only when it
sees a change to a .js file) it leaves a trace in the console spew,
and there is none.

My apologies, this does appear to have been the root problem. I was
misreading the log spew coming out of nodemon. Sorry about that.

Adding a config file for nodemon that tells it not to look in the
data/ directory seems to cure the problem.

Thanks!



Don Morrison d...@ringing.org
“Twenty-seven people were got out of bed in quick succession and they
got another fifty-three out of bed, because if there is one thing a man
wants to know when he’s woken up in a panic at 4:00 A. M., it’s that
he’s not alone.” – Neil Gaiman and Terry Pratchett, Good Omens

Stefano Balietti

unread,
Aug 16, 2023, 5:03:28 PM8/16/23
to node...@googlegroups.com
Glad we sorted it out :)

--
You received this message because you are subscribed to the Google Groups "nodeGame" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodegame+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages