Force Windows 10 Store App to Open in Full Screen Mode

The java script code for achieving this: (function () { “use strict”; var app = WinJS.Application; var activation = Windows.ApplicationModel.Activation; var ViewManagement = Windows.UI.ViewManagement; var ApplicationViewWindowingMode = ViewManagement.ApplicationViewWindowingMode; var ApplicationView = ViewManagement.ApplicationView; app.onactivated = function (args) { if (args.detail.kind === activation.ActivationKind.launch) { if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) { // TODO: This application has been newly launched. Initialize your application here. } else { // TODO: This application was suspended and then terminated. // To create a smooth user experience, restore application state here so that it looks like the app never stopped running. } args.setPromise(WinJS.UI.processAll()); ApplicationView.preferredLaunchWindowingMode = ApplicationViewWindowingMode.fullScreen; } }; app.oncheckpoint = function (args) { // TODO: This application is about to be suspended. Save any state that needs to persist across suspensions here. // You might use the WinJS.Application.sessionState object, which is automatically saved and restored across suspension. // If you need to complete an asynchronous operation before your application[…]

How to Handle Orientation Change in Phaser Mobile Web Game

If you are not using RESIZE mode for mobile game development and using SHOW_ALL or other scale modes, then you would need to lock the game for one specific orientation. In the previous articles we discussed about the mobile game which was to be published to Android store (Intoduction, Calculation, Game Screen), I also uploaded the game online. The game was played in Landscape mode and I initially developed it for desktop. When I opened it in mobile, though I could open it in Portrait mode and everything was calculated well, I wanted to lock it for Landscape orientation when opened in browser on a mobile device. The orientation was easily locked in Android app by simply changing some configuration option but for browser version I had to write some addtional code. I got some help from Emanuele’s blog on the same topic and borrowed some code. I had to handle it differently[…]

Monetize Windows 10 Store App with Ads

In the previous article we converted our Phaser game to a windows 10 store app (UWP app). Now we all want to monetize our games. One way of monetizing is by putting ads in our game. Micorsoft has built support for ads in the UWP which offers various ad types and also supports mediation with other ad networks. Refer to following resources to get more detail https://developer.microsoft.com/en-us/store/monetize/ads-in-apps We will go through steps to quickly add a banner ad to our game. First step is to add WinJS and Microssoft Advertising SDK to our visual studio project. Open proejct and go to NuGet Package Manager -> Manage NuGet Packages for Solution Search for WinJS in Browse section, select the package and click install which will install the package in the current solution. Accept the popup confirmations if you get any. Next we will add Microssoft Advertising SDK. Simply browse for Advertising and in the results[…]

Compile Phaser Game to WIndows 10 Store App

In previous articles we started building an Android mobile app using Phaser. Check out the articles – Introduction, Calculation, Game Screen, FPS Problem Now since windows has native support for javascript and HTML5, it makes sense to distribute our Phaser games to windows app store to reach new audience. The steps required to compile Phaser game to Windows 10 App is pretty straight forward with no need  for any change in the code. You would need windows 10 to develop and debug the application. If you do not have windows 10 yet, go and download evaluation version of windows and install it in a VM. Microsoft is also providing evaluation version of readymade VMs supporting various technologies such as VMWare, HyperV, Parallels etc which comes pre-loaded with development tools such as Visual Studio 2017 Community edition which you can try for evaluation. https://developer.microsoft.com/en-us/windows/downloads/virtual-machines If you already have windows 10 then download and install[…]

Making of a Responsive Mobile Game App using Phaser: FPS Problem

In the previous articles (Intoduction, Calculation, Game Screen) we went through the basic steps required for mobile game creation and looked at calculating and adding responsive behaviour to our game. The same concept applies to the game screen as well. Here is the main game screen The game is a classic dominoes game where players are required to throw their dominoes on their personal train or a special public train, or any other player’s personal train when it becomes public during the play. A lot of tweeing effects are used in the game which is turning out to be the main area to focus. The first step to optimize the game was to reduce the resolution for mobile which I chose to be 960×640 for devices with low processing power and 1350×900 for devices with high processing power. In order to do some benchmarking I integrated some code to measure FPS in[…]

Making of a Responsive Mobile Game App using Phaser: Game Screen

In previous article I fixed the resolutions I wanted to use for my game, the next step was to set up the game screen and placing the controls on the screen. This is very similar to how it was done for RESIZE mode but for the continuation of this article I will demonstrate the first screen of the game which will give good idea about other screens as well. Then I will focus on the optimization which I am going to try to improve the overall performance of the game on mobile devices. First thing I do is to fix the area for individual controls so that we can calculate its size and give maximum space available on mobile device. The layout I chose for first screen of my game is something like below Look at the percentage values. The selected orientation for my game is going to be Landscape. Top 30% area heightwise is[…]

Making of a Responsive Mobile Game App using Phaser: Calculation for Game Size

In my introductory article on this series I talked about using SHOW_ALL scale mode for my game which fits perfectly for need to be responsive. It will resize the game to fit into available space using the original aspect ratio which was used to develop the game. The only issue I saw was the “letter-boxing” effect so if device’s aspect ratio was different than the game’s aspect ratio, there will be blank space around either horizontal edges or vertical edges. We can account for that extra available space when loading new game and positioning of all ui controls can then be done relative to available space which is similar to how we handled RESIZE scale mode. The only difference here is that it can only be done once in SHOW_ALL scale mode when the game is initialized. In mobile app this is not going to be a problem and we can[…]

Making of a Responsive Mobile Game App using Phaser: Introduction

In my previous posts on responsive Phaser game (part1, part2, part3) I used RESIZE scale mode for making game reponsive. RESIZE mode needed quite some handling whenever screen was resized. For example position of individual controls were required to be recalculated. Moving tweens were also something which required special handling on resize. It serves better for desktop games in which you can support different aspect ratios. I planned to compile and publish my next game to Android play store which made me also look into SHOW_ALL scale mode. SHOW_ALL handles resizing automatically and does not have a resize method for moving controls around on resize. The only limitation is that it fixes the aspect ratio of the game canvas and when game screen is resized, it resizes game canvas in the same aspect ratio. It might be a problem for desktop games where browser window can be resized to any proportion but mobile[…]

Disable Comments in a Single Post in WordPress

Recently I started getting hundreds of spam comments to a specific post and for a couple days I kept deleting it assuming it was a one time flood but those spam comments kept coming in hundreds everyday. I did not want to delete the post since it had a decent views so decided to look for ways to disable comments in only that specific post. The solution came pretty quickly and was already built-in the WordPress. All I had to do was to go to the posts and then click Quick Edit link which opened an inline edit box and there it was; the option to disable comments. Check for highlighted section below for the same