Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


mariogarranz last won the day on December 21 2013

mariogarranz had the most liked content!

About mariogarranz

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location
    Burgos, Spain

Contact Methods

  • Twitter

Recent Profile Visitors

2426 profile views
  1. I could replicate this issue in this CodePen https://codepen.io/mariogarranz/pen/Yzqjboj In this example I create one ParticleEmitterManager and it into a Container that had its scale modified. Then I add 3 ParticleEmitters to this ParticleEmitterManager, all of them with the exact same settings, but everytime a new ParticleEmitter is added, some offset is added to its positioning and scaling, so in the end you can see all 3 of them in different spots and scales. This seems like a bug to me, but maybe I got something wrong? My game uses a container with a scale for the board of th
  2. I'm working with 2.6.2 and drawing some webfonts directly instead of bitmap fonts. I know rendering a vectorial font is an expensive operation and I was thinking of just rendering it to a separate BitmapData and then use the BitmapData as an image instead, but since Phaser 1 performance on text rendering seems to have improved a lot, so I was wondering if these optimizations are maybe already done behind the scenes by Phaser, but didn't find anything on the source code so far. Does anybody know?
  3. I'm trying to create different groups of tweens that I may want to pause and resume based on the group they belong to. For other stuff such as timers, I'm creating my own Phaser.Timer objects, so I can just add Phaser.TimerEvent objects to them, then by just pausing the timers that I want, I can control all the different events easily. However I don't see an easy way to do the same in Phaser. Right now I'm thinking of creating arrays of the tweens myself that I will later loop trough to stop or resume them, but I was wondering if there is any built in functionality that would allow me to
  4. So, recently I created my own tweening functionality to overcome some issues I was having with Phaser's ones and make it fit my needs a little better. While doing so I realized Phaser, and apparently many other engines out there, precalculate the tweened values and store them into an array that's later used to update the object's values instead of calculating the value update on every frame. The way I see it, if calculating all the values for a tween that will be played for one second takes, let's say, 1 ms, I would prefer to have those calculations done in 1/60 ms during the whole secon
  5. So, I'm working on a project that will make use of Kinect, and I would like to translate certain coordinates I'm calculating based on the input recieved from the device into x and y values in the screen. In order to simplify the code, I thought the easiest way to handle it would be to use some pointers whose position would be updated by myself in code, and then rely on Phaser's event detections for overlappiing. Of course I can just use Phaser.Point objects and do the overlapping calculations myself, but I was wondering if there's an easy way to control some Pointers myself, as the InputMan
  6. @chg Thanks a lot for your reply. I've barely worked with 3D environments, so I'll dig into it definitely. Anyways, correct me if I'm wrong, but I understand that the z value you're saying, which depends on x, y and layer index, I guess, must be recalculated when the tile is moving, right? Because that's something I would like to avoid.
  7. @chg Maybe you did and I don't understand it. What I can tell is every tile must be drawn only AFTER: 1 - All tiles in all layers with lower column or row value have been drawn, except in case they intersect (they share a column or row and are close enough to visually overlap). 2 - All tiles in lower layers which intersect with it have been drawn. I don't think it's just about the view vector, but maybe I'm not understanding your suggestion. Take this example I'm attaching. I drew the zIndex corresponding to each tile. Tile 2 and 6 are on the highest layer, yet tile 2 was drawn befo
  8. Thanks everyone for your replies again, the problem is actually more complex than it seems and maybe I didn't express myself very clear, but I'm afraid most answers don't solve it. What @Tom Atom suggests doesn't work in a 3D matrix of tiles, and just adding the depth as another value doesn't work either, because tiles on lower layers must be drawn AFTER tiles on higher layers with lower column or row, but BEFORE tiles on higher layers with higher column or row. That's the generic logic. However, when tiles are overlapping that creates a special case, because even if a tile is on a lower co
  9. Thanks for your replies. I forgot to mention something that's very important to this problem: There is an animation where a tile moves vertically. This means I can't have layers (the example game image has layers) because a tile can animate vertically so it should still be drawn on top of tiles being on higher layers on columns that are to its right. I created a sample image I'm attaching. The yellow tile is the reference one. Red tiles are the ones that should be drawn behind it. Green one is drawn on top of it. As you can see there is a tile on a superior layer that's drawn behind it.
  10. So, I'm trying to achieve a realistic mahjong 3D tile sorting with Phaser. Tiles are sorted on layers (the lower the layer index, the higher), and have a column and a row value as well. Every tile occupies 2 rows and 2 columns, so they can overlap horizontally and vertically with 2 tiles at the same time. The thing is I can't find a sorting algorithm that works in all situations. I came up with this messy function that works in almost all cases: if(a.row === b.row - 1 || a.row === b.row + 1){ return a.layer.index < b.layer.index ? 1 : -1; } else if(a.row > b.row){
  11. I also opened a topic about the exact same thing with your exact same conclusions: http://www.html5gamedevs.com/topic/18183-tweenmanagerframebased-not-working-as-expected/
  12. After upgrading some games to Phaser 2.4.3 we noticed some animations were suddenly playing really fast or really slow (depending on devices). Some bug fixes regarding this were added on 2.4.4, but the problem was still there. This bug seemed to affect only Tween animations so I checked the docs and found this value: TweenManager.frameBased: According to this, the default behavior should be the same as in previous versions of Phaser, however it seemed to be the opposite, since the animation duration was now being dependant on the speed of the device. I tried setting frameBased to true
  13. Thanks for your reply alagatar. My main question is how do you detect the actual window size, since it seems to be returning a value that does include the part of the window covered by the bottom bar. I get from your message that if you add some delay after the resize this value is correct?
  14. I'm developing a card game that is played in landscape orientation. In iPhone the game goes full screen as soon as it is in landscape, but because cards to be played are positioned at the bottom of the screen, pressing on them triggers the appearance of the navigation top and bottom bars again. It is really necessary to have input in that area of the screen, so changing it is not an option. Also, when these bars appear game doesn't rescale properly. I assume Safari is sending a wrong window.innerHeight value, because part of the game is still displayed behind the bottom bar. Is there any way
  15. Android stock browser has a bug that causes the RAF to freeze when it loses focus, even it the tab gains focus again. I created a workaround for this, forcing raf.stop(); and raf.start(); everytime the tab gains focus. This workaround worked fine until I updated some games to version 2.3, then it crashes games with the following error: Uncaught TypeError: Property 'cancelAnimationFrame' of object [object DOMWindow] is not a functionI checked the RequestAnimationFrame update history, and nothing has changed there in version 2.3, but the same game doesn't have this bug with older versions. A
  • Create New...