Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

18 changes: 13 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
build/
# Node modules (not used currently but left for future tooling)
node_modules/

node_modules
# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

#Hardhat files
cache
artifacts
# Editor directories and files
.vscode/
.idea/
.DS_Store

# Build outputs
/dist/
/build/
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

1 change: 0 additions & 1 deletion .soliumignore

This file was deleted.

9 changes: 0 additions & 9 deletions .soliumrc.json

This file was deleted.

19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

38 changes: 17 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
BSD 2-Clause License
MIT License

Copyright (c) 2018, Ethereum Name Service
All rights reserved.
Copyright (c) 2024

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
70 changes: 36 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
# Buffer
# Snake Game

[![Build Status](https://travis-ci.com/ensdomains/buffer.svg?branch=master)](https://travis-ci.com/ensdomains/buffer) [![License](https://img.shields.io/badge/License-BSD--2--Clause-blue.svg)](LICENSE)
A modern take on the classic Snake game implemented with vanilla HTML, CSS, and JavaScript. Steer the snake, grab the food, and avoid colliding with the walls or your own tail as the pace quickens.

A library for working with mutable byte buffers in Solidity.
## Features

Byte buffers are mutable and expandable, and provide a variety of primitives for writing to them. At any time you can fetch a bytes object containing the current contents of the buffer. The bytes object should not be stored between operations, as it may change due to resizing of the buffer.
- Responsive canvas that plays nicely on desktop and mobile browsers
- Keyboard (arrow keys & WASD) and touch swipe controls
- Persistent high-score tracking via `localStorage`
- Restart button and end-of-game overlay
- Lightweight, dependency-free code base that can be deployed as static assets

## Getting Started
## Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
1. Clone the repository:

### Installing
```bash
git clone https://github.com/<your-username>/snake-game.git
cd snake-game
```

Buffer uses npm to manage dependencies, therefore the installation process is kept simple:
2. Open `index.html` in your favourite browser. That's it! No build steps required.

```
npm install
```

### Running tests
If you prefer to run the game from a local development server (which enables live reload in many editors), you can use any static server. For example, with Node.js installed:

Buffer uses truffle for its ethereum development environment. All tests can be run using truffle:

```
truffle test
```bash
npx http-server .
```

To run linting, use solium:
## Controls

```
solium --dir ./contracts
```

## Including Buffer in your project
| Action | Keyboard | Touch |
| ------------- | -------------------- | ----- |
| Move up | Arrow Up / W | Swipe up |
| Move down | Arrow Down / S | Swipe down |
| Move left | Arrow Left / A | Swipe left |
| Move right | Arrow Right / D | Swipe right |
| Restart game | R key / Restart button | Tap restart / Play Again |

### Installation
## Project structure

```
npm install buffer --save
.
├── index.html # App markup & canvas layout
├── styles.css # UI styling
└── script.js # Game logic and input handling
```

## Built With
* [Truffle](https://github.com/trufflesuite/truffle) - Ethereum development environment


## Authors

* **Nick Johnson** - [Arachnid](https://github.com/Arachnid)
## Customisation tips

See also the list of [contributors](https://github.com/ensdomains/buffer/contributors) who participated in this project.
- Adjust the `tileCount`, `startingSpeed`, or `minimumSpeed` constants in `script.js` to tweak the difficulty curve.
- Replace the colours in `styles.css` to make the game match your preferred palette.
- Add new power-ups or obstacles by extending the `update` function in `script.js`.

## License

This project is licensed under the BSD 2-clause "Simplified" License - see the [LICENSE](LICENSE) file for details
This project is released under the [MIT License](LICENSE). Feel free to remix and deploy your own version.
Loading