Git Product home page Git Product logo

goldie's Introduction

Goldie

This Blazor Server app is a basic structure for creating a location-based (NFC /QR tags) trivia game. Modeled after the "Re-elect Goldie Wilson" posters from the Back to the Future movie series, this game requires a MSSQL database to store a set of questions. Players scan the NFC or QR code then are prompted to set a player name. After that they receive questions as the interact with the tags. An Admin screen lets the host monitor progress and review questions.

Setup

Fork the repo then init user-secrets. We just need one for the DB conn string currently so set it at "ConnectionStrings:DefaultConnection"

You will need to set a valid MSSQL connection string like:

"Data Source=URL;Initial Catalog=DATABASE;User Id=USERID;Password=PASSWORD"

From here you can run the EF Migration, something like this:

dotnet ef database update

If it all works as planned, you will have tables for Migrations, Players, Questions, and Answers. Populate the Questions table and set some sort of unique QuestionToken value. I used a set of 4 random alphanumeric digits like "A5G3" or "9TL7" just to obfuscate the URLs a bit. The CorrectChoice column must exactly match the right answer the way its currently setup; it just does a string match when calculating scores.

Once you have a healthy set of questions you can start encoding your tags!

Poster.razor

This file has some of the game logic as it was initially built with NFC tags hidden behind posters like this:

Goldie Wilson poster

Admin

Out-of-the-box, the Admin page lives at WEBSITE/admin/88 - you know, because that's how fast the DeLorean needed to go! Change the route by modifying the @page directive at the top of the Admin.razor file.

The Admin page lists the current players scores, sorted by Score value then by Time Completed. There is also a toggle for showing/hiding the games Questions.

Notes

  • When using NFC tags, iPhone users may have to setup an "Automation" by using the Shorcuts app. This slowed down adoption briefly but it was a one-time task so not too painful.
  • The cookie expiration may complicate game play if the trivia game lasts more than a day, if so change that in the WriteCookie method.
  • If a player switches browsers, they will be prompted to create a new player (name). That may trip people up since there is no name validation or player merging.

Potential Improvements

  • Add db-functions to admin page like clear Answers / Players
  • SignalR messaging to create urgency and fun by notifying others when players complete questions or the game
  • Improved scoring system
  • Allow hints for players
  • Add images or text after answering to add context
  • Alternate question types beyond multiple choice

goldie's People

Contributors

shanabus avatar

Watchers

 avatar

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.