Advertisement
actuallykane

Troop class

Nov 30th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Troop {
  2.     constructor(x, y, side, color) {
  3.         this.id = Math.random();
  4.         this.health = 100;
  5.         this.maxHealth = 100;
  6.         this.attackCycle = 90;
  7.         this.neededAttackCycle = 90;
  8.         this.range = 36;
  9.         this.attack = 20;
  10.         this.radius = 16;
  11.         this.canMove = false;
  12.         this.side = side;
  13.         this.color = color;
  14.         this.x = x;
  15.         this.y = y;
  16.     }
  17.  
  18.     setPosition(x, y) {
  19.         this.x = x;
  20.         this.y = y;
  21.     }
  22. }
  23.  
  24. module.exports.Troop = Troop;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement