Manage Amazon Promotions in ASP.NET Application

If you are into affiliate marketing then you must be getting promo codes from your partners which are promoted on various platforms. For ex, Amazon publishes promo codes for Associates which can then be pormoted by the Associates and they get a cut from the sales. Its a nice way to boost conversion and earn commission. Associates share the link to temporary promotion pages which is tagged with their affiliate id. These promotions run for a short duration and need to be managed more frequently by adding/removing them from your site almost on a daily basis so it makes sense to have a small database at your end which you can use to manage it at your end and it can also take care of the promotions which have ended. If a promotion has ended, Amazon takes you to the deals page when a promotion link is clicked but it makes[…]

URL Rewrite SEO in IIS

Since the advent of search engines URL rewriting has become mandatory. It makes URLs look nicer and clearer in terms of what content to expect at the given URL. Recently I uploaded few static HTML files to an IIS site. I wanted a nice looking URL without .html extension which was quite straight-forward to achieve in ASP.NET site. You can install URL Rewrite Module in IIS 7 or above versions and a few configuration steps is all that is required to achieve the desired results. Read this article from Microsoft to get in-depth understanding of the steps. Below is the sample web.config entry I had to make to achieve the results <configuration> <system.webServer> <rewrite> <rules> <rule name=”Rewrite to .html Rule”> <match url=”^games/([_0-9a-z-]+)” /> <action type=”Rewrite” url=”games/{R:1}.html” /> </rule> </rules> </rewrite> </system.webServer> </configuration> You will need some understanding of the regular expressions to create a matching pattern for your URL (match tag in[…]

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[…]