Phaser 3 Games in WordPress Posts & Pages

  March 01, 2024     , ,
Phaser 3 Games in WordPress Posts & Pages
Microsoft Office 365 Stock Photo

The world of online gaming has evolved exponentially over the years, and with it, the need for game developers to showcase their skills has become more crucial than ever.

Many developers turn to Phaser 3, a fast and versatile JavaScript game development framework, to craft captivating games for the web. However, presenting these games effectively on their WordPress-based portfolios can be very challenging. This is where pwp, our “Phaser 3 to WordPress” prototype, comes to the rescue.

pwp is a WordPress Plugin illustrating how to incorporate a basic Phaser 3 game into WordPress posts and pages using a simple shortcode, for instance:

pwp is freely available on our GitHub.

The Plugin in Action

This Phaser 3 game provided below is a simple 2D platformer – based on Richard Davey’s Tutorial on Making a Game with Phaser 3 – where a player-controlled sprite moves across the screen in response to keyboard inputs (arrow keys).

The Plugin detects if a post or page contains the [pwp] shortcode, and if it does, it enqueues the required scripts – jQuery, Phaser 3, and the game script – and sets up a div element with the necessary attributes for embedding the game.

Gréoux Research
Enabling the transition to a low-carbon future

Gréoux Research is a privately owned energy research lab. This section of the website offers access to a collection of scripts and tools that support both our website and the embedded apps. Feel free to check out our GitHub repository for additional resources.

  GitHub Repositories