Phaser Games and Tutorials
My latest Phaser Tutorials
Scaling Games in Phaser 3 with an Alignment Grid As game developers, one of the challenges we have faced since the invention of the smartphone is how to scale the game so it will fit on whatever device the player has. Scaling games in Phaser 3 is no exception. There are a lot of different ways programmer will achieve this. I'm going to show you the way I've been doing it for work and my own projects. I'm not saying it is absolutely the best way, but it works best for me. It is also an easy concept to explain because ...Read More
Make Buttons in Phaser 3 We all need a way to easily add buttons to our game. While Phaser CE had this built in, Phaser 3 does not. I understand why resources were put elsewhere since we can always just use a sprite anyway. It is nice to have a way, however, to quickly make buttons in Phaser 3 with rollover and press states. What about mobile? Sure mobile devices don't have rollovers, but it still can show the downstate. The user needs to know that the button was pressed. It is good practice to give feedback on every action ...Read More
Create A Text Style Library in Phaser 3 When I'm writing a game, I'm really into the logic of it. If I have to stop and look up fonts and colors all the time, my brain has to shift focus. In any case, I don't like to throw things away. I did something in Phaser 2, similar to the text style library I'm about to show you, for a project for my office. It got too complex for me to keep setting the fonts, colors, font sizes and origins (anchors) of the text fields over and again. Too many variations kept ...Read More
Phaser 3 Physics With the release of Phaser 3 physics now have a lot to offer. Whether you are a beginner at Phaser or an old hand at earlier versions and want to move into Phaser 3, learning the basics of at least one Physics engine will make your games much easier to build. One of the best things about Phaser is the way it implements physics. Before physics engines, programmers had to use a lot of complicated trigonometry formulas. I still love those formulas, but they can be quite time-consuming to look up and write for each and every game. Config Objects ...Read More
How do I scale sprites in Phaser 3? Often times when making a game, I will add a sprite to the stage to find out it looks bigger in the game than it did in the editing program. Often times this produces comical results. Think of a coin being twice as big as the player! If it is really much too big then I will re-edit the image and scale it down. Sometimes though scaling makes sense. I use scaling in all my game to make things fit nicely on the screen. Using Maths for scale Personally, I like to ...Read More
When learning any new framework or front-end language, especially for games the first three things I want to know are How to add an image How to add text How to add click events If you are coming from Phaser CE, I'm going to mention what's changed. If you are completely new to Phaser, just ignore those parts, and it will still help you get a jump start on building games in Phaser 3. The Game Object There is a global game object, just as there was in Phaser CE but now it no longer handles creating things for the ...Read More
From the Shop
Phaser 3 Text Effects Pack 1 Here is a pack of 3 Phaser 3 text effects that may be useful in your games. TypeWriter Demo http://phasergames.com/phaser/demos/texteffects/typewriter.html Usage var myText =…
Flat Buttons in Phaser 3 I'm starting to put together my library of Phaser 3 code so I can quickly put together my games. Dynamic buttons are a big part…
New To Phaser Development?
Take the Phaser Basics Mini-Course
My name is William Clarkson. I’ve been writing code for about 30 years now and am currently employed as a game developer for Gaiaonline.com where I am writing Phaser games and apps every day. I’ve been working with Phaser for almost 2 years now and am quite impressed with it. I am actively working to replace a lot of the flash work I did in the last 6 years with Html5 content and this is the library that is working well for me. Within two weeks of starting Phaser, I was creating games just as fast as I had done after 15 years of flash!
What would you like to learn?
If you have questions, a suggestion for what you’d like to see in a post or need support there are links to groups, or just feel free to contact me. I love talking about code especially when it comes to games. If you are into making Phaser Games already then please check out our Phaser Game makers group.
Recently Phaser 3 was released. I am scrambling to update the site with resources while balancing my day job. You’ll find plenty of Phaser CE items here, and the list for Phaser 3 will continue to grow as time goes on. If you’ve any specific requests about Phaser please contact me, and I’ll do my best to accommodate.