Skip to content

yonigibbs/yaet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elm Tetris

Actions Status

This repo contains a version of Tetris, written in Elm.

Play the game here.

Development

To run the project locally clone the repo, run npm install (only needed once), then run npm run serve. This will start Parcel to serve the app on http://localhost:1234.

The entry point to the app is index.html. This loads index.js, which in turn loads the Elm app itself. The entry point to the Elm code is Main.elm. This module, like the rest, contains comments at the top that explain a bit about it, and should help you find your way around the code.

Possible future enhancements

  • Allow game to be played on more devices
    • Add buttons to control the game, for devices without keyboards
    • Make the UI responsive
  • Prevent default browser behaviour on key presses, otherwise arrow keys can cause the viewport to move if the browser window is small (see elm/browser#89)
  • Some complex moves currently might not be fully possible: investigate T-spin triple, for example
  • Let user pause/resume by clicking on game
  • Add bonus points for hard drop
  • Improve Game Over animation - drop the "Game Over" message down from top of board
  • Use elm-animator instead of doing animations manually
  • Add smoother transitions (e.g. fade out/in) between welcome screen and game screen
  • Minor issues with some corner cases around trapping Enter key on modal dialogs - if the Cancel (or Restore Defaults) button has focus and user presses Enter, what should happen? Is it even normal in web UI to treat Enter as Submit, in modals with no editable controls?

About

Yet another Elm Tetris

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages