Phaser

Making Missiles in Phaser

Making Missiles in Phaser

Game Development, Phaser, Tips & Tricks
In this video, we look at how to make and shoot missiles in Phaser with only 23 lines of code! The basic idea is to create a sprite, the missile, inside of a group. We place the sprite at the x position of the mouse and the y position below the height of the game. Then during the update function, we simply loop through the group and subtract from the y position from each missile. This video uses the Phaser Snippets
Code Update

Code Update

Game Development, Phaser
For a few months and in my Udemy lessons, I've been detecting mobile devices by measuring the width of the screen. For a while this worked, but I've now found it to be ineffective. Sometimes a smaller desktop or laptop screen will show up as a mobile device. Here is the originalĀ Start for desktop/mobileĀ  snippet var game; window.onload = function() { if (screen.width>1500) { game=new Phaser.Game(480,640,Phaser.AUTO,"ph_game"); } else { game=new Phaser.Game(window.innerWidth,window.innerHeight,Phaser.AUTO,"ph_game"); } game.state.add("StateMain",StateMain); game.state.start("StateMain"); } And here is the Start for desktop/mobile update isMobile=navigator.userAgent.indexOf("Mobile"); console.log("isMobile="+isMobile); if (isMobile==-1) { //desktop lapto
Phaser Sounds

Phaser Sounds

Game Development, Phaser, Tutorials, Uncategorized
What is a game without sounds. Phaser Sounds are very easy to do. Check this video out! Source Code Hi!, this is William and today I'm going to show you how to put sounds into your phaser games Now I took our last lesson buttons and I copied it and made it into sounds project folder, and I've also put a sounds folder in that sounds folder and with an elephant mp3 file. You can use any mp3 and all of the source code is on the site WilliamClarkson.net I'm just going to the change the button green and buttons - blue and I'm going to change that 0,1,0 that we defined for the up over and down frames to 6,7,6 and what that's doing instead of using the play again and then that will use the start let's have a look at that. Great! Now for the sounds, there are three steps to play...
Phaser Buttons

Phaser Buttons

Game Development, Phaser
Phaser Buttons Phaser Buttons Source Code Button Snippets Text Of Video: Hi! This is William and today I'm going to show you how to put Phaser buttons into your game. what I've done is I've copied our basic template into a buttons folder just as I've done in the last few lessons and other added some image. images/ui/. These come from the mega template and you can find all of this on WilliamClarkson.net and I've also set up our brackets editor to point a to that buttons folder you just go file-> open folder just as we did in all the other lessons. Now I'm going to edit stateMain.s and the first thing I want to do is load that sprite sheet into the library in Phaser and we need to give it a unique ID we'll just call it buttons and then we give the path ima...
Phaser animations

Phaser animations

Game Development, Phaser, Tutorials
Phaser animations Phaser Animation Source Code Hello I'm William Clarkson and I am going to show you how to setup Phaser animations. First I copied my basic template which you can find on my website and you can also find it in the link with the blog post that goes with this video and I renamed it animation and I've placed the images folder with one image inside a call robot that will also be available on the blog post but I downloaded it from openGameart.org though I did modify into the spritesheet and I made it basically the same way I made a sprite sheet in my last video so the first thing we need to do is add that into a preload statement to put it into Phaser's library and you can find that under the snippets on my website toolbox phaser snippets and under sprite snip...
How to load a Sprite Sheet into Phaser

How to load a Sprite Sheet into Phaser

Game Development, Phaser, Tutorials
How to load a sprite sheet into phaser Download the source files I'm going to show you a bit about how to load a sprite sheet into phaser. I'm going to use somes snippets here and you can just type them out if you like or you can go to WilliamClarkson.net/phaser-snippets It is under the toolbox menu item here and I'm going use sprite snippets today. It has everything you need to be able to load a sprite sheet into phaser except for the spritesheet, and I'm going make a simple sprite sheet here just to show you how it's done canvas is 220 by 220 and I'm going to make some squares that are hundreds pixels high and wide and let's set that at 0,0 and then I'm just a copy this square four times to change different colors so you can see how we are changing the sp...
How to add an Image to Phaser

How to add an Image to Phaser

Game Development, Phaser, Tutorials
How to add an image to Phaser Download Source Code One of the first things you need to do when making a game is to add an image, and this video will show you how to add an image to phaser. Here is the text of the video. So this video will show you how to add an image to phaser and I'm going to be using the snippets at WilliamClarkson.net and you can also get the template there which I'm gonna be using a starter code or you can watch my other video on how to set that up so here are the two snippets that we are going to be using. Insert image into library and add image to stage once you get the template you just copy it to make a new project and then given name of the project in this case others call it ADD IMAGE I'm going to take the HP logo image there and mak...
Setting up Phaser for Games

Setting up Phaser for Games

Game Development, Phaser
setting up phaser for games I've been using phaser a lot for games lately. I'm going to be posting and showing a lot of how to build games in Phaser, this video will show you how get set up! All you need is a code editor. Anyone will do. I use dreamweaver, but some I've been using Brackets. It is a nice FREE alternative. You'll need some web space, or a free local server like xampp will do. and you need some code. I've been building some snippets to make it easier. To get started: Free Code editor Local server(or web space) Some Code Snippets This Video Text of the video: Setup Phaser for Games I have been working a lot lately with something called Phaser and I want to show you how to do all sorts of cools things in it. But first we have to do the steps...