• Content Count

  • Joined

  • Last visited

About kriket

  • Rank
    Advanced Member

Recent Profile Visitors

1260 profile views
  1. @Daniel - your suggestion worked! thanks mate. should suffice for this deadline.
  2. Thanks for the help rich but this addOnce didnt work for me. No errors but same issue. Every second click doesnt work. Regardless of time elapsed.
  3. Thanks for the reply mate. "Just one question: on "create" you are setting the event for space bar only, but inside "tapStop", when the event is finished, you are setting the "tapStop" to any kind of input?" Nice spot. I changed that to this.spacebarPress.onDown.add(this.tapStop, this); but the every other press issue still remains. But your spot fixes other unknown things so thanks for that. I am coding in your suggestion of separate Timer now and hopefully that should fix it. Will reply back soon
  4. Hi guys, Hope you're all well. Been a while as been busy with projects. On a deadline for this eve and nearly finished with testing and found a tiny bug. I cant post the entire game code as its not an open-source project but here's the relevant code. In create Function: create: function() {, this); //mobile this.spacebarPress =; //keyboard this.spacebarPress.onDown.add(this.tapStop, this); } In tapStop function: tapStop: function(e) { console.log(e.keyCode); /*never gives anything on every 2nd key press. But on 1st and 3rd it gives 32 correctly. Nothing on fourth keypress. 32 on fifth. Nothing on 6th. 32 on 7th. NO matter how long I wait between key presses.*/ this.running = false; = false; /*and after all the other code, we allow the player to play (press keystroke) again*/, function(){ = true; this.running = true; = 0x000000;, this); }, this); } The problem is even if I wait 5 or 50 seconds after my first key press, it never registers the second key press. But it ALWAYS registers the third time the key is pressed. Everytime. Mobile tap works great. Its very frustrating. Please advise. Phaser 2.9.2
  5. So I made a big-ish game in phaser hoping that ScaleManager.SHOW_ALL will come to my rescue later on to scale ALL of the game in one line of code. However, I have found that its not as easy (even though it should be). After doing a lot of research below are a few ways I found to scale ALL of the game: 1. One method is scaling every game sprite individually but that means TWEENS will give you headaches (and my game does have a lot of sprites being tweened all over the place). This method is very painful for a big game like mine with many sprites and you have to scale everything by hand. 2. Resizing the canvas. var width=window.innerWidth, height=window.innerHeight, dpr=window.devicePixelRatio || 1; var game =[NAMESPACE].game = new Phaser.Game(1024, 480, Phaser.AUTO, 'gameDiv'); var mainState = { preload : function () { game.scale.scaleMode = Phaser.ScaleManager.RESIZE ; //'px';'px'; }, This sounded promising but I am not able to get the scaling done properly as you can see here at (Pls check source in dev tools) It isnt scaling assets at all. 3. Resizing the game in dev tools scales the entire game properly sometimes (including all tweens too). So I am sure there is a way of doing this. I just dont know what it is. So fellow devs, is there any way to scale a fully-finished game as a whole with a method which is as painless as possible?
  6. Yeah, the funny thing is Scalemanager.SHOW_ALL certainly doesnt do this "Show the entire game display area while maintaining the original aspect ratio." Its frustrating. At worst I was just expecting black bars on some devices. But its ridiculous when the game isnt scaling at all on any device, high dpr or not.
  7. I would really appreciate if Rich or a fellow dev can confirm whether this could be a bug in the framework itself or not?
  8. hmmm... now this is a real headscratcher. I cant release a game that sometimes scales properly, sometimes doesnt.
  9. Like this It didnt go away. I have put Phaser v2.4.4 in there now. Still the issue. Just dont understand why this is happening?
  10. it didnt scale fully on mine and a friends mobile. Also didnt scale properly on emulator either. check screenshot. (PS - this is not resizing the window, resposive design. Its actually reloading the whole page on say emulator or loading on say android mobile browser that shows the issue like in screenshot below)
  11. Its a tiny game code which I have uploaded on so pls use browser dev tools to have a look. As you will notice when u go to dev tools and choose mobile emulation (iphone 4, 5, 6 - landscape orientation only), the screen only shows the top-left corner of the actual game with scroll bars when in fact it should have scaled the game such that all of the game was being shown on the screen since I used this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; (you might have to reload page to notice this issue when in dev tools). I tried the game on real mobile and still the same issue. All relevant scaling code is under boot.js Please help as I cant quite nail the issue having tried several scaling modes.
  12. srry about that. My first time here in babylon forum. I want to spawn the objects in this group at random distance apart from each other, then reposition them to various random positions throughout the level, in an infinite game. So, I want to position, scale, move/translate the objects independent of parent (although i never move the parent itself so maybe normal parenting ought to be enuff. I will try but just wanted to know of there was any other grouping mechanism other than parenting)
  13. I want to group objects together by adding them to a group but I dont want to parent them since I want to move each child separately. In three.js this can be done with var levelGroup_1 = new THREE.Group(); levelGroup_1.children.forEach(function(item) {}; How can this be achived in babylon?