Navigation

Phaser 3.20 Dev Report and Dancing Robots

Published on 4th October 2019

Greetings everyone!

I've spent all of this week working solidly on the Phaser 3.20 release and it's very close to ready. I've been tidying up the GitHub repo as I go, closing off lots of issues, actioning others and merging in pull requests. There are a handful of neat new features in 3.20 as a result, but mostly, loads and loads of fixes.

One of the new features is something I meant to add to Phaser 3 ages ago but never got around to until this week: support for loading and playing back Video. There is a new Video Game Object which can work with either a video file, or a media stream (such as a webcam) and then maps this onto a Game Object you can manipulate in the same way you would any other in your game, including all the usual transforms, but also cropping and full tint and quadrant alpha support, too.

Much like Render Textures, Video Game Objects can save themselves to the global Texture Cache, meaning any other Game Object can use it as its texture source. You can even draw them to Render Textures or use them as sampler2D inputs for shaders, where you could do some funky green-screen stuff.

Video support appears to be a lot better than in the Phaser 2 days. Browsers have really got better at it. Chrome will now loop seamlessly, without any stuttering, something it used to fail at quite miserably. Browser support for the WebM format is much better now, too, although still not on iOS which is a shame. However, on desktop, this means videos with alpha channels are perfectly useable. You can see this in the screenshot above, the robot is a video sequence and the background is a shader effect :)

There are still the same autoplay restrictions we've always had, but if your video doesn't contain any audio, then it's now possible to start playback immediately using just a single call in Phaser. You don't even need to preload the video files if you don't want to.

The Video Game Object will be part of the 3.20 release. It's still in testing but if you'd like to explore, you can find it in the master branch as usual.

Other new features include some big updates to Arcade Physics, including a neat new feature allowing you to now set the World boundary on a per-Body basis. In the screenshot above the red balls have had their world boundary set to match the inside of the cockpit.

It feels good to be giving Phaser 3 this much attention. I could have released 3.20 this week had I not wanted to get video support in there, yet I don't think it will take many more days to complete this, and then it can be pushed out as the final version.

I'll then carry on going through GitHub and doing another round of bug fixing, but also spending some time on Phaser 4, too. It's important that I maintain velocity on both of these projects. I've noticed that some people have been asking if they should bother learning Phaser 3, or just wait for Phaser 4. Honestly, that's up to you, but I will say that Phaser 4, in whatever form it takes, is a long way off yet. There's a lot of work to be done even to achieve my 'streamlined' vision for it. And I'll carry on updating Phaser 3 in the meantime, too. So learning it is definitely not a waste of time. Especially when a huge amount of that knowledge will be transferable to Phaser 4, too.

That's it for this week. Keep an eye on GitHub to see all the latest developments as they happen and I'll be back next week with another update. Have a good one, everyone.