Batzi

Members
  • Content Count

    168
  • Joined

  • Last visited

About Batzi

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  • Location
    Outer Heaven
  • Interests
    Metal Gear

Recent Profile Visitors

1,271 profile views
  1. Batzi

    LocalStorage + Cocoon WebView+

    Hello guys, I'm having issues with the iOS version of my app. LocalStorage is not working and I am not sure if it's a Cocoon problem or an iOS problem given it works great on Android. It seems that the data being stored is cleared after I quit the app. My app (Phaser) is packaged using Cocoon (Webview+). Any of you having localStorage problems on iOS? Are you using something other than Cocoon to package the app? Thank you
  2. Batzi

    Text overflow

    Check this out: http://phaser.io/examples/v2/text/word-wrap
  3. As you probably know, when you are scaling the world in Phaser, the center point by default is (0,0). Been trying to zoom to a mouse pointer's coordinates but failed miserably with no luck. Anyone here managed to get this work?
  4. Batzi

    Scaling my entire game to fit window size?

    var map = game.add.sprite(x,y,mapKey); var player1 = game.add.sprite(x,y,Player1Key); var player2 = game.add.sprite(x,y,Player2Key); var sprites = game.add.group(); sprites.add(map); sprites.add(player1); sprites.add(player2); sprites.scale.set(0.8); The above code will scale down all the sprites to 80%. Not sure if that's what you want. EDIT: Just noticed you're asking for scaling to window screen. The code I wrote is for zoom. Thought you were talking about that kind of scale.
  5. Batzi

    Scaling my entire game to fit window size?

    Why don't you put your sprites in a group and scale that group?
  6. Batzi

    [Phaser] Vampyr: World at stake

    For mobile you can scale-in the sprite onInputDown and when you release it, it tweens back to normal scale. Anything to make it feel like a button is appreciated for user experience.
  7. Batzi

    [Phaser] Vampyr: World at stake

    Very beautiful game man! Love the artwork! I am at work now so don't have much time to test it out but one thing you could add that I find very important is when you hover over clickable objects just change the cursor to a hand so that we know it's clickable. var sprite; sprite.inputEnabled = true; sprite.input.useHandCursor = true;
  8. Batzi

    How to scroll a background smoothly

    Did you try tweening it?
  9. Batzi

    audio: XMLHttpRequest cannot load file

    are you doing this via jsFiddle?
  10. Batzi

    Problem with camera and moveToXy

    I'm sorry I was in a meeting. Here's what I'd suggest you try. Create 2 sprites. 1 is moved using the moveToXY() function and the other moves to the mouse pointer (where you click). Use camera.follow() on the latter. When you use moveToXY(), you can set the time you want your sprite to take to reach its destination. Something like this game.physics.arcade.moveToXY(sprite,x,y,velocity,time in ms); Now usually the sprite doesn't stop unless you tell it to so assuming you do something like this game.physics.arcade.moveToXY(sprite,200,200,20,2000); You're basically telling the sprite to move to (200,200) at a velocity of 20 within 2 seconds. Just do a timeout that sets the sprite's velocity to 0 in order to stop the sprite from moving setTimeout(function(){ sprite.body.velocity.x=0; sprite.body.velocity.y=0; },2000); The sprite will stop after 2 secs giving it time to reach its target. So far nothing is in the update(). Second sprite (ex: sprite2) sprite2 = game.add.sprite(200,500,'sprite'); game.physics.arcade.enable(sprite2); game.camera.follow(sprite2); Now on every mouse click, make it move to mouse pointer (x,y) and use the same method to stop the sprite from moving more than it should and see if the problem is still there. Try to avoid putting things in the update() if you can do them in the create().
  11. Batzi

    Problem with camera and moveToXy

    You should know that the update() executes a frame per second meaning that it is running game.camera.x++ every frame per second which is causing your problem. Keep that in mind. Let me do a sandbox for you and we can see if that sorts your problem. brb. I will load a sprite that is moved using moveToXY() and another that I will move using the mouse pointer and use a game.follow() on him
  12. Batzi

    Loading bar issue for large audio file

    what do you mean it halts while it loads the large mp3 file? You mean it keeps loading in the background while the bar has finished loading?
  13. Batzi

    Problem with camera and moveToXy

    are you placing this.game.camera.x++; under a condition?
  14. Batzi

    Problem with camera and moveToXy

    If you remove camera.follow() and make that sprite move like the other sprites, what happens? Do you still have the problem?
  15. Batzi

    Problem with camera and moveToXy

    what about the code for the other sprite that uses camera.follow() can you plz post that? And can you please wrap your code using the code tag in the editor?