landgreen / n-gon

2-d physics rogue-lite platformer shooter
https://landgreen.github.io/n-gon/
GNU General Public License v3.0
134 stars 193 forks source link

community feedback wanted: confirm close tab? #182

Closed landgreen closed 4 months ago

landgreen commented 4 months ago

Should I comfirm that you want to close or reload the page? Is this annoying or does it save your run when you accidentally close out?

window.onbeforeunload = function (e) { return "Please click 'Stay on this Page' if you did this unintentionally"; };

Screenshot 2024-03-07 at 5 52 54 PM
kgurchiek commented 4 months ago

I think it's a good idea, I've accidentally hit ctrl while playing several times, which closed out my game when I pressed W

Whyisthisnotavalable commented 4 months ago

Maybe this could be optional in the settings

landgreen commented 4 months ago

yeah I think make it an option, but what should the default be? ON or OFF

kgurchiek commented 4 months ago

What if it's off by default but there's a junk tech that enables it so people know it exists? A lot of people never even check the settings tab, so maybe if the tech says in the subtext that it's in settings more people will notice

landgreen commented 4 months ago

A JUNK tech sounds good. Also I can run code when you try to exit. What should the JUNK tech do each time you cancel exiting the game?

For example I can spawn power ups when you try to exit but cancel. I'd want something fun and maybe strong in certain situations, but normally just dumb.

landgreen commented 4 months ago

ok I'm thinking each time you cancel you get +20% damage but you have a 1 in 5 chance to close the game tab?

kgurchiek commented 4 months ago

What about instead of a 20% chance to actually close when you cancel it it instead sends you to a different version? Or maybe to planetesimals?