Akshar Patel

  • Content Count

  • Joined

  • Last visited

About Akshar Patel

  • Rank
  • Birthday 09/10/1988

Profile Information

  • Gender

Contact Methods

  • Twitter

Recent Profile Visitors

799 profile views
  1. Do it this way. var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });function preload() {}function create() { //your graphics creation code.}function update() {}
  2. Use only overlap. Don't use both overlap and collide.
  3. Have a look at the documentation and examples of TileSprite. It'll help you get started to what you want to achieve.
  4. Add a custom property to identify the sprites and have an array that will store the identities of overlaps. As and when the overlap happens, push the identifying property to the array. Now you can check the sequence of the overlaps.
  5. I noticed that with the 2.3 release, the health property and damage method have been moved to a separate Health Component. The problem is that I have no idea how to use it. Now, I know that it can easily be implemented manually, but I don't want to write code for things that are already implemented. Can anyone help me understand how components work in phaser?
  6. I personally use this way when extending a sprite function Player(x, y, options){ Phaser.Sprite.call(this, game, x, y); game.add.existing(this);}This way, there is no need to call game.add.existing individually on all the extended sprites. In your second method, since the sprite has not been added to the stage, it just sits there doing nothing.
  7. Please refer to this tutorial on Game Mechanic Explorer : http://gamemechanicexplorer.com/#bullets-5
  8. Try this this.scale.pageAlignVertically = true; // In your Boot or similar filethis.bg_map_layer.resizeWorld(); //after you create a new map layer
  9. Hi worsty... Maybe, it is a problem of old webview. When you pack an app using cordova, the app uses the native webview on the respective Android device. The webview on Android 4.1 is old. Try to package you app using crosswalk. It bundles the updated webview with the app itself. Try it out and reply if it worked.
  10. Also, you can do the following (If you only want to kill the sprite and not destroy it) : groupName.forEach(function(member) { member.kill();});
  11. In Android there is a Webview component which allows you to integrate a browser into your app. I think iOS also has something similar. (Googling, I found it's UIWebView Component).
  12. Typescript is slowly gaining grounds. The two best things about it are future proof code and type safety. Since I started learning phaser, I choose to code in Typescript. I have a Github repository where in I've stored all the code of the tutorials which I undertook to learn Phaser. The tutorials were in plain Javascript which I converted into typescript. https://github.com/aksharpatel47/Phaser-Typescript-Tutorials-Code While I know converting javascript to typescript is not that hard, I hope this repo helps the community one way or the other. Also, it's just raw code at the moment. Is there anything else that can be done to make it more helpful? Please do let me know.
  13. Cordova, CocoonJS, Crosswalk.
  14. Thanks @clark and @jpdev. @clark : It is a nice workflow. I'll remember it for the next time I use Visual Studio for Typescript. @jpdev : I too am using Webstorm 10. And you were right. I was doing a very expensive operation in the update method that I didn't do in the javascript version. Thanks for pointing in the right direction.
  15. @jpdev : Thanks for replying. I'll try to post the code as soon as possible. Meanwhile, can you tell me how do you compile your typescript during development phase : in a single file or as multiple files?