• Content Count

  • Joined

  • Last visited

  1. Thank you qestion.autoRound = true don't work as I wanted but question.pivot.x = Math.round(question.width * 0.5); work perfectly. I just added statement for vertical alignement using height and everything work.
  2. Hello I use Phaser.text in my game. I want to align the text so I use text.anchor.set(0.5). On my small text it work fine but on my biggest text it make it blurry I read on forum to use text.anchor.x = Math.round(text.width * 0.5); but it only make my text disappear Is there an other way to do or maybe I'm doing it wrong question = game.add.text(310,180,questions[nbalea], {fontSize: '32px', fill: '#000' }); question.anchor.set(0.5); question.anchor.x = Math.round(question.width * 0.5); Thank you
  3. I found, I just had to set object name on creation then with a switch case I can do what I want
  4. I figured out myself I just added a variable in the if statement, this variable is set to 1 then the function inside the if set it to 0 and I added a eventListener onUp that change this var to 1 and it worked
  5. Well I found something interesting, if I use an alert just like that : if (cursors.up.isDown && points > 0) { alert(); bouteille.frame = bouteille.frame +1; } It make exactly what I want, a break between two pressed key. The problem is there is a popup and you should close it before continuing the game. So is there any way to make an alert without popup or just a kind of break or sleep in program ?
  6. Hello I'm using an overlap between player (joueur) and bottles (bouteilles). bottles is a group of 4 bottle and I want to know which bottle I'm interacting with in the function called by the overlap game.physics.arcade.overlap(joueur,bouteilles,interragitb,null,this); then the function function interragitb(joueur,bouteille){ cursors = game.input.keyboard.createCursorKeys(); if (cursors.up.isDown && points > 0) { bouteille.frame = bouteille.frame +1; point(0); } } and I want to increment a variable to know how many times I interracted with a spécific bottle how should I do ? Is there any way to get index in the group or var name ? Thank you
  7. Please can you help me I don't know how to do it and I'm kind of stuck without it resolve.
  8. Hello I have a problem. I want my player when he is in front of a bottle and when he interract with it (up arrow key) the frame of the bottle change. The problem is I use an overlap between player and bottle I use : if (cursors.up.isDown) { bouteille.frame = bouteille.frame +1; } but when in game I press the up key it change all frame in one ms. How can I set a timer or something to say I pressed one time I need to release key and do it only after repressed Thanks