Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patmood/vim_snake
Vim Snake Game powered by web assembly
https://github.com/patmood/vim_snake
Last synced: 24 days ago
JSON representation
Vim Snake Game powered by web assembly
- Host: GitHub
- URL: https://github.com/patmood/vim_snake
- Owner: patmood
- Created: 2013-08-08T13:26:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-08-13T10:50:44.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:41:23.602Z (4 months ago)
- Language: JavaScript
- Homepage: https://vimsnake.com
- Size: 73.1 MB
- Stars: 143
- Watchers: 4
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-pocketbase - GitHub - | (Showcases)
- awesome-pocketbase - GitHub - | (Showcases)
- awesome-pocketbase - Vimsnake - A realtime WASM game where Vim commands are used as controller inputs. ![GitHub Repo stars](https://img.shields.io/github/stars/patmood/vim_snake) (Showcases)
README
# WASM Snake
Vim Snake 2.0 is written in Go and compiled to Web Assembly.
I originally built this site in 2013 using my extremely limited knowledge of javascript and ruby/sinatra. It was trivial to cheat and so the leaderboard was meaningless. This rewrite fixes those issues and taught me a bunch about new web technologies.
## Development
### Run the server
`go run cmd/main.go serve`
or to watch use the `reflex` golang package
`reflex -r '\.go$' -s -- sh -c "go run cmd/main.go serve"`
### Front end
Create a .env file with environment variables shown in .env_example
`yarn build` single build or `yarn start`for development
NOTE: wasm_exec.js needs to be from the specific go version
### WASM Code
`make` to build (also watched and built by `yarn start`)
### Docker
Build `docker build . -t vimsnake:latest --build-arg ARCH=arm64`
Run `docker run -p 3000:8090 --rm -it vimsnake`
Inspect `docker run --rm -it -p 3000:8090 --entrypoint sh vimsnake:latest`
## TODO
- Show your top score and thumbnail
## Pocketbase ideas
- When generating migrations, generate a test file too
- When making fields required, set default value and enforce at DB level