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

Solo mini-game #895

Merged
merged 95 commits into from
Oct 18, 2023
Merged

Solo mini-game #895

merged 95 commits into from
Oct 18, 2023

Conversation

sgfost
Copy link
Contributor

@sgfost sgfost commented Oct 3, 2023

Main development branch which adds the implementation of a solo game mode as described in #856


Tkawamura02 and others added 30 commits September 22, 2023 21:46
Co-authored-by: saachibm <saachibm@users.noreply.github.com>
Co-authored-by: sabrinanel3 <sabrinanel3@users.noreply.github.com>
Co-authored-by: sgfost <sgfost@users.noreply.github.com>
Co-authored-by: sabrinanel3 <sabrinanel3@users.noreply.github.com>
Co-authored-by: sabrinanel3 <sabrinanel3@users.noreply.github.com>
Co-authored-by: sabrinanel3 <sabrinanel3@users.noreply.github.com>
…k card entities

refactor: minor changes to solo game treatment

Co-authored-by: sabrinanel3 <sabrinanel3@users.noreply.github.com>
TODO:
- implement service layer for persistence, recovery(?), and retrieval

ref #856
- minor renaming
- add types
- fix issues/refactor in the game logic commands
state is currently local to the component, we should reorganize the
single vuex store we have currently (split up game and anything else)
and then add a new SoloGame store
- add fixtures for game treatments and event cards
- add service methods for persisting game data and drawing cards/picking
  treatments
- reworked solo game entities
- (re-)add migration for solo game data model

ref #856
add link to nav bar, which should probably have a better name
Co-authored-by: sgfost <sgfost@users.noreply.github.com>
finalization (updatePlayerPoints) would throw an error since gameId was
not set on the solo_player
Co-authored-by: sgfost <sgfost@users.noreply.github.com>
Co-authored-by: sabrinanel3 <sabrinanel3@users.noreply.github.com>
Co-authored-by: Tiffany Kawamura <Tkawamura02@users.noreply.github.com>
Additional fixes to the solo game dashboard layout
@sgfost sgfost marked this pull request as ready for review October 16, 2023 18:27
sgfost and others added 13 commits October 16, 2023 11:55
OCD rename of Highscores to HighScore to maintain codebase consistency;
entities are all singular, e.g., User | TournamentRound | Player etc.,
which made SoloHighscores stick out
https://en.wiktionary.org/wiki/the_nail_that_sticks_out_gets_hammered_down
prevent "at or below around" threshold info message
fix Splash.vue copypasta GameOver class name

standardize text in Splash screen to use solo game instead of
simulation / trial / etc

add `make docker-clean` target to rebuild from scratch
`drawRoundCards` method when called for the second time to deal with a
murphy's law card was re-drawing the previous cards, needed to draw from
the pool of non-round non-expired cards instead of just non-expired

resolves #899
otherwise, you could just keep starting new games and abandoning them to
make your way through the treatments
remove accidental pasta from MarsEvents
remove dead code and minor hygiene elsewhere, get rid of "simulation"
language in favor of standard game over like the actual multiplayer game

should consider if scroll wheel is worth using as an input device to
change investment vs keyboard right/left arrows or +/- j/k wsad etc
@@ -147,6 +139,8 @@ export default class SegmentedBar extends Vue {
}

mounted() {
// FIXME: consider if we really want to use scroll wheel to increment / decrement the value, keyboard input might be
// better for accessibility (+ / -) (<- ->)?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyboard controls are a good idea, L/R arrow keys and enter for investing/continuing through events

the scroll thing only happens when the cursor is over the input bar so it hopefully wouldn't interfere with anything too much, though probably unnecessary if we have keyboard controls

Copy link
Member

@alee alee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work @virtualcommons/port-of-mars-dev team! This looks really solid. I had a few issues with overall codebase consistency but these are mostly simple changes like making imports consistent etc.

Changes to the schema are a thornier issue but we can discuss at this afternoon's meeting


@OneToOne(type => SoloPlayer, player => player.game)
@JoinColumn()
player!: SoloPlayer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is a bit late, but is there really a need for a SoloPlayer entity at all? Why not have SoloGame point directly at a User?

const roll = getRandomIntInclusive(card.rollMin, card.rollMax);
// fill out templates from the db with the actual roll value and pluralization
const effectText = card.effect
.replace("{roll}", roll.toString())
Copy link
Member

@alee alee Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these dynamic template strings could also be set up as functions in the EventCards themselves, something like https://stackoverflow.com/a/40147828/93370

(for the future)

sgfost and others added 5 commits October 17, 2023 14:54
- left/right arrow keys for incr/decr investment
- enter to submit investment
- space to skip events (not using enter to prevent spamming through
  events and then submitting 0 immediately)
@alee alee merged commit 4ed1283 into main Oct 18, 2023
@alee alee deleted the solo branch October 18, 2023 20:16
@sgfost
Copy link
Contributor Author

sgfost commented Oct 18, 2023

@all-contributors please add @sabrinanel3 for code, docs, design

@alee just remembered @sabrinanel3 is missing from the @.virtualcommons/port-of-mars-dev team as well and I can't seem to add people to that

@allcontributors
Copy link
Contributor

@sgfost

This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token ] in JSON at position 3367

@sgfost
Copy link
Contributor Author

sgfost commented Oct 18, 2023

@all-contributors please add @sabrinanel3 for code, docs, design

@allcontributors
Copy link
Contributor

@sgfost

I've put up a pull request to add @sabrinanel3! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants