Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

16. May 2018


Since the release of Phaser 3.0 earlier this year, the HTML5 game framework has seen a rapid succession of updates.  Today Phaser 3.8.0 was released, this release focusing heavily on the plugin system, making it easier to acquire and ultimately use them in your game.  This release also enables you to provide your own already created WebGL context when initializing Phaser.  Of course the release is also packed with other smaller fixes, features and improvements.


Further details from the change log:

New Features
  • You can pass in your own canvas and context elements in your Game Config and Phaser will use those to render with instead of creating its own. This also allows you to pass in a WebGL 2 context. Fix #3653 (thanks @tgrajewski)
  • WebGLRenderer.config has a new property maxTextures which is derived from gl.MAX_TEXTURE_IMAGE_UNITS, you can get it via the new method getMaxTextures().
  • WebGLRenderer.config has a new property maxTextureSize which is derived from gl.MAX_TEXTURE_SIZE, you can get it via the new method getMaxTextureSize()
  • WebGLRenderer has a new property compression which holds the browser / devices compressed texture support gl extensions, which is populated during init.
  • When calling generateFrameNames to define an animation from a texture atlas you can now leave out all of the config properties and it will create an animation using every frame found in the atlas. Please understand you've no control over the sequence of these frames if you do this and it's entirely dictated by the json data (thanks @Aram19)
  • The keycodes for 0 to 9 on the numeric keypad have been added. You can now use them in events, i.e. this.input.keyboard.on('keydown_NUMPAD_ZERO') (thanks @Gaushao)
  • All Game Objects have a new method setRandomPosition which will randomly position them anywhere within the defined area, or if no area is given, anywhere within the game size.
Updates
  • Game.step now emits a prestep event, which some of the global systems hook in to, like Sound and Input. You can use it to perform pre-step tasks, ideally from plugins.
  • Game.step now emits a step event. This is emitted once per frame. You can hook into it from plugins or code that exists outside of a Scene.
  • Game.step now emits a poststep event. This is the last chance you get to do things before the render process begins.
  • Optimized TextureTintPipeline.drawBlitter so it skips bobs that have alpha of zero and only calls setTexture2D if the bob sourceIndex has changed, previously it called it for every single bob.
  • Game.context used to be undefined if running in WebGL. It is now set to be the WebGLRenderingContext during WebGLRenderer.init. If you provided your own custom context, it is set to this instead.
  • The Game onStepCallback has been removed. You can now listen for the new step events instead.
  • Phaser.EventEmitter was incorrectly namespaced, it's now only available under Phaser.Events.EventEmitter (thanks Tigran)
Bug Fixes
  • The Script File type in the Loader didn't create itself correctly as it was missing an argument (thanks @TadejZupancic)
  • The Plugin File type in the Loader didn't create itself correctly as it was missing an argument.
  • WebAudioSoundManager.unlock will now check if document.body is available before setting the listeners on it. Fixes old versions of Firefox, apparently. #3649 (thanks @squilibob)
  • Utils.Array.BringToTop failed to move the penultimate item in an array due to an index error. Fix #3658 (thanks @agar3s)
  • The Headless renderer was broken due to an invalid access during TextureSource.init.
  • Animation.yoyo was ignored when calculating the next frame to advance to, breaking the yoyo effect. It now yoyos properly (thanks Tomas)
  • Corrected an error in Container.getBoundsTransformMatrix that called a missing method, causing a getBounds on a nested container to fail. Fix #3624 (thanks @poasher)
  • Calling a creator, such as GraphicsCreator, without passing in a config object, would cause an error to be thrown. All Game Object creators now catch against this.


If you are interested in learning Phaser 3, be sure to check out our Getting Started video, also embedded below:

GameDev News

9. May 2018


Phaser 3.7.1 continues it’s rapid release schedule, the most recently released version being 3.7.1.  Phaser is a HTML5 2D game framework, with 3.x being the most recent branch.  If you are interested in learning more about Phaser, be sure to check out our Getting Started with Phaser 3 video, also embedded below.  This release focused heavily on API refinement, loading performance gains and improvements to the documentation.  This change also fixes Googles recent web audio idiocy in Chrome 66.

Details from the release blog:


New in this version is support for Loader Pack Files. These were a popular feature in Phaser 2 and allowed you define a list of resources in a JSON file that the Loader would consume and then load for you. They're back in Phaser 3 now and refined to be more powerful than before. Packs can even load other packs, and you can selectively run just a part of a pack if you wish.

Also improved is the ability to use Phaser outside of Webpack. I have removed the requirement for the Webpack raw-loader plugin entirely, and swapped the defines to use typeof checks, which means you should now be able to require Phaser into your package, no matter what bundler you're using, and without any special configuration needed. If you are using Webpack you can still benefit by using our config, but those outside of Webpack, or in environments like Electron are no longer penalized.

The Change Log for this release is massive and contains a few important updates. I would urge you to please read through it as there are some API breaking changes inside in certain areas. This release also fixes the issue Chrome v66 has bought into the mainstream with regard to unlocking Web Audio on desktop and their insane new Media Engagement Index.


You can read the complete change as well as download here.

GameDev News

22. March 2018


Phaser is a popular open source HTML5 2D game framework, that just released version 3.3.0.  Phaser has been on a rapid release schedule since Phaser 3 was released just last month.


Highlights of this release include:

  • Lots of new Game Configuration properties which are passed to Phaser330the renderer, including power preferences, anti-aliasing, drawing buffer preservation and more.
  • Arcade Physics can now wrap physics bodies around the world.
  • Camera shake, fade and flash all now have optional callbacks that can be invoked when the effect completes.
  • Camera fadeIn and Camera fadeOut are two new methods to help with scene transitions (also with callbacks)
  • Groups now listen for the destroy event coming from children and automatically purge them from the Group if received.
  • There is a new MatterGameObject which allows you to bind a Matter Physics body with any renderable Game Object, such as Text, Bitmap Text or TileSprite (see the labs for examples)
  • The Sound Manager has new chainable setRate and setDetune methods.


Additionally the documentation has seemed heavy focus which will hopefully result in Typescript definitions being available soon™.  In addition to the above features there were several other smaller improvements and bug fixes.  You can read the full change log here.


If you are interested in getting started with Phaser, be sure to check out our recently released Getting Started with Phaser 3 video tutorial, also embedded below.

GameDev News

13. March 2018


Another quick update for the recently released Phaser 3 game engine, this one bringing Phaser to version 3.2.1.   Phaser is a popular and full featured 2D framework for developing HTML5 games.  This release is almost entirely composed of bug fixes and quality of life improvements.


Details of the release from the release notes:


Bug Fixes
  • Fixed issue with Render Texture tinting. Fix #3336 (thanks @rexrainbow)
  • Fixed Utils.String.Format (thanks @samme)
  • The Matter Debug Layer wouldn't clear itself in canvas mode. Fix #3345 (thanks @samid737)
  • TimerEvent.remove would dispatch the Timer event immediately based on the opposite of the method argument, making it behave the opposite of what was expected. It now only fires when requested (thanks @migiyubi)
  • The TileSprite Canvas Renderer did not support rotation, scaling or flipping. Fix #3231 (thanks @TCatshoek)
  • Fixed Group doesn't remove children from Scene when cleared with the removeFromScene argument set (thanks @iamchristopher)
  • Fixed an error in the lights pipeline when no Light Manager has been defined (thanks @samme)
  • The ForwardDiffuseLightPipeline now uses sys.lights instead of the Scene variable to avoid errors due to injection removal.
  • Phaser.Display.Color.Interpolate would return NaN values because it was loading the wrong Linear function. Fix #3372 (thanks @samid737)
  • RenderTexture.draw was only drawing the base frame of a Texture. Fix #3374 (thanks @samid737)
  • TileSprite scaling differed between WebGL and Canvas. Fix #3338 (thanks @TCatshoek)
  • Text.setFixedSize was incorrectly setting the text property instead of the parent property. Fix #3375 (thanks @rexrainbow)
  • RenderTexture.clear on canvas was using the last transform state, instead of clearing the whole texture.
Updates
  • The SceneManager.render will now render a Scene as long as it's in a LOADING state or higher. Before it would only render RUNNING scenes, but this precluded those that were loading assets.
  • A Scene can now be restarted by calling scene.start() and providing no arguments (thanks @migiyubi)
  • The class GameObject has now been exposed, available via Phaser.GameObjects.GameObject (thanks @rexrainbow)
  • A Camera following a Game Object will now take the zoom factor of the camera into consideration when scrolling. Fix #3353 (thanks @brandonvdongen)
  • Calling setText on a BitmapText object will now recalculate its display origin values. Fix #3350 (thanks @migiyubi)
  • You can now pass an object to Loader.atlas, like you can with images. Fix #3268 (thanks @TCatshoek)
  • The onContextRestored callback won't be defined any more unless the WebGL Renderer is in use in the following objects: BitmapMask, Static Tilemap, TileSprite and Text. This should allow those objects to now work in HEADLESS mode. Fix #3368 (thanks @16patsle)
  • The SetFrame method now has two optional arguments: updateSize and updateOrigin (both true by default) which will update the size and origin of the Game Object respectively. Fix #3339 (thanks @Jerenaux)


Phaser is available for download here.  If you are interested in learning more about Phaser 3 development be sure to check out our getting started video available here and embedded below.

GameDev News

5. March 2018


Hot on the heels of last months Phaser 3 release, Phaser 3.2.0 has just been released.  Considering the short period that has elapsed, there are actually a fair number of new features, bug fixes and changes in this release.


New features in this release:

  • The new Render Texture Game Object is now available. You can clear, fill and draw texture frames to it. The Render Texture itself can be displayed in-game with its own transform, or you can use it as a Bitmap Mask for another Game Object.
  • Game.resize allows you to resize the game config, renderer and input system in one call.
  • When Game.resize is called it causes all Scene.Systems to have their resize method called. This is turn emits a resize event which your Scene can respond to. It will be sent the new width and height of the canvas as the only two parameters.
  • InputManager.resize allows you to update the bounds def and input scale in one call.
  • Game.Config.roundPixels property added to prevent sub-pixel interpolation during rendering of Game Objects in WebGL and Canvas.
  • Load.plugin now accepts a class as an argument as well as a URL string (thanks @nkholski)
  • Tween.complete will allow you to flag a tween as being complete, no matter what stage it is at. If an onComplete callback has been defined it will be invoked. You can set an optional delay before this happens (thanks @Jerenaux for the idea)
  • The Headless render mode has been implemented. You can now set HEADLESS as the renderType in the Game Config and it will run a special game step that skips rendering. It will still create a Canvas element, as lots of internal systems (like input) rely on it, but it will not draw anything to it. Fix #3256 (thanks @rgk)
  • GameObject.setInteractive has a new boolean argument dropZone which will allow you to set the object as being a drop zone right from the method.
  • Sprites can now be drop zones and have other Game Objects dragged onto them as targets.
  • The SceneManager has a new method: remove which allows you to remove and destroy a Scene, freeing up the Scene key for use by future scenes and potentially clearing the Scene from active memory for gc.
  • SceneManager.moveAbove will move a Scene to be directly above another Scene in the Scenes list. This is also exposed in the ScenePlugin.
  • SceneManager.moveBelow will move a Scene to be directly below another Scene in the Scenes list. This is also exposed in the ScenePlugin.
  • Quadratic Bezier Interpolation has been added to the Math.Interpolation functions (thanks @RiCoTeRoX)
  • A new Quadratic Bezier Curve class has been added, expanding the available Curve types (thanks @RiCoTeRoX)
  • Path.quadraticBezierTo allows you to add a Quadratic Bezier Curve into your Path.
  • Loader.multiatlas now supports Texture Packers new JSON atlas format which exports one combined atlas for all image files. This is available if you use the new Phaser 3 Export from within Texture Packer (thanks @CodeAndWeb)
  • Modified WebGLPipeline to make it easier to extend and easier to create custom rendering passes.


Be sure to check the full change log for full details on the bug fixes and updates in this release.  If you are interested in learning more about Phaser 3, be sure to check out our Getting Started with Phaser 3 video.

GameDev News

Month List

Popular Comments