Giter Site home page Giter Site logo

battlecode-client-17's Introduction

Battlecode Client 2017 ๐Ÿ•ธ

This is the game client for Battlecode 2017, which can run in your web browser or as a standalone application.

If you're a competitor and not interested in developing the client, you shouldn't do any of the things this document tells you to do. Proceed at your own risk.

Developing

To get started:

$ npm install

To watch in a browser:

$ npm run watch

To watch using a standalone app (Electron):

$ npm run electron

To run the tests:

$ npm test

Note: Tests currently don't run in a browser; they run in node. They also don't understand webpack. That should change quickly.

All code and assets go in src, which is written in Typescript. Note that we're using webpack to bundle everything up; if you want the url of, say, an image, put the image at src/images/image_file.png, and then do require('./images/image_file.png'), which will return the URL of the image. If you want to reference another typescript file do a standard typescript ES6 import.

If you want to add a dependency, run npm install --save package-name and then npm install --save @types/package-name (for the typescript declarations). If @types/package-name doesn't exist, sacrifice a goat, or possibly a grad student.

Also note that this repo doesn't contain all of the client code. See battlecode-playback; that's the library that actually reads and replays the .bc17 match files. This repo has everything else; video, sound, controls, etc. If you've made a change in -playback and want to integrate it here, you'll need to commit it, get the commit hash, and then put the commit hash in package.json, replacing the current one, and then do npm install. It's a bit of a pain; the cost of cutting things out into libraries, sadly.

Deploying

To build a release bundle:

$ npm run prod

This will bundle up all of the assets you want in the bc17 folder. You can then embed the client in any web page you want:

  • Mount the assets in bc17 at /bc17/ on your webserver.
  • <script src="/bc17/bundle.js"></script>
  • <script>window.battlecode.mount(document.getElementById('battlecode-div'))</script>

You now have a copy of the battlecode client running on your web page. See src/app.ts and src/config.ts to learn about the client's API.

battlecode-client-17's People

Contributors

bovard avatar bovardtiberi-wf avatar halfvoxel avatar jbloxham avatar kazimuth avatar muandrew avatar vontell avatar ygina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.