arknoid

Members
  • Content Count

    5
  • Joined

  • Last visited

About arknoid

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I have a problem again, I want to setup group in create event and call number of each later (with timer) setupEnemies:function(){ this.asteroidPool = this.add.group(); this.bigAsteroidPool = this.add.group(); this.tiePool = this.add.group(); this.interceptorPool = this.add.group(); this.enemyPool = this.add.group(); this.enemyPool.enableBody = true; this.enemyPool.physicsBodyType = Phaser.Physics.ARCADE; }, addEnemies: function(nbrTie,nbrAsteroid,nbrBigAsteroid,nbrInterceptor) { /*************************************************************************** * Asteroid * ***************************************************************************/ this.asteroidPool.createMultiple(nbrAsteroid, 'asteroid'); this.asteroidPool.createMultiple(nbrAsteroid, 'asteroid2'); this.asteroidPool.createMultiple(nbrAsteroid, 'asteroid3'); this.asteroidPool.forEach(function(child) { child.name = "asteroid" child.animations.add('idle', [0]); child.animations.add('hit', [0, 1, 0, 1], 20, false); child.events.onAnimationComplete.add(function(e) { e.play('idle'); }, this); child.name = "asteroid"; }); /*************************************************************************** * bigAsteroid * ***************************************************************************/ this.bigAsteroidPool.createMultiple(nbrBigAsteroid, 'bigAsteroid'); this.bigAsteroidPool.forEach(function(child) { child.name = "bigAsteroid" child.animations.add('idle', [0]); child.animations.add('hit', [0, 1, 0, 1], 20, false); child.events.onAnimationComplete.add(function(e) { e.play('idle'); }, this); }); /*************************************************************************** * tie * ***************************************************************************/ this.tiePool.createMultiple(nbrTie, 'tie'); this.tiePool.forEach(function(child) { child.name = "tie" child.animations.add('idle', [0, 1, 2, 3], 20, true); child.animations.add('hit', [0, 4, 0, 4], 20, false); //quand c'est finie retour sur idle child.events.onAnimationComplete.add(function(e) { e.play('idle'); }, this); }); /*************************************************************************** * interceptor * ***************************************************************************/ this.interceptorPool.createMultiple(nbrInterceptor, 'interceptor'); this.interceptorPool.forEach(function(child) { child.name = "interceptor"; child.animations.add('idle', [0, 1, 2], 20, true); child.animations.add('hit', [0, 3, 0, 3], 20, false); //quand c'est finie retour sur idle child.events.onAnimationComplete.add(function(e) { e.play('idle'); }, this); }); this.enemyPool.addMultiple(this.asteroidPool); this.enemyPool.addMultiple(this.tiePool); this.enemyPool.addMultiple(this.interceptorPool); this.enemyPool.addMultiple(this.bigAsteroidPool); this.enemyPool.setAll('anchor.x', 0.5); this.enemyPool.setAll('anchor.y', 0.5); this.enemyPool.setAll('outOfBoundsKill', true); this.enemyPool.setAll('checkWorldBounds', true); }, Create: function() { /************************************************************************************************ *Initialize * ************************************************************************************************/ this.setupBackground(); //Initialize Background (A completter) this.setupScaleMode(); //Initialize Sclaling and no blur this.setupEnemiesShot(); this.setupEnemies(); //Initialize Enemies this.setupPlayerShot(); //Initialize Player Shot this.setupExplode(); //Initialize Explosion effets this.setupText(); //Initialize Text Screen this.setupPlayer(); //Initialize Player this.setupScore(); //Initialize text score this.setupLives(); //Initialize text lives this.addEnemies(1,10,2,1); But nothing ... Full source code here : https://gitlab.com/Arknoid/The-lost-jedi/tree/Olivier
  2. thank for all i dont know this Api : https://photonstorm.github.io/phaser-ce/index.html
  3. Thank you very much, it works well with "this". desolate if I ask stupid questions but I started with javascript and phaser, furthermore I find that the documentation lacks concrete example and detail. I will soon have new questions to ask you but for the moment I try to unraveled myself
  4. Hi , I m new user of phaser and i develop a retro shoot them up for the GameOFF jam . i have a problem in my game state : enemyTween: function(){ this.enemyPool.forEachAlive(function(enemy){ enemyTween = this.game.add.tween(enemy) }) TypeError: this.game is undefined [En savoir plus] why i cant acces to game and other event into function of group? (sorry for my bad english)