Giter VIP home page Giter VIP logo

vue-snake's Introduction

๐Ÿ Snake game built with Vue

๐Ÿ“š Just for learning purposes.

This is my first project wih Vue, so there will be a lot of code that can be done more efficiently. Please, feel free to create any pull request you want ๐Ÿ™‚

Installation

  1. Make sure you are using a version of Node >8 and it's corresponding version of NPM. v8.16.2 has specifically been tested to work.
    • A recommendation is to use NVM to manage your Node versions.
    • (Windows users: Use this version of NVM)
    • After installing nvm, run nvm install 8 to install the latest 8 version, or nvm install 8.16.2 to install the specific version.
    • Run nvm use 8 or nvm use 8.16.2 to ensure your Node version is the correct version.
  2. Run npm install to install all of the dependencies.
  3. Run npm run serve to start the server.
  4. Go to http://localhost:8080/ to play your local development copy of the game.

Road Map

  • Add tests for the components
  • Finish the test suite for the current code
  • Add score board with local storage
  • Add button for resetting the game
  • Add Webpack, postCSS or whatever it's needed to add Tailwind
  • Add TailwindCSS
  • Center the board properly
  • Remove vertical scrolling with overflow
  • Add retro sounds when moving, eating and game over
  • Speed system needs improvements, it gets impossible to play after 25 points

vue-snake's People

Contributors

dependabot[bot] avatar lloople avatar luceleaftea avatar madhupolu avatar maria-carrero avatar matrix159 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vue-snake's Issues

Make it playable on mobile devices

  • ย Fix responsive layout issues
  • Use screen areas or swap to control the direction
  • Add some question mark popup explaining how to play on mobile

Changing direction too fast makes snake suicide

If you change the direction too quickly it will skip the conditional check to not turn back and collapse with the first body piece.

It should allow only one direction change per each interval iteration.

Fix play again button

After the game is over, if you try to play again using the button that resets everything it does not work as expected.

  • Last food remains on the board.
  • New snake appears in the correct position, but the previous one is still in the board.
  • New snake cannot move, this could be because it's using the previous snake head instead of the new one.

Play button plays startup sound while game is running

I tried hitting the button while the game was running to see what would happen. It didn't reset anything which seems great, but it did play the sound like it's starting up again. If that sound should be disabled that's a really quick fix. However, if you do want a sound playing for UX feedback, I'd suggest playing a different, more "error-y" sound to indicate the button isn't working right now (which would match up with the button changing it's style during play).

Alternative solutions:

  • Don't even let the user click on the button during play (make the button actually disabled while the game is running)
  • Change the Play button to a Stop button during gameplay

Convert to TypeScript

I was wondering if you'd considered using TypeScript for this app! I've always found TypeScript makes working JavaScript a lot nicer for me personally, and it's helped me keep my code cleaner. If you're interested, I'd be willing to convert it over to TypeScript. :)

Play sounds instantly

There are three sounds related to actions in the game, but they play with some lag. It's downloading them each time.

So, if possible, the game should download the 3 wav files just when loading the page, and consume them for every action without downloading again.

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.