Git Product home page Git Product logo

game-tracker's People

Contributors

evanwinter avatar

Watchers

 avatar  avatar

game-tracker's Issues

Support ties

Possible approaches:

  • Make Winner multiselect by default, and treat it the same as Players: select at least one, and hit next when ready. If this is the approach, maybe change "next" button color or something like that to indicate that it's a tie.

Link logged-in user to Player data

Currently, they're unrelated; the app doesn't care who the logged-in user is. Keeping track of the logged-in user would enable things like an Account/Profile page, showing games the user has played in. It could also simplify the player selection step by only needing to choose their opponents and not themself.

Players would need to be created without them logging into the app themself, so there would need to be a distinction between an authenticated player and an anonymous player.

As far as nuts and bolts, I think it'd be a matter of shifting the player uid to a random key instead of their name (leverage Firestore doc IDs here!), and adding an isAuthorized property.

player: { uid: "evan winter" }

becomes...

players: { uid: <unique_key>, name: "evan winter", isAuthorized: false }

<unique_key> would be randomly generated upon creation.

In theory, anytime a player is being added from the UI, they're an AnonPlayer.

When a player signs in to the app, we need to add them as an AuthPlayer -- unless they're already created by someone else as an AnonPlayer.

We could do something like this in the Modal component:

afterLogIn(user) {
  if (players.names.includes(user.name) && !isAuthorized) {
    showModal("Is this you? Yes or No")
    if (yes) isAuthorized = true
    if (no) createNewAuthorizedUser(user)
  }
}

createAuthorizedUser(user) {
  return { uid: <random_key>, name: user.name, isAuthorized: true }
}

createAnonUser(name) {
  return { uid: <random_key>, name: name, isAuthorized: false }
}

Support score

On Winner step, add some sort of "Include Scores" checkbox or toggle. If checked, display a list item for each player and an input for their score.

Think about how different games score things differently –– will this always (or almost always) work? I can't think of a situation where the score is something more complex than a single number for each player, but idk.

Data can be stored like this:

result = {
  game: "Carcassone"
  players: ["evan winter", "emily buchberger"],
  winner: [],
  isTie: false,
  scores: {
    "evan winter": 75,
    "emily buchberger": 68
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.