Jump to content

Abhishek Singhal

  • Content Count

  • Joined

  • Last visited

About Abhishek Singhal

  • Rank
  • Birthday 01/13/1988

Profile Information

  • Gender
  • Location

Contact Methods

  • Skype

Recent Profile Visitors

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

  1. try this : var frames = Phaser.Animation.generateFrameNames("ocean-", 0, 28, ".png");
  2. can't figure out any issue in the above code section. can you add some reference or link , to demo the issue you are facing ?
  3. I am not sure , if I understood your problem clearly. in place of using window.availheight and window.availwidth, we may check for window.innerHeight and window.innerWidth. these properties would provide the updated values if browser is resized.
  4. What i get from the documentation is that : onFire is a signal being dispatched. In Phaser we handle signal like this, weapon.onFire.add(functionName); function functionName(bullet, weapon){ // here bullet is the reference of the image used for bullet and weapon holds the reference to object that triggered onFire event. console.log(bullet, weapon); }
  5. @espace3d, can you share the piece of code that is being problematic ?
  6. Hi Andromedus, I am new to Phaser not very sure on this. Going by the name, maybe we could check for "game.input.mousePointer", It should be undefined if a mouse cursor is not available considering the device to be a touch enabled device.
  7. set Antialiasing "true" while creating game object : var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', this, transparent, antialias); also, make sure that the elements are pixel aligned after resizing. i.e. every element should have its co-ordinates as a whole number and not in fractions. sometimes when resized or scaled by some factor, child objects could deviate from its coordinates so that an element might get placed at {x:110.114 , y:90.013 }. but it should be realigned to : {x:110, y:90}. This should solve the issue.
  8. Maybe you should use native JS setTimeout like this : var wizard = some instantiation; setTimeout(function(){ // CLEANUP CODE GOES HERE. }.bind(this), 1000); the function will execute only once.
  9. The game will always be fullscreen on mobile devices, but user can resize it on desktop. So, the game will resize accordingly if the browser window is resized on desktop.
  10. you may check for window.screen.availHeight , window.screen.height and window.innerHeight the differences in these factors can be used to ensure if the address bar is open. We could have also used window.outerHeight, But on apple devices its value is always 0. So, We should exclude window.outerHeight.
  11. Already tried both the scale mode RESIZE and NO_SCALE, hit no luck with that also. Even with NO_SCALE and RESIZE mode function call to setGameSize actually resizes the canvas and the game object. The only thing that seems to work is : initializing the game with huge canvas 2200X1280, bigger then my game size and removing the call to setGameSize and fit the game to window dimensions by resizing game elements individually. Using this approach, I am able to remove the flickering issue, but m not sure if this is a good practice to keep such a huge game size because the world center in this
  12. Yes, you should have a look at "Phaser.Signal" this can be used to trigger events and you may also call signal.fireOnce , to do the exact thing only once.
  13. Would this serve the purpose ?? var goalLineCrossed = false; if (player.x > goalline.x) { if(!goalLineCrossed){ goalLineCrossed = true; console.log('crossed') } else{ // Do something else } // Do continuous task here }
  14. Hi Faizy, I believe you are running a check for the condition withing the update function or any other function that is being called continuously. The solution in this case could be to create a flag or a variable like goalLineCrossed and updating it as follows : var goalLineCrossed = false; if ((player.x > goalline.x) && !goalLineCrossed) { goalLineCrossed = true; console.log('crossed') }
  15. I am facing the same issue with a game currently. I tried to call in sequence game.scale.startFullScreen(true); game.scale.stopFullScreen(); I've called "stopFullScreen" with around 50ms delay. The hack seems to work for me. 1 more suggestion if you are providing x,y coordinates using some algorithm try to keep them in integer values and not as decimal values.
  • Create New...