Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gptkrsh/kattlesnake
BattleSnake for @WeMakesDev Challenge
https://github.com/gptkrsh/kattlesnake
Last synced: 19 days ago
JSON representation
BattleSnake for @WeMakesDev Challenge
- Host: GitHub
- URL: https://github.com/gptkrsh/kattlesnake
- Owner: gptkrsh
- License: mit
- Created: 2022-12-07T13:17:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-18T09:55:41.000Z (about 2 months ago)
- Last Synced: 2024-09-18T13:11:39.239Z (about 2 months ago)
- Language: TypeScript
- Size: 234 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Battlesnake TypeScript Starter Project
An official Battlesnake template written in TypeScript. Get started at [play.battlesnake.com](https://play.battlesnake.com).
![Battlesnake Logo](https://media.battlesnake.com/social/StarterSnakeGitHubRepos_TypeScript.png)
This project is a great starting point for anyone wanting to program their first Battlesnake in TypeScript. It can be run locally or easily deployed to a cloud provider of your choosing. See the [Battlesnake API Docs](https://docs.battlesnake.com/api) for more detail.
[![Run on Replit](https://repl.it/badge/github/BattlesnakeOfficial/starter-snake-typescript)](https://replit.com/@Battlesnake/starter-snake-typescript)
## Technologies Used
This project uses [TypeScript](https://www.typescriptlang.org/), [Node.js](https://nodejs.org/en/), and [Express](https://expressjs.com/). It also comes with an optional [Dockerfile](https://docs.docker.com/engine/reference/builder/) to help with deployment.
## Run Your Battlesnake
Install dependencies using npm
```sh
npm install
```Start your Battlesnake
```sh
npm run start
```You should see the following output once it is running
```sh
Running Battlesnake at http://0.0.0.0:8000
```Open [localhost:8000](http://localhost:8000) in your browser and you should see
```json
{"apiversion":"1","author":"","color":"#888888","head":"default","tail":"default"}
```## Play a Game Locally
Install the [Battlesnake CLI](https://github.com/BattlesnakeOfficial/rules/tree/main/cli)
* You can [download compiled binaries here](https://github.com/BattlesnakeOfficial/rules/releases)
* or [install as a go package](https://github.com/BattlesnakeOfficial/rules/tree/main/cli#installation) (requires Go 1.18 or higher)Command to run a local game
```sh
battlesnake play -W 11 -H 11 --name 'TypeScript Starter Project' --url http://localhost:8000 -g solo --browser
```## Next Steps
Continue with the [Battlesnake Quickstart Guide](https://docs.battlesnake.com/quickstart) to customize and improve your Battlesnake's behavior.
**Note:** To play games on [play.battlesnake.com](https://play.battlesnake.com) you'll need to deploy your Battlesnake to a live web server OR use a port forwarding tool like [ngrok](https://ngrok.com/) to access your server locally.