Guest User

Untitled

a guest
Jul 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. /* PARENT */
  2. function Enemy() {
  3. /* THIS IS BEING CALLED WITHOUT ANY ENEMY OBJECTS BEING ADDED */
  4. console.log('1');
  5. this.getStartAndEndPositions();
  6. }
  7.  
  8. Enemy.prototype.getStartAndEndPositions = function() {
  9. this.startPosition = Math.floor(20 + Math.random() * 361); // 20 - 380
  10. this.endPosition = Math.floor(500 + Math.random() * 201); // 500 - 700
  11. }
  12.  
  13. /* CHINESE */
  14. function chineseSoldier(){
  15. this.health = 100;
  16. this.damage = 5;
  17. }
  18. chineseSoldier.prototype = new Enemy();
  19.  
  20. function chineseMachine(){
  21. this.health = 105;
  22. this.damage = 10;
  23. }
  24. chineseMachine.prototype = new Enemy();
  25.  
  26. /* GERMAN */
  27. function germanSoldier(){
  28. this.health = 110;
  29. this.damage = 15;
  30. }
  31. germanSoldier.prototype = new Enemy();
  32.  
  33. function germanProne(){
  34. this.health = 115;
  35. this.damage = 20;
  36. }
  37. germanProne.prototype = new Enemy();
  38.  
  39. function germanRocket(){
  40. this.health = 120;
  41. this.damage = 25;
  42. }
  43. germanRocket.prototype = new Enemy();
Add Comment
Please, Sign In to add comment