Giter Club home page Giter Club logo

15-puzzle's People

Contributors

dependabot[bot] avatar dusansacha avatar ovidiubute avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

15-puzzle's Issues

Solve the puzzles and provide optimal number of moves

  • I'm not sure this is possible or not in a browser, much less a mobile one
  • But if it is possible, then try to solve the board using heuristics
  • Save the number of moves
  • When the user submits his solution, rank it compared to that number and award a high score

Warn user about refreshing the game during a game

This is a nice way to prevent accidentally losing your progress, just have an alert on page reload only if a game is currently underway.

Not sure how it'll look on mobile, though, need to try it out and see how it feels.

Implement material-ui design

The buttons and messages could do with a Material UI overhaul. The nice part about using it is it's already great on mobile devices so no need to spend a lot of effort on that front.

Will need a mockup though before starting work.

Add New Game button

Unlike the Reset button, the New game button should start the game with a new random order of the tiles.

Add stopwatch

It would be nice to also see how much time has elapsed since you started the game.

This is more like a question than an issue

Hello,

I'm creating a race car game and researching different ways in which the timers are implemented in the games created in react so I wanted to know what made you use setInterval vs requestAnimationFrame?

Switch to CSS translate transforms

The method of updating CSS top and left is not sufficiently performant, translateX and translateY will lead to a much smoother animation.

Add cheats

We need a quick way to win the game as debugging and testing out the game is getting tricky ๐Ÿ˜„

Ideally a keyboard combination should be used to instantly trigger the win game state, and it should be something obscure so it doesn't get accidentally triggered by users.

Umbrella issue: remove create-react-app

WIP

Reasons:

  • not enough flexibility over Babel transforms
  • can't upgrade dependencies
  • can't use any other linting without ignoring certain rules (like no implicit imports)
  • no option but to use CSS
  • no hot module reload

Steps:

  • yarn eject
  • Keep the same targets to ensure backwards compatibility
  • Simplify configuration:
    • Babel
    • Webpack

Add footer

It would be nice to have the same footer like in the other games.

Add Eslint lint target

  • new target in package.json called "lint"
  • runs eslint src/* --ext js,jsx
  • add this to pre-commit under lint-staged field just after prettier runs

Add keyboard navigation

I'm thinking the arrow keys and wasd should be used.

How I see it:

  • at any moment, you have two or three tiles that can move, depending on the grid
  • the keypress should determine which tile moves, if a tile that can move to the direction indicated by the key exists, then it should move, otherwise, move the next tile

Still wondering if there are more edge cases here...

Implement LocalStorage

  • Game progress should be saved to LocalStorage
  • This will allow users to continue the game even if they close their browser/tab
  • What needs to be saved?
    • Some sort of user id, we don't want a full login system yet so we'll have to generate a UUID for him and save it
    • It's 2017, we don't care about browsers not supporting LocalStorage, so no cookie workarounds ๐Ÿ˜„
    • The game needs to be paused when leaving the app and the state must be persisted
      • This is required because otherwise you will reload the game and the timer will start immediately and it will be confusing
    • Every move a user makes needs to be saved
      • This will be easier in the long term than just saving a snapshot of the game, we can implement replays for example or even (wait for it) have some sort of async multiplayer mode
      • This needs to be light so a format like [ [0,'r'], [1, 'l'], [3, 'u'], [2, 'd'] ] should be used (tile index 0 to 14 and direction 'r' = 'right', etc...
  • On new game we can clear the history until we have a backend to save them (way long term)
  • We'll need full 100% unit-test coverage for this functionality because it will be very easy to break stuff and it's very hard to debug local storage issues
  • Also need to take care of users having inconsistent data in local storage due to application bugs
  • There are literally dozens of LocalStorage libs out there, need to research on which one is the lightest and suits our needs

Add new game button

There should be some way to start a new game, canceling any progress that you may have.

AirBnB linting

  • create-react-app linting is pretty lax
  • AirBnB is superior so the project will benefit from it

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.