Code Monkey home page Code Monkey logo

custom-guess-who's Introduction

Custom Guess Who game

code style: prettier

Generate cards ready to be printed out and used in a Guess Who game. Simply provide images, and the code does the rest!

Screenshot of the code in action

Features

  • Use your own digital images and print out ready to play with cards.
  • Create blank cards one can glue on images and write names after printing.

Steps to create a custom Guess Who game

Follow these steps to create your own custom guess who game!

  1. Buy a copy of the game Guess Who?
  2. Find 24 images of someone you want to have in your game.
  3. For the best result crop the images to the person's head.
    • Tip: Cropping can be done in many applications, like the built in Photos app in Windows. A free app that supports setting the aspect ratio when cropping is GIMP.
    • (Optional) To avoid white stripes on the sides of the image (to fill the image field in the card) use the ratio 22:32 when cutting.
  4. Name the image files the name of the persons.
    • For a blank name use "blank_name" somewhere in the file name. You can use "blank_name1", "blank_name2", etc. for as many blank names as you want.
  5. Clone this repository and run the web app with npm start (after running npm install)
  6. Add the images to the folder /src/faces
  7. Print the resulting web page from your browser. Usually the keyboard shortcut is CTRL + P
    • In Chrome in the print dialog, choose "More settings" and check the checkbox "Background graphics".

    Tip: the cards will work best if they are stiffer than regular printer paper. To achieve this you can use a thicker paper, photopaper or laminating the printer paper. You can also simply glue printer paper onto thicker paper if the printer cannot print it.

  8. Cut out the cards and play with them!

Will this work for me

You should double check that the sizes of the cards matches the sizes of your game. Sizes hard coded in this repo are:

  • Face card: 50mm (height) x 28mm (width)
  • Secret card: 73mm (height) x 36mm (width)

You can change the sizes by changing the CSS inside the components FaceCard.tsx and SecretCard.tsx. The card colours are defined in App.tsx component.

Currently the code are written to find the file extensions .png, .jpg and .svg. The limitation is your browser, so it should be possible to modify the code and use any file format your browser support.

The print feature of your browser could mess with the scaling. Printing a test page and measuring the cards is adviced.

Requirements

To run the code you need Node.

Quirks

Since CSS doesn't support page breaks inside Flexbox or CSS Grid it is hard coded that there are four pages. One for player 1 face cards (with blue colours), one for player 2 face cards (with red colours), and two pages for the secret cards (with yellow colours).

Dev stuff

This project was bootstrapped with Create React App.

Uses

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode. Remember to run npm install first.

Open http://localhost:3000 to view it in the browser. The page will reload if you make edits. You will also see any lint errors in the console.

npm run compilecheck

Runs the TypeScript compiler without emitting any files. Useful to check for compile errors in all files.

custom-guess-who's People

Contributors

sti2nd avatar thehale avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

thehale

custom-guess-who's Issues

Provide a way to make blank cards

It would be nice if there was an easy way to make some blank cards (e.g. to provide as extras/for friends to glue on additional pictures of their choosing later on). I'm currently trying to use pictures of a solid white background with a variety of different whitespace characters for names to achieve the effect but keep ending up with the name getting set to "2Q==" for some bizarre reason.

I'll post an update if I find a good workaround.

Extract parameters into some kind of config

It would be better DX (Developer Experience) if the parameters weren't hard coded in the components. Solution would be to extract the parameters into one file.

Long term maybe there even could be a GUI to adjust these parameters while the app is running. That would be one step towards making it possible to use this app for non-developers. For this issue I suggest not doing GUI.

Find a better ratio

Resizing to 121:98 is a pretty weird ratio (cumbersome to write). 15:12 is fairly close (121 - 1 : 98 - 2). Or one could test how 3:2 looks (15 : 12 - 2).

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.