grifdail

Untitled

Nov 24th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Enemy_1(nodeEnemy,spritesArray){
  2.     Sprite.call(this,nodeEnemy,spritesArray);
  3.     this.ennemies_1 = [];
  4.     this.config = nodeEnemy;
  5.     console.log("En ", this.config);
  6.     this.x = 2000;
  7.     this.y = 500;
  8. }
  9.  
  10. Enemy_1.prototype = Object.create(Sprite.prototype);
  11. Enemy_1.prototype.constructor = Enemy_1;
  12.  
  13.  
  14. Enemy_1.prototype.move = function(){
  15.     console.log("yolo");
  16.     this.x -= 3;
  17. }
  18.  
  19. function generator() {
  20.         if (this.ennemies_1.length < 10) {
  21.                 this.ennemies_1.push(new Enemy_1(this.config));
  22.         }
  23.         window.setTimeout(generator, 10000);
  24. }
  25.  
  26. /************************************************\
  27.     A METTRE DANS LE LA FONCTION QUI LANCE LE JEU !
  28. \************************************************/
  29. generator();
Advertisement
Add Comment
Please, Sign In to add comment