Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to forfeit/quit an active game session #111

Open
pauloserrafh opened this issue Sep 29, 2019 · 5 comments
Open

Add option to forfeit/quit an active game session #111

pauloserrafh opened this issue Sep 29, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@pauloserrafh
Copy link

Rather than having to ctrl+c to end the current game in progress, there could be an option to forfeit/quit the current game and return to menu.

I've noticed that there is already an CODE_HOTKEY_QUIT_ENDLESS_MODE that is somewhat similar to the proposed idea, but as far as I could tell, the endless mode is not yet implemented (is that right?).

@tcoyvwac
Copy link
Collaborator

tcoyvwac commented Oct 1, 2019

Hi @pauloserrafh, thanks for opening up an Issue. 😺

Rather than having to ctrl+c to end the current game in progress, there could be an option to forfeit/quit the current game and return to menu.

I agree 👍 , sounds like a good plan of action.

I've noticed that there is already an CODE_HOTKEY_QUIT_ENDLESS_MODE that is somewhat similar to the proposed idea, but as far as I could tell, the endless mode is not yet implemented (is that right?).

There is an "endless-mode" in this game however only when you reach the target score tile (2048). You are then presented with an option to activate it (to continue playing to gain higher scores).
This endless-mode should be its own game mode but it hasn't been made a promoted / first-class feature yet.

So as you rightly saw, the "mechanics" of a "player to quit current game and return to main-menu" semi-exists, it just hasn't been fully fleshed-out yet! 😸

@tcoyvwac
Copy link
Collaborator

tcoyvwac commented Oct 1, 2019

Would your suggestion be best implemented like this?

Scenario / Story: Player is playing a 2048 session but needs to quit session early.

  1. Player presses a designated hotkey to end 2048 session.
  2. Game notes hotkey has been pressed and responds with a question to player.
  3. Game asks question if player want to end their 2048 session and awaits response.
  4. Player confirms to Game's question by pressing a hotkey for yes / no.
  5. Game notes hotkey response and:
    • If yes:
      A. Returns to main menu.
    • If no:
      B: Continues current 2048 game session.

@pauloserrafh
Copy link
Author

Hello @tcoyvwac,
Yes, I think the way you put it is mostly what I had in mind.
Regarding the implementation itself:

  1. Should the already existing CODE_HOTKEY_QUIT_ENDLESS_MODE be used (After changing the name to a more appropriate one)?

  2. Should the behavior of saving highscores/statistics be kept when quitting the game?

IMO, there should be no difference between endless mode and regular mode. It doesn't matter which one you choose, the game always start the same way and the difference is that if you don't want to play after you reach 2048, you just choose the option to don't continue.

I'd like to take a shot at it, if you (or someone else) hadn't yet started. I might not be able to work on this until the weekend, tho.

@tcoyvwac
Copy link
Collaborator

tcoyvwac commented Oct 5, 2019

@pauloserrafh, apologies for the delay! Efforts are welcomed in the project and we appreciate yours 🐱!

I am all for an endless-mode in the game!
However, I am a bit confused by this GitHub issue's focus. Your initial post of this issue's topic was about quitting the 2048 game session early via an alternative keypress... 🎯 🔍


If you would like to take the challenge of the scenario / story listed earlier, feel free too!
Minimal changes to a codebase always is a good way for a PR to be accepted into many-a-project.

So, to answer your numbered points:

  1. Should the already existing CODE_HOTKEY_QUIT_ENDLESS_MODE be used (After changing the name to a more appropriate one)?
  1. Yes, however I think a more appropriate name for the keycode would be: CODE_HOTKEY_QUIT_CURRENT_2048_SESSION.

2. Should the behavior of saving highscores/statistics be kept when quitting the game?

  1. No. When the player quits the game early, it should not save any player's data or performance.
    To do opposite (as in, to save the data) has a lot of hidden challenges lurking within! 👻 🔍
    To make an incoming PR for this issue small, to ignore saving behaviour would be a good default plan-of-action 🌞 !

Your issue has spurred me to finish a change in the codebase which touches upon some code you have mentioned at the start of this issue.

May I ask, because of this, could you wait for 7 days or so and update your knowledge on the altered codebase after the incoming merge?

Please note, the general solving of the challenge ("quit-2048-session-while-in-play-early") would basically be tackled the same way (regardless of the incoming codebase update or not), just some of the API called and used would be slightly different.
This issue will be referenced in the PR merge as a "ping" to know that the API has changed.

As for adding an "endless-mode" as a promoted / first-class feature and the plans for that, please feel free to make a new GitHub issue on the matter. Of course, looking forward to discussing and focusing further with you on making it happen! 🚀 😸

@pauloserrafh
Copy link
Author

Hi @tcoyvwac,
Sure I can wait for the changes.

Sorry for causing the confusion, indeed the point of the issue was to focus on having a method to quit the current session without having to interrupt the program.

I'd like to take a shot at it, if you (or someone else) hadn't yet started. I might not be able to work on this until the weekend, tho.

When I said this I was talking about the original point of the issue, but re-reading I see now that was a bit confusing given how I wrote, mb.

Waiting for the updated codebase, then! :)

@tcoyvwac tcoyvwac added the enhancement New feature or request label Oct 13, 2019
@tcoyvwac tcoyvwac changed the title Add option to forfeit/quit current game Add option to forfeit/quit an active game session Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants