UNPKG

programming-game

Version:

The client for programming game, an mmorpg that you interact with entirely through code.

43 lines (34 loc) 1.35 kB
<p align="center"> <a href="https://nextjs.org"> <h1 align="center">Programming Game</h1> </a> </p> [Programming Game](https://programming-game.com/) is an mmorpg that you interact with entirely through code. ## Getting Started Visit the [homepage](https://programming-game.com/) and sign in via Github to create your account. You'll need to sign up for a subscription if you want to play more than one character. The full game is accessible with only one character, but requires coordinated teamwork to progress. After creating your account, and activating your subscription, you can copy your User ID as well as your API KEY to use with this package. ## Controlling your Character Control of your character is done entirely through code. Below is the most basic snippet you can use to get started. ```javascript import { connect } from "programming-game"; connect({ credentials: { id: "<supply your user id here>", key: "<supply your api key here>", }, /** * onTick gets called for each subscribed character on every update from the * server. * * It's fully typed through typescript, so feel free to explore its api. */ onTick: (heartbeat) => { if (heartbeat.player) { return heartbeat.player.move({ x: heartbeat.player.position.x + 1, y: 0, }); } }, }); ```