All Projects β†’ ByronHsu β†’ Never Blink

ByronHsu / Never Blink

Licence: mit
πŸ‘€Blink and lose.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Never Blink

Codenames
Stars: ✭ 159 (-80.17%)
Mutual labels:  flask, game
Live Stream Face Detection
Live Streaming and Face Detection with Flask in Browser
Stars: ✭ 47 (-94.14%)
Mutual labels:  flask, video-streaming
Thatconf2015pong
Slides and sample project code (pong) for my talk at That Conference 2015
Stars: ✭ 5 (-99.38%)
Mutual labels:  game, socketio
emiga-stream
Video stream using Express.js , Socket.io
Stars: ✭ 24 (-97.01%)
Mutual labels:  socketio, video-streaming
Colobot
Source code of open-source Colobot: Gold Edition project developed by Epsitec and TerranovaTeam
Stars: ✭ 777 (-3.12%)
Mutual labels:  game
Spark Movie Lens
An on-line movie recommender using Spark, Python Flask, and the MovieLens dataset
Stars: ✭ 745 (-7.11%)
Mutual labels:  flask
Flask Apscheduler
Adds APScheduler support to Flask
Stars: ✭ 741 (-7.61%)
Mutual labels:  flask
Flask Peewee
flask integration for peewee, including admin, authentication, rest api and more
Stars: ✭ 739 (-7.86%)
Mutual labels:  flask
Osu
rhythm is just a *click* away!
Stars: ✭ 8,573 (+968.95%)
Mutual labels:  game
Fungus
An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
Stars: ✭ 786 (-2%)
Mutual labels:  game
Trape
People tracker on the Internet: OSINT analysis and research tool by Jose Pino
Stars: ✭ 6,753 (+742.02%)
Mutual labels:  flask
Flask Mongoengine
MongoEngine flask extension with WTF model forms support
Stars: ✭ 750 (-6.48%)
Mutual labels:  flask
Tableexport
The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
Stars: ✭ 781 (-2.62%)
Mutual labels:  flask
Mixer
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.
Stars: ✭ 743 (-7.36%)
Mutual labels:  flask
Arshooter
A demo Augmented Reality shooter made with ARKit in Swift (iOS 11)
Stars: ✭ 794 (-1%)
Mutual labels:  game
Avg Core
A Future-oriented Adventure Game Framework based on React & Pixi.js. Docs: https://avgjs.github.io/docs/
Stars: ✭ 740 (-7.73%)
Mutual labels:  game
Term2048
πŸŽ‰ 2048 in your terminal
Stars: ✭ 777 (-3.12%)
Mutual labels:  game
Savethedot
A game developed using UIViewPropertyAnimator
Stars: ✭ 785 (-2.12%)
Mutual labels:  game
Coffee
An opinionated 2D game engine for Rust
Stars: ✭ 771 (-3.87%)
Mutual labels:  game
Openspades
Compatible client of Ace of Spades 0.75
Stars: ✭ 769 (-4.11%)
Mutual labels:  game

Never-Blink

1. πŸŽ‰ Introduction

πŸ™Œ Upvote for my product hunt!

Randomly connect to a player around the world and challenge him/her. Remember not to blink!

For full version of demo video, click here.

2. πŸ“œ Implementation

1. Project structure

.
β”œβ”€β”€ backend
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ detect.py
β”‚   └── shape_predictor_68_face_landmarks.dat (detect model)
β”œβ”€β”€ package.json
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ server.py
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ app.jsx
β”‚   β”œβ”€β”€ index.js
β”‚   β”œβ”€β”€ play.jsx
β”‚   └── start.jsx
β”œβ”€β”€ static
β”‚   └── bundle.js
β”œβ”€β”€ templates
β”‚   └── index.html
└── webpack.config.js

We use react as our frontend framework, and use peerjs to communicate between clients. At backend, we use flask to host the server. For connection between clients and server, we use socketio to implement real-time data transfer.

2. Game State

We use the notion of Finite State Machine to design our game state. The circle is the state. The text in the top of each box is the event causing state transition, and the text in the bottom of each box is the action taken when event occurs. The logic looks quite simple here, but it is not that easy to implement. For more detail you can check play.jsx or server.py.

3. πŸ’» Development

I spent lots of time formatting my code and writing comments to make it as readable as possible. Hope you enjoy 😊

  1. Clone this repo.
git clone [email protected]:ByronHsu/Never-Blink.git
  1. Install the packages
# Frontend
npm install
# Backend
pip install -r requirements.txt
  1. Build and Run
# Build frontend files
npm run build
# Run server
npm run start

Every time you changed your code, you should run the above command again. We do not support hot module replacement now.

  1. Start and Enjoy

Goto https://0.0.0.0:3000

0.0.0.0:3000 does not work, remember to add https.

4. 🚧 Problem

  1. Because the detector is too slow and weak, we can not endure too many clients. Therefore, we do not deploy it to a public server now. We plan to train a robust and fast model in the future.
  2. When restarting, the old media connection listener will be called again. So we remove restart temporarily.

5. πŸ“– Reference

  1. Environment setup: https://github.com/rwieruch/minimal-react-webpack-babel-setup
  2. Simple P2P WebRTC package: https://github.com/peers/peerjs
  3. Socket-io: https://socket.io/docs/client-api/
  4. Flask-socketio: https://flask-socketio.readthedocs.io/en/latest/
  5. Blink detector: https://github.com/dilawar/eye-blink-detector
  6. Material UI: https://material-ui.com/

6. πŸ—žοΈ License

MIT Licensed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].