/reframe-games

A Tetris Clone in re-frame and reagent.

Primary LanguageClojureMIT LicenseMIT

Reframe Games

Games built in ClojureScript, with Reagent, Re-frame, Shadow-cljs, and NES.css.

This repo will be expanded to include other games, but for now, it’s just a Tetris clone. Check out the live game at russmatney.itch.io/tetruss.

Release

Building the release

# remove 'complied' dir from dev-mode
rm -rf public/js/compiled

# build release version
shadow-cljs release app

Deploying to s3

# deploy to s3
aws s3 sync public/ s3://games.russmatney.com

Requires aws cli tool:

yay -S aws-cli

# setup creds
aws configure

Packaging for itch.io

Itch.io requires a .zip of the web-app.

Build as described above, then zip it up.

zip -r reframe-games.zip public

misc todos

[X] control registration/deregistration

[X] dry up game-db events

[X] pause doesn’t always stop the clock?

[ ] dry up @rf/subscribe usage with suggested subscribe macro

`(<-sub! ::s/current-page])`?

[X] move ‘controls-game’ to learn/help/debug namespace?

[ ] update uses of :name to :id where relevant

[ ] add :group-id to pieces/cell-groups

[ ] show/learn controls overlay

no keys detected yet overlay with suggestions for clicking?

[ ] pause overlay (with controls)

[ ] ‘learn’ namespace with minigame for learning controls for currently active games

[ ] support optional url navigation? (back button?)

[ ] show combo chains and rows-to-next-level

[ ] mobile touch/gesture support

[ ] customizable controls

[ ] configurable pieces and board size

[ ] high-score, custom controls preserved across re-fresh

[ ] rows-to-next-level visual indication

[ ] rotate in two directions

[ ] show ‘ghost’ piece (for fast drop)

[ ] mobile detection and ‘alert’?

[ ] add a robot to make moves when no one has for a while

something for leaving it on

[ ] add garden/stylesheets

https://github.com/lambdaisland/garden-watcher

[ ] make get-cell warning optional

ideas

[ ] spin-board after x-many pieces

[ ] battle with AI

[ ] rotation styles on rows

[ ] bullet mode: size-3 pieces, 10x speed

[ ] draw your own piece

[ ] build up a puzzle/art piece

[ ] record and show replay/highlights

[ ] shared high-score + leaderboard

[ ] bonus for clearing the screen completely

[ ] comments for holding same-piece type

[ ] ‘doom’ face - show emotion during left/right/rotate/score

[ ] Add achievements

[ ] poster-ized level clears (gunn style)

include current game state metadata

[ ] display character commentary per piece played

[ ] Write a metadata component

include: current combo, highest combo, combos to next level, highest level pieces played, combos scored, items available

Resources

Tetris

The Tetris Wiki has some great Tetris related resources.

Contributing

My intention for this repository is to build some things from scratch on my own - selfishly, I’m somewhat closed-minded to contributions.

I’m open to talking about the things in here via PRs and Issues, and I encourage you to fork and do what you want with the code!

My motivation for developing this in the public:

  • to share the code as an example
  • to get feedback
  • (hopefully) to inspire others to build things!