Search the Community
Showing results for tags 'phaserio'.
-
updateTimer:function(){ timerSeconds ++; secondsLeft = gameSeconds - timerSeconds; // Display in min:seconds displayMin = Math.floor(secondsLeft/60) % 60; displaySec = Math.floor(secondsLeft) % 60; if (displayMin < 10) { displayMin = "0" + displayMin; } if (displaySec < 10){ displaySec = "0" + displaySec; } //myTime.setText("time now" + this.timerSeconds); // change the time text myTime.setText(displayMin + ":" + displaySec); // change the time text if (displayMin == 0 && displaySec == 0){ this.game.state.start('Loser'); } Hello there. I am new to phaser. Here is a snip of code from a simple game that I am trying to build. I tried to set up a timer when counting down to zero, the game then will display a lose screen. My question is how can I access the reaming time in this timer on a another different JS file. All the variables are global.Which format should I use? I tried this way but it did not work. I just get stuck. var displayTime = this.myTime; var disStyle = this.add.text(this.world.centerX-80, this.world.height-220, displayTime, disStyle);
-
- phaser
- javascript
-
(and 1 more)
Tagged with:
-
So, I'm developing my frist game right now, and after having lots of troubles choosing the best physics system, I think I'm going with p2, since I need circle collisions. I want to make a sprite, rotating a point, like an orbit, the problem is that when I set the anchor of that sprite, it doesnt rotate the collision body associated to it, it only rotates the image. As you can see in the image, the phaser logo rotates, but the collision body (little debug circle), does not displace itself to the center of the sprite.this.game.physics.p2.enable(this.sprite, true);this.sprite.body.setCircle(16);this.sprite.body.velocity.y = 100;this.sprite.body.angularVelocity = +5;this.sprite.anchor.setTo(-0.3,0.5)this.sprite.body.setZeroDamping();
-
Hi, I wanted to use phaser in meteor following this guide http://www.html5gamedevs.com/topic/4886-how-to-use-phaser-with-meteor/ but I have a problem. when I create a meteor project and then run "meteor add phaserio" I get this: mrt add phaserio✓ phaserio tag: https://github.com/t...aser.git#v0.0.1 Done installing smart packages Stand back while Meteorite does its thing Done installing smart packages Ok, everything's ready. Here comes Meteor! => Errors while scanning packages: While building package `phaserio`:error: File not found: phaser/build/phaser.js /usr/lib/node_modules/meteorite/lib/command.js:41 throw "Command exited with " + code + "/" + signal; ^Command exited with 1/null can anybody help me, please?