#game #button #box #friends #day

bin+lib game

eccentric skinner box point-collecting game

2 stable releases

1.0.6 Nov 19, 2020
0.1.0 May 21, 2020
0.0.2 Nov 21, 2014

#142 in Games

Download history 14/week @ 2020-08-13 18/week @ 2020-08-20 17/week @ 2020-08-27 24/week @ 2020-09-03 13/week @ 2020-09-10 12/week @ 2020-09-17 11/week @ 2020-09-24 16/week @ 2020-10-01 15/week @ 2020-10-08 14/week @ 2020-10-15 12/week @ 2020-10-22 16/week @ 2020-10-29 17/week @ 2020-11-05 15/week @ 2020-11-12 48/week @ 2020-11-19 14/week @ 2020-11-26

74 downloads per month

AGPL-3.0

34KB
517 lines

game

There is a button that you can press every day to receive a point. Compete with your friends to see who can get the most points.

what's the technical implementation?

  • uses Rocket to serve webpages
  • uses tera for templating
  • uses a sled database
  • uses bcrypt to hash/salt passwords
  • pulls some trickery in order to embed static files and templates directly into binary:
    1. uses rust-embed to embed static/template directories into the binary
    2. unzips static/template directories to a temporary directory
    3. creates a new Rocket config (so any Rocket.toml or env vars still get parsed) which grabs templates from the temp dir

...why?

In the first iteration of this game I wanted to throw together some fun program in one night. Then, some people actually started playing it. The old code was super unstable and difficult to change because it was thrown together, and I wanted to learn Rust, so I decided to rewrite it.

Dependencies

~16MB
~321K SLoC