Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Enemy_1(nodeEnemy,spritesArray){
- Sprite.call(this,nodeEnemy,spritesArray);
- this.ennemies_1 = [];
- this.config = nodeEnemy;
- console.log("En ", this.config);
- this.x = 2000;
- this.y = 500;
- }
- Enemy_1.prototype = Object.create(Sprite.prototype);
- Enemy_1.prototype.constructor = Enemy_1;
- Enemy_1.prototype.move = function(){
- console.log("yolo");
- this.x -= 3;
- }
- function generator() {
- if (this.ennemies_1.length < 10) {
- this.ennemies_1.push(new Enemy_1(this.config));
- }
- window.setTimeout(generator, 10000);
- }
- /************************************************\
- A METTRE DANS LE LA FONCTION QUI LANCE LE JEU !
- \************************************************/
- generator();
Advertisement
Add Comment
Please, Sign In to add comment