Jump to content

xzereus

Members
  • Content Count

    28
  • Joined

  • Last visited

  1. @Videlais Nope, no errors. Just doesn't do any blending.
  2. Has nobody else noticed this? I've posted this in a few places and nobody seems to even have any helpful suggestion to offer.
  3. I'm currently using Phaser v2.0.5 and am having issues with blendmodes. I tried posting in the Phaser forum, but I haven't received any replies. Since this is really Pixi.js functionality, I figured I'd drop a line here and see if anybody has a solution. On my desktop, PIXI.blendModes.MULTIPLY works beautifully. In CocoonJS Canvas+, no blending is performed. Is there an alternative way this can be done? Thanks!
  4. The only obvious difference that I have noticed is that collide only seems to be called if the collision is due to velocity being applied to one of the two sprites, while overlap is called simply if the sprites are touching. I noticed this when I had a sprite which was the child of another sprite. If I attempted to test for collision between the child sprite and some other object in the game, it seemed to never collide. If using overlap, it worked. From what I could tell, this was because I was applying the velocity to the parent sprite, not the child sprite.
  5. Edricus, Are you using DOM manipulation or is your game strictly using the canvas? As you probably know, Canvas+ is stripped of just about all DOM capabilities. If you're trying to do something like add a div to the page, Canvas+ will blow up on you. Also, I had to use the following when creating my game: var game = new Phaser.Game(w, h, Phaser.CANVAS, '');This is outlined further in the CocoonJS with Phaser sticky. Have you tried checking the console for errors? I'd highly suggest launching your game with the cocoonjs launcher and then clicking the FPS button in the upper left. This gives
  6. I'm currently generating maps that are about around 3500x3500 pixels. I don't consider this incredibly large, but I start seeing performance issues as I get close to this size. Is there some sort of rendering option I can use to make these largish maps more efficient?
  7. 2) Your sea layer isn't showing up because you need to create the layer in your code: map.createLayer('Sea'); // You're missing thislayer = map.createLayer('Land');3) Your collision isn't working because you only have collision set to a small range of tiles: map.setCollisionBetween(1, 5); // This is what you have, and it will cause collision only with tiles with gid 1 through 5map.setCollisionBetween(1, 153); // This will cause collision with tiles from gid 1 to 153, which is probably what you want. // You can look in the JSON for your map to see what the
  8. I made this change in my copy of the code, and I noticed some false intersections started popping up. I changed it to round to the fourth decimal place and I saw far fewer false collisions (almost unnoticeable), so I'd suggest trying that or perhaps even a little bit better precision. result.x = Math.round( ((((b1 * c2) - (b2 * c1)) / denom)+0.000001)*10000 ) / 10000;result.y = Math.round( ((((a2 * c1) - (a1 * c2)) / denom)+0.000001)*10000 ) / 10000;
  9. I've developed a lighting/shading function that uses an Image with Phaser.blendModes.MULTIPLY. This works great on PC, but with CocoonJS it seems to simply ignore the blendmode. The result is that the entire game simply becomes white/gray where the lighting and shading blending should be. Has anybody else run into this and is there a solution? Thanks.
  10. CtlAltDel, This is what I was referring to. Obviously the actual intersection is at 320, since it's impossible for those two lines to intersect at anything other than y=320 (since one of the lines is essentially y=320). Rounding to 3 decimals should definitely resolve the issues from using floats and horizontal/vertical lines. Thanks.
  11. Phaser.Line.intersects does not work for floats. Take these two lines for example: var line1 = new Phaser.Line(507.39999999999986, 271.60000000000014, 888.3738480697393, 576);var line2 = new Phaser.Line(384, 320, 608, 320);var intersection = Phaser.Line.intersects(line1, line2); // This is nullI did not delve into the Phaser code, but it's pretty apparent the issue has to do with floats. I pulled the intersection function from this post and did some modification to it to work as I expected with floats: function linesIntersect (line1, line2) { var x1 = line1.start.x, y1 = line1.start.y
  12. dhaber, just did a quick check and this works just great! Thanks!
  13. dhaber, Thanks for doing this! I will check when I get home to see if this works. Also, thank you for sharing your tool online as it has already proved to be a great resource!
  14. sleekdigital, You seem to have a pretty good idea of what I'm trying to do based on your reply. I have two sprites. One is the character, and it fills up a 64x64 space. The other is a helmet, and each frame is positioned to fit into the same 64x64 area so that if you render the character and then the helmet, they will be synced. This works great, but I have a need to combine multiple spritesheets into an atlas to conserve space. Using the tool I found so far, the mapping automatically shrinks the helmet down to size, (i.e. deletes the empty space and, instead of each frame being 64x64, each
×
×
  • Create New...