• Content Count

  • Joined

  • Last visited

  • Days Won


espace last won the day on June 20

espace had the most liked content!

About espace

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. Hi, Could you put a code example ? It help me a lot.... Thanks
  2. Cool concept but the graphics could be better, more attractive... The speed could be also faster. Have a good day.
  3. hi, Assuming i have this scene config who start in this order : # boot # preload # title # main My "main" scene require a lot of times to load +/- 2seconds So what i would like is to make this : # boot # preload # title => preload #main during this state # main => when i go to this state, it take less time because the scene is preloading during the "title" scene Is it possible ? I don't see anything in phaser examples...thanks
  4. Hi, I have two sprites (button_move and button_fire) with two touchs events. I want to have multitouch enabled : when i press on the same time on the two buttons, normaly the alpha of the two buttons is 0.5. But it’s not working. I have follow the docs, especially this : 1 And i made a jsfiddle about it : 2 the full code is : var config = { type: Phaser.AUTO, width: 480, height: 640, parent: 'phaser-example', input :{ activePointers:2, }, scene: { create: create, update: update } }; var game = new Phaser.Game(config); var button_move; var button_fire; var flag_move=false; var flag_fire=false; function create () { button_move=this.add.sprite(100,100,'image').setInteractive(); button_move.on('pointerdown',function(pointer1){ flag_move=true }) button_fire=this.add.sprite(300,100,'image').setInteractive(); button_fire.on('pointerdown',function(pointer2){ flag_fire=true }) } function update() { if (flag_move){ button_move.alpha=.5 } if (flag_fire){ button_fire.alpha=.5 } } Thanks for your help.
  5. hi, curiosly when i use scene with phaser 3 like phaser 2 i see my previous scene behind my active scene... How do you do to have the same behaviour than phaser 2 : not see the previous scene in the active scene ? console.clear(); var config = { type: Phaser.AUTO, width: 1480, height: 2270, backgroundColor: '#0d1018', physics: { default: "arcade", arcade: { gravity: { y: 200 } } }, callbacks: { postBoot: function (game) { // In v3.15, you have to override Phaser's default styles = '100%'; = '100%'; } }, }; var state = {}; var o = {}; state.boot = { preload: function () { this.load.image("Enemy", "img/ball_enemy.png"); }, create: function () { o.enemy = this.add.sprite(740, 1135, 'Enemy'); game.scene.start('main'); }, }; state.main = { preload: function () { this.load.image("Player", "img/ball_enemy.png"); }, create: function () { //here i see o.enemy in my state.main ??? o.player = this.add.sprite(140, 835, 'Player'); }, }; var game = new Phaser.Game(config); game.scene.add('boot', state.boot, true); game.scene.add('main', state.main, true); game.scene.start('boot');
  6. hi, on the example it works : but on real it doesn't works .....? Phaser CE 2.12.0 - on firefox and on android var s={}; var f={} f.create_sounds=()=>{"music");;; } f.mute_sounds=()=>{; } f.create_sounds(); //ok i hear the music setTimeout(()=>{f.mute_sounds()}, 1000);//not works What is wrong ?
  7. hi again me ! thanks for your previous solution. I have another request that looks a lot like the first but I can not solve it. I would like to have random object in x first. Then i would like to move them and when they reach -400 in x (left outside the screen), their position is set to 2000 (right outside the screen). The problem is that i see the "restart effect". It's difficult to me to explain... look at this snippet, it's easier to understand function create() { var sprite=[] var tw=[]; for (var i = 0; i < 5; i++) { sprite[i]=game.add.sprite(Math.random()*800, i*100, 'phaser'); } var move=()=>{ for (var i = 0; i < 5; i++) { tw[i]=game.add.tween(sprite[i]).to({x:-400},1000,Phaser.Easing.Linear.none,true,0,-1) tw[i].onLoop.add(function(){ //normally i must not see the sprite at the restart because it's outside the screen ? this.x=2000 this.y=Math.random()*800 },sprite[i]) } } move(); }
  8. hi, I would like to make a perpetual movement with my sprites to give the illusion of movement. In the snippet below , if the sprite are stars you will understand that for example a rocket move trough. The problem here is : on each movement i would like at the oncomplete function move the sprite randomely on Y but with repetition on -1 it don't works. How could i do to achieve that properly ? Thanks function create() { var sprite=[] var tw=[]; for (var i = 0; i < 5; i++) { sprite[i]=game.add.sprite(400+i*10, i*100, 'phaser'); } var move=()=>{ for (var i = 0; i < sprite.length; i++) { //-1 to have perpetual movement but the problem is that onComplete don't works tw[i]=game.add.tween(sprite[i]).to({x:-400},1000,Phaser.Easing.Linear.none,true,i*200) tw[i].onComplete.add(()=>{ //return to right to give the illusion of perpetual movement sprite[i].x=400; // move randomely on y sprite[i].y=Math.random(0,800); },this) } } move(); }
  9. oh my god 🤔 thanks have a good new year
  10. Hi, I have made this sandbox to illustrate that don't works. What is my mistake ? Thanks. //part of snippet function create() { var sprite=[] for (var i = 0; i < 40; i++) { sprite[i]=game.add.sprite(i*10, 0, 'phaser'); sprite.inputEnabled = true; sprite[i].events.onInputDown.add(function(){console.log("clicked")}); } }
  11. Sorry but i don't understand. It 's not possible with combo ?