Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* PARENT */
- function Enemy() {
- /* THIS IS BEING CALLED WITHOUT ANY ENEMY OBJECTS BEING ADDED */
- console.log('1');
- this.getStartAndEndPositions();
- }
- Enemy.prototype.getStartAndEndPositions = function() {
- this.startPosition = Math.floor(20 + Math.random() * 361); // 20 - 380
- this.endPosition = Math.floor(500 + Math.random() * 201); // 500 - 700
- }
- /* CHINESE */
- function chineseSoldier(){
- this.health = 100;
- this.damage = 5;
- }
- chineseSoldier.prototype = new Enemy();
- function chineseMachine(){
- this.health = 105;
- this.damage = 10;
- }
- chineseMachine.prototype = new Enemy();
- /* GERMAN */
- function germanSoldier(){
- this.health = 110;
- this.damage = 15;
- }
- germanSoldier.prototype = new Enemy();
- function germanProne(){
- this.health = 115;
- this.damage = 20;
- }
- germanProne.prototype = new Enemy();
- function germanRocket(){
- this.health = 120;
- this.damage = 25;
- }
- germanRocket.prototype = new Enemy();
Add Comment
Please, Sign In to add comment