Tom Atom

  • Content count

  • Joined

  • Last visited

  • Days Won


Tom Atom last won the day on August 7 2016

Tom Atom had the most liked content!


About Tom Atom

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender

Recent Profile Visitors

2,932 profile views
  1. Phaser on Android, runs really slow (Cordova / Phone Gap)

    Hi, I am pretty sure, that "game.debug.text" will be first thing, that will slow your game down a lot. Second thing may be using non-sprite font for text. I also believe, that your game (example) runs very slowly even if not wrapped with Cordova (if run directly in mobile browser). From my experience also calling console.log often slows game a lot, so be sure to comment out these outputs in production code.
  2. How to use the Phaser in Visual Studio 2017

    Could you put screenshot of your project hierarchy here? You can also try to put Phaser reference to the top of your file - something like this: /// <reference path="../lib/phaser.d.ts" /> For me, I do not have to do it - VS finds all *.d.ts files in lib folder, but it may help to explicitely set reference to it.
  3. Physics bug

    - in original example, you are using setBoundsToWorld incorrectly. This is from source doc: /** * Sets the bounds of the Physics world to match the Game.World dimensions. * You can optionally set which 'walls' to create: left, right, top or bottom. * * @method Phaser.Physics#setBoundsToWorld * @param {boolean} [left=true] - If true will create the left bounds wall. * @param {boolean} [right=true] - If true will create the right bounds wall. * @param {boolean} [top=true] - If true will create the top bounds wall. * @param {boolean} [bottom=true] - If true will create the bottom bounds wall. * @param {number} [collisionCategory=1] - The category (bitmask) to use for the walls. * @param {number} [collisionMask=0xFFFFFFFF] - The mask (bitmask) to use for the walls. */ setBoundsToWorld: function (left, right, top, bottom, collisionCategory, collisionMask) { ... it is again about category / mask. But you passed "false" as 5th parameter instead of category. See default values in code above. - for ship1 you are setting category to 1 and leaving collisionMask to default (which is 0xFFFF) - it says: "hey, I am from category 1 and I am colliding with EVERY other category". Which means: collide with bounds (category 1), other player-like ships (category 1) and both enemy ships (category 2) and everything else in physics world and any other category that may appear later... - for ship2 and ship3, you are setting category to 2 and mask to 3 (= 1+ 2). It says: "I am from cat. 2 and I am collidiong with category 2 and category 1) - ships will now collide with bounds (cat. 1), player ship (cat 1) and with each other (cat 2). It will not collide with asteroids, planets, etc. if they are category 4 or 8 or 16 or ...
  4. How to use the Phaser in Visual Studio 2017

    Hi, still on VS 2015, but friend of mine had the same problem in VS 2017 as you have - missing tamplate. It looks this template is not in VS 2017 anymore... ...but, some guy created it. Try it here and let others know, if it worked: For me, in VS 2015, worked always to put Phaset stuff into "lib" folder.
  5. Physics bug

    First, sorry, this description was confusing: ship1.body.setCollisionMask(4); // - will collide only with ship2 (category 2) should be: ship1.body.setCollisionMask(4); // - will collide only with ship3 (category 4) What you are building in code is kind of collision grid like this: Take row, assign category to your object - like category 1 for ship1 and determine what all other categories you want it collide with (columns for ship2 and ship3). Then set collisionMask to sum.
  6. Stop and restart a tween/recycling tweens

    Hi, long time ago I solved reusing stopped tweens - here is detailed topic about it:
  7. Physics bug

    Hi, try to combine setCollisionCategory with setCollisionMask. By default mask is 0xFFFF - collide with all other groups. Mask has to be set on both bodies (therefore setCollisionMask(1) on both ships). This works: function create() { game.physics.startSystem(Phaser.Physics.BOX2D); game.stage.backgroundColor = '#2d2d2d'; // User-controlled ship ship1 = game.add.sprite(250, 300, 'ship'); game.physics.box2d.enable(ship1); ship1.body.setCircle(14); ship1.body.setCollisionCategory(1); //ship1.body.setCollisionMask(2 + 4); // - will collide with ship2 (category 2) and ship3 (category 4) ship1.body.setCollisionMask(4); // - will collide only with ship2 (category 2) // Ship with collision category 2 (triggers contact callback only once) ship2 = game.add.sprite(200, 200, 'ship'); game.physics.box2d.enable(ship2); ship2.body.setCircle(14); ship2.body.setCollisionCategory(2); ship2.body.setCollisionMask(1); // Ship with collision category 1 *default, i guess* (triggers contact callback TWICE) ship3 = game.add.sprite(300, 200, 'ship'); game.physics.box2d.enable(ship3); ship3.body.setCircle(14); ship3.body.setCollisionCategory(4); ship3.body.setCollisionMask(1); game.physics.box2d.setBoundsToWorld(true, true, true, true, false); ship1.body.setCategoryContactCallback(1, function(b1,b2,f1,f2,begin){ if (begin){ total += 1; hitText.text = 'Contact callback called '+total+' times'; console.log("CONTACT: ", b2) } }, this); cursors = game.input.keyboard.createCursorKeys(); game.add.text(5, 5, 'Use arrow keys to move.', { fill: '#ffffff', font: '14pt Arial' }); total = 0; hitText = game.add.text(5, 30, 'Contact callback called 0 times', { fill: '#ffffff', font: '14pt Arial' }); }
  8. how to access my assets in jsdeliver

    @samme - thanks for explanation & help! It works for me now. I tried "anonymous" before without luck, but it was messed with second problem - sever is returning URL link without protokol (like // ....) and if I converted it into absolute URL, it added http (because my dev server is http). But server is returning image only if asked for with https. If I ask for it with correct protokol, then everything works.
  9. how to access my assets in jsdeliver

    @samme thanks for answer, but are you sure? With Phaser none of "" or "anonymous" work - in both cases texture cannot be used in WebGL. That linked tutorial is using "" and it works (it also works with setting to "anonymous"). In fact, this is image I am trying to load and use: "" - it is sponsor logo. It can load & use it only if used that way I described above (no matter if I set it to "" or "anonymous" , but if I omit this line: img.crossOrigin = ""; I get this error ... which is exactly what that tutorial was about (how to use CORS texture in WebGL) Now, I am struggling with http x https. If URL for image is https it works, if it is http, then it does not work. Looks like sponsors emulator is returning http, but luckily production looks to return https (I debugged one PIXI game there).
  10. how to access my assets in jsdeliver

    Hi, Phaser way: let imageUrl = ""; this.load.crossOrigin = ""; this.load.image("LOGO", imageUrl); did not work for me too - all I got was "SecurityError: The operation is insecure.". But then I found this tutorial: and this worked for me: var cache = this.cache; var img = new Image(); img.addEventListener('load', function () { console.log("***** LOADED ***** "); cache.addImage("LOGO", imageUrl, img); }); img.crossOrigin = ""; img.src = imageUrl; Now you can create your sprite like this: var logo =, 0, "LOGO");
  11. [Phaser] Pirates! - the match 3

    @Spyro23 didn't know this trick. It sounds interesting - thanks!
  12. [Phaser] Pirates! - the match 3

    - Famobi does not request landscape mode. They requirements just say: "In best case, your game is playable in portrait and landscape and has a responsive UI which adapts to the orientation." I read it as advantage if game can be played in both orientations, but not requirement. Beside this they do not state prefered orientation. My experience is, that if publisher is also running games on mobile devices, they prefer portrait to landscape. In past we already worked with Famobi - one landscape (only) game and one portrait (only game) and some exclusive work for them on portrait games, - there should be no bars on screen (just tested it on iPad and Android device and it looks OK) - also color of bar you are speaking about is strange (grey). If there was any bar, it would be either filled with blue waves pattern or with solid black. Game scales well to any resolution. If between iPad and iPhone aspect ratios (two extremes) then there is no stretching. If beyond extremes then stretching comes into play.
  13. [Phaser] Pirates! - the match 3

    @Mike018 - all older devices that use Android Stock browser and some mid old devices. My ASUS Memo pad is mid level device and it runs smooth, but sometimes it had some glitches - not serious (so, I personally take it as border between performance levels). For Windows Phone, Lumia 532 is device I test on and it can run HTML5 games, but if you have more than 8-10 draw calls it slows a lot. One of our older games used Box2D plugin and it was killer for it (we had to remove lot of effects and decrease physics update to 30/sec) while it still could easily handle native version with 50/sec and all effects.
  14. [Phaser] Pirates! - the match 3

    Thanks! Which criteria we do not meet? We did all they needed
  15. After long development time we finally released our game "Pirates! - the match 3". It is full blown match 3 game with many levels in two worlds. Players are given various tasks like dig treasures, fight enemies, open chests, cut through jungle and others. It also features many gem combinations - not only you can create classic row/column destroyer and bomb, but you can try to combine these to create much stronger effects. Game has great music, lot of animations and speaking parrot! You can play it here at Famobi: Or you can get iOS version at iTunes: (iOS version is Cordova wrap) For Android we rewrote whole game into Unity - it is identical: Why we did so? There is limited amount of iOS devices, but all have today enough performance to run game smooth. On Android, there is wide range of devices and some are really low level. Unity version allows us to bring smooth experience even to those devices (and the same is for low end Windows Phone devices) And of course, we are still licensing it! If you are sponsor and you like it, do not hesitate to contact us.