Code Monkey home page Code Monkey logo

tankdesigner's Introduction

tankdesigner specs

Important: your tank must extend the BaseTank class, and must have at least these functions:

/* constructor(callback, options,setup){ super(callback, options,setup); } compute(){ //your main AI code goes here. }

BaseTank Specs

Properties:

Methods:

  • getDistanceToBounds
    • purpose: get distance to north, south, east, and west boundaries of game world
    • params: none
    • return: (object) :
      • north: distance to north bounds,
      • south: distance to south bounds,
      • east: distance to east bounds,
      • west: distance to west bounds}
  • move
    • purpose: move the tnak
    • params: (string) direction
      • 'forward' : move the tank forward;
      • 'backward' : move the tank backward;
      • 'stop': stop tank movement
    • return: undefined
  • turretTurn
    • purpose: turn the turret in the specified direction, relative to world direction
    • params: angle (number)
    • return: undefined
  • bodyTurn
    • purpose: turn the tank in the specified direction, relative to the world direction
    • params: angle (number)
    • return: undefined
  • fireCannon
    • purpose: fire tank cannon
    • params: undefined
    • return: undefined
  • activateSensor
    • purpose: detect tanks in front of the tanks turret
    • params: none
    • return: (array) array of objects for each object detected
      • object
        • angle (number) - the real world direction to the object
        • range (number) - the distance to the object
        • name (string) - the name of the object
  • activateMagnetoDetector
    • purpose: get general direction of other tanks
    • params: none
    • return: (object) list of directions with count of tanks in that direction
      • ne: (number) count of tanks to the northeast (up right)
      • sw: (number) count ot anks to the southwest (down left)
      • nw: (number) you get the idea
      • se: (number) more of the same
  • getCurrentPosition
    • purpose: return the x,y coordinates of your tank
    • return: (object)
      • x: x coordinate of the tank
      • y: y coordinate of the tank
  • getTurretAngle
    • purpose: return the angle of the turret
    • params: none
    • return: (number) the degree angle of the turret relative to the world
  • getBodyAngle
    • purpose: return the angle of the tank body
    • params: none
    • return: (number) the degree angle of the tank body
  • getName
    • purpose: get the current tank's name
    • params: none
    • return: (string) the name of the tank
  • getHealth
    • purpose: get the current tank's hitpoints
    • params: none
    • return: (number) percentage of health remaining
  • on
    • purpose: set an event listener
    • params:
      • handler (string) - the event to attach a handler to
        • turretTurnComplete : when turret reaches desired angle
        • bodyTurnComplete: when body reaches desired angle,
        • damage: when tank is damaged,
        • death: when tank dies,
        • collision: when tank collides with something
      • callback (function) - the handler to execute when the event happens
  • getComponentSpecs
    • purpose: get specifications of an item on your tank
    • params:
      • item (string) - the item you want the specs of
    • return: (object) with specs of the item in question

Events:

tankdesigner's People

Contributors

dpaschal-lf avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.