DavidPesta

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. I am using the last official release 2.6.2. Given the following code, which can be found on the following jsbin: http://jsbin.com/lazefep/1/edit?js,output var MainState={ create: function(){ var circleGraphic = new Phaser.Graphics(); circleGraphic.beginFill(0xFFBBBB); circleGraphic.drawCircle(0, 0, 100); circleGraphic.endFill(); circleSprite = this.game.add.sprite(0, 0, circleGraphic.generateTexture()); //circleSprite.anchor.setTo(0.5); // (Try barSprite anchor below first.) Ugh, this doesn't fix it... var barGraphic = new Phaser.Graphics(); barGraphic.beginFill(0x88FF88); barGraphic.lineTo(250, 0); barGraphic.lineTo(250, 10); barGraphic.lineTo(0, 10); barGraphic.lineTo(0, 0); barGraphic.endFill(); var barSprite = this.game.add.sprite(this.game.world.width/2, this.game.world.height/2, barGraphic.generateTexture()); barSprite.addChild(circleSprite); //barSprite.anchor.setTo(0.5); // Why doesn't the child adjust to the anchor with the parent? } }; var game = new Phaser.Game(640, 480, Phaser.CANVAS, 'phaser-example', MainState); As long as the two lines remain commented out, what is rendered makes perfect sense: 1. A circleSprite is created and registered to position 0,0 of the parent sprite that it is later attached to. 2. A barSprite is created and its top left is added to the center of the world. 3. The circleSprite is added as a child to barSprite, and consequently, the top left of that child sprite is found at 0,0 of the parent sprite. As a result, you can see a sort of sideways "b" graphically depicted. Now, my (reasonable?) assumption is that the parent barSprite can be treated like any ordinary sprite as a composite whole. Anything I do to the parent sprite should automatically cause cascaded adjustments to the children so that the parent sprite would behave as it would if it were just an individual sprite on its own without any children behavior artifacts. However, if you notice, uncomment the line that sets the barSprite anchor, and the child does not follow. The child remains in place as if the anchor to the parent is not applied. To make matters worse, I have no easy recourse. I cannot recover the intended sideways "b" by uncommenting the circleSprite anchor. Is this a bug with anchor? Or is this intended behavior for some reason? What are my best options? (I am also curious if this behavior will exist in v3.) Also, please make me aware if you happen to see a violation of good/best practices!
  2. Good news for everyone who used to be worried about MP3 patents. The last important patent expired on April 16, 2017. As a result, the company that owned and enforced the MP3 as intellectual property terminated their licensing program on April 23, 2017: https://www.iis.fraunhofer.de/en/ff/amm/prod/audiocodec/audiocodecs/mp3.html This means you no longer need to worry about MP3 licensing issues. Because of this, Wikimedia now started to host MP3 files on their own websites: https://blog.wikimedia.org/2017/12/04/wikimedia-mp3-support/ Additionally, "Fedora received the permission to ship MP3 encoding from Red Hat Legal.": https://opensourceforu.com/2017/05/fedora-linux-add-native-mp3-support/ With Wikimedia and FOSS able to use MP3s unrestricted, it is now safe for the rest of us, and soon MP3 will become supported by devices and browsers that were once hindered by these patents and we will no longer need to accompany our MP3 files with a redundant version in OGG format. Here is another excellent article for further reading: https://www.vox.com/culture/2017/5/29/15653564/the-mp3-not-dead-license-expires-free
  3. Good news for everyone who used to be worried about MP3 patents. The last important patent expired on April 16, 2017. As a result, the company that owned and enforced the MP3 as intellectual property terminated their licensing program on April 23, 2017: https://www.iis.fraunhofer.de/en/ff/amm/prod/audiocodec/audiocodecs/mp3.html This means you no longer need to worry about MP3 licensing issues. Because of this, Wikimedia now started to host MP3 files on their own websites: https://blog.wikimedia.org/2017/12/04/wikimedia-mp3-support/ Additionally, "Fedora received the permission to ship MP3 encoding from Red Hat Legal.": https://opensourceforu.com/2017/05/fedora-linux-add-native-mp3-support/ With Wikimedia and FOSS able to use MP3s unrestricted, it is now safe for the rest of us, and soon MP3 will become supported by devices and browsers that were once hindered by these patents and we will no longer need to accompany our MP3 files with a redundant version in OGG format. Here is another excellent article for further reading: https://www.vox.com/culture/2017/5/29/15653564/the-mp3-not-dead-license-expires-free
  4. ReactJS is an open source Facebook technology relatively new to the public that essentially guarantees a consistency in its component-based views given their current states of data regardless of what paths that may have brought them to that state. Because of the way the the technology works, it is impossible for the view to exist in some unlikely odd state as a result of some strange and hard to predict sequence of data state mutations along the path that got it there. That is the essential ingredient that is so appealing about this. They also make it very easy to define this consistent view rendering based on the data state using a declarative approach. As for Flux, it is not a framework as much as it is a one-way data flow architecture between user interaction (or other sources of change) and model updates so that large applications can be scaled in a way that prevents data states from being confusing and hard to reason about. It prevents the business level spaghetti from happening. I imagine Flux as something that would take place outside of Phaser 3 (you might correct me) in the same way that it takes place outside of ReactJS and is the developer's responsibility to provide that architecture. In practice, React and Flux are a natural fit for one another. Together, the data state is easy to reason about and there is an assurance that it is rendered correctly. Everything is component based and all of it is easily unit tested. The Facebook development team has been evangelizing these technologies ever since they open sourced them starting a few years ago. And now, very recently, they have released something called Relay, based on their GraphQL that they are using to replace REST. Very compelling stuff, but the main thing in all of this is ReactJS, because I think that may be what Phaser 3 is swapping out in this arrangement of technologies. However, you would know best what Phaser 3 provides in all this.
  5. I must say, I've become very impressed with the React/Flux paradigm. How well does Phaser 3 lend itself to that approach?
  6. These people got a VERY FAST binary-heap based a-star algorithm working in javascript: https://github.com/bgrins/javascript-astar
  7. Full support for pixel perfect scaling without anti-aliasing so that my games can have a retro look to them and scale up based on different resolutions (especially as mobile devices get crazier resolutions with smaller pixels). On August 1, 2014, the Photon Storm blog entry "Pixel Perfect scaling a Phaser game" gave ways to do this, but it mentioned some drawbacks toward the end. In the second drawback in this article, it was said "There are ways to get around the input issue, but Phaser won’t handle it natively (although it’s something we have added to the roadmap for a release later this year)." My biggest hope is that this is something that would be supported in Phaser 3 natively. Thank you for your consideration! I apologize if this was already suggested.