A Traditional Game Created Using Vue 3

Snake

This is a classical game that is developed in Vue3.

Rules

  • The game is played in a 35×35 grid.
  • The player starts as a single cell snake with a random direction.
  • The player can navigate the snake via W, A, S, D keys or the arrow keys (⬆, ⬅, ⬇, ➡).
  • If the snake hits the grid boundaries, it will continue to move in the same direction from the opposite end.
  • The player needs to navigate the snake to the snack in order to have the snake grow and gain score.
  • Each eaten snack contributes 1 point to the score.
  • If the snake hits its own tail, then the game is over.

Development

Prerequisites

You need to install and setup the following:

  • node.js
  • yarn
  • git

Clone the repository

  • Open up a terminal (Linux, macOS), or a command prompt (Windows)
  • Navigate to the directory you would like to download this repository in
  • You can do this by running a cd command like so:
cd /directory/for/this/repo
  • Do not forget to change /directory/for/this/repo with the directory of your own choosing!
  • Clone the repository by running the following command:
git clone https://github.com/ekinkaradag/snake-vue3.git

Running the game

  • If the cloning process went well, you need to change the directory to the newly created snake-vue3 folder in order to install the dependencies
  • To Change the directory, run the following command:
cd snake-vue3
  • This can be done by running the following command:
yarn
  • Or, if you prefer to use npm, you can run this:
npm install
  • Once the dependencies are installed, you can start the game in a live dev environment.
  • This can be done by running the following command:
yarn dev
  • Or, if you prefer to use npm, you can run this:
npm run dev
  • If you would like to build it:
  • This can be done by running the following command:
yarn build
  • Or, if you prefer to use npm, you can run this:
npm run build
  • When you do this, the built files will be available in the dist folder.
  • If you would like to deploy it to GitHub Pages:
  • This can be done by running the following command:
yarn deploy
  • Or, if you prefer to use npm, you can run this:
npm run deploy

GitHub

View Github

Related Posts

Recent Posts

ഇടുക്കിയിലെ മലയോര മേഖലകളിൽ രാത്രിയാത്ര നിരോധിച്ചു. രാത്രി ഏഴു മുതൽ രാവിലെ ആറു വരെയാണ് നിരോധനം

ഏന്തയാർ ഈസ്റ്റിൽ പ്രളയത്തിൽ തകർന്ന പാലത്തിന് പകരം പുതിയ പാലം നിർമ്മിക്കുവാൻ താത്ക്കാലിക പാലം പൊളിച്ച് നീക്കി

Explore the Investment Opportunities: A Comprehensive Guide to Different Types of Mutual Funds

Title: Understanding Mutual Funds: A Beginner's Guide to Investing

തീവ്രമഴ മുന്നറിയിപ്പിന്റെ പശ്ചാതലത്തിൽ സംസ്ഥാനം ജാഗ്രതയിൽ

250,000 അപേക്ഷകൾ വർദ്ധിച്ചതിനാൽ ട്രാൻസ്‌പോർട്ട് കമ്മീഷണർ പരിശോധന പുനരാരംഭിക്കും

ഏലക്കയിൽ കീടനാശിനി സാന്നിധ്യം; ആറര ലക്ഷത്തിലധികം ടിൻ അരവണ നശിപ്പിക്കാൻ ടെൻഡർ ക്ഷണിച്ച് ദേവസ്വം ബോർഡ്‌

ഭീമൻ പാറക്കഷണങ്ങൾ അടർന്ന് ദേശീയ പാതയിലേക്ക് വീഴുന്നത് പതിവാകുന്നു. കുട്ടിക്കാനത്തിനും മുണ്ടക്കയത്തിനുമിടയിൽ നിലനിൽക്കുന്നത് വൻ അപകട ഭീഷണി

ചക്രവാതച്ചുഴി:അതിശക്തമായ മഴ വരുന്നു

പ്ലസ് വൺ പ്രവേശനം. അക്ഷയയിൽ തിക്കി തിരക്കേണ്ട, നെറ്റിവിറ്റി/ജാതി തെളിയിക്കാൻ പത്താംതരം സർട്ടിഫിക്കറ്റ് മതി