WordPress Error: Briefly unavailable for scheduled maintenance. Check back in a minute

This error occurs when you try to update something in WordPress site and the update fails for some reason and then your site goes down and following message is displayed Don’t worry. The process to fix this is pretty straight-forward. Go to your blog installation folder and look for .maintenance file. This file is generated by WordPress when the update occurs and then removed after the update finishes. In case update fails and this file could not be removed, then the above error message is displayed. Delete this file and you will be back up.

Add AdMob Ads to HTML5 Game using Intel XDK

The steps are as following Open your app in Intel XDK and go to CORDOVA HYBRID MOBILE APP SETTINGS section Click on “Add Plugins to this project” and search for the plugin “cordova-plugin-admob-free” in npm. Click “Add Plugin” which adds plugin to the project. Open your index.html and add following code <script> document.addEventListener(“deviceready”, onDeviceReady, false); function onDeviceReady() { initAd(); showBannerFunc(); } //initialize the goodies function initAd(){ admob.banner.config({ id: ‘ca-app-pub-3940256099942544/6300978111’, adSize: window.plugins.AdMob.AD_SIZE.BANNER }); admob.interstitial.config({ id: ‘ca-app-pub-3940256099942544/1033173712’, autoShow: false }); // Create banner admob.banner.prepare() } //display the banner function showBannerFunc(){ admob.banner.show(); } //prepare the interstitial function prepareInterstitialFunc(){ admob.interstitial.prepare(); } //display the interstitial function showInterstitialFunc(){ admob.interstitial.show(); } </script> Replace banner and interstitial ad code id with yours. The code in the example is given by Google to test the ads which displays placeholder ads for testing. This can be used during development and testing. Replace it with your ad codes for release. Another thing to note here[…]

Add Social Sharing Feature to HTML5 Game using Intel XDK

If you have gone through previous post in which we discussed about using Intel XDK to compile HTML5 games to Android apps, next steps are to add features which are quite necessary for every Android app such Social Sharing option. There are many open source plugins available to add Social Sharing feature to your app and it takes no more than a few minutes of effort to integrate this feature and get it working. The steps are as following Open your app in Intel XDK and go to CORDOVA HYBRID MOBILE APP SETTINGS section Click on “Add Plugins to this project” and search for the plugin “cordova-plugin-x-socialsharing” in npm. Click “Add Plugin” which adds plugin to the project. Open your index.html and add following code <script> function share(){ window.plugins.socialsharing.share(‘Sample’, null, null, ‘https://play.google.com/store/apps/details?id=com.html5games.sample’); } </script> Replace title and URL of the Android app in the code. And that is it. Now the share[…]

Compile Phaser Games (or any other HTML5 Game) as Android Store App using Intel XDK

Intel XDK has long supported development and compilation of HTML5 games for Android, iOS and Windows store. It even provided a cloud based build system which took care of preparation of final packages which could be directly published to respective Android, iOS and Windows stores but starting from July 2017, Intel XDK build system has been shut down and new versions of Intel XDK do not have Game templates anymore. Still the tool is very useful for compiling your HTML5 games for Android, iOS and Windows stores. We are going to look at steps to compile HTML5 game for Android in this tutorial. Step 1 – Download and install Intel XDK. Step 2 – Create a new project using Blank HTML5 + Cordova template. Select “HTML5 + Cordova” and Click “Continue” which open a dialog box for specifying Project Name and Directory. We are going to use Dice Roller example code[…]

Integrate Kongregate’s JavaScript API in HTML5 Game to Submit High Score

Though Kongregate’s API can be directly initialized in the main game’s HTML, the better way is to always create a Kongregate’s Shell which is nothing but another HTML file which you refer for running the game in stead of your default game’s HTML file. The Shell file in turn embeds your game’s default HTML file using an iFrame. Code for Shell HTML can be used from the code snippet below <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html lang=”en” xml:lang=”en” xmlns=”http://www.w3.org/1999/xhtml”> <head> <title>Kongregate Game Shell</title> <!– Load the Kongregate Javascript API –> <script src=’https://cdn1.kongregate.com/javascripts/kongregate_api.js’></script> <!– Give the shell no border/scroll bars and match the Kongregate background color. If your game needs scrollbars, you might need to modify these styles –> <style type=”text/css”> html{border: none; overflow: hidden; background-color: #333;height: 100%;} body{border: none; background-color: #333;margin:0; padding:0;} </style> </head> <body> <script type=”text/javascript”> // Called when the API is finished loading function onLoadCompleted(){[…]

Optimize/Minify HTML5 Game Assets

After I wrote Block Dominoes game I decided to look into optimization of the assets, compress whatever could be done and make the game as lightweight as it could be. I had designed and made the assets at a resolution of 1920×1080. The first logical step was to go search what other developers were doing and surprisingly 1920×1080 seemed quite a big resolution to choose for a game. There was an older discussion on  HTML5GameDevs.com which suggested using a lower resolution such as 320×480 which many devs have been using successfully.  I decided to go for half of what I initially designed so I reduced all game assets to half of the original size which was 960×540. The size of all graphical assets were reduced by 40% which was a very good saving. Interestingly there was no visible difference on look and feel of the game when I tested it on iPhone6, Nexus 5 and Lenovo[…]

Handling of Moving Tweens in a Responsive Game in Phaser

If you went through previous articles on making of a responsive game in Phaser, we handled scaling and placement of individual elements according to the available width and height for the game. I moved on to writing next responsive game in Phaser and came across another scenario which requires additional handling. In Number Spread game we did not use any tween to move elements between two points. In my next game I planned to create a domino game where effects like dealing domino tiles to the players were required to be handled. While aligning and scaling of the elements were done exactly how it was done in Number Spread game, additional scenario which I needed to handle was managing the tweens which were used to deal domino tiles to the players. Consider the scenario where I made a chained tweens set to deal domino tiles to the players. I resized my game halfway[…]

Card Flip Animation in Phaser

The code example below shows how a simple card flip animation can be achieved in Phaser. In order to flip or rotate a card around x-axis we need to set the scale to zero, change the sprite frame and then set the scale back to one. TheGame.MyGame.prototype = { preload: function () { }, create: function () { this.card = this.add.sprite(this.world.centerX, this.world.centerY, “card”) this.card.frame = 0; this.card.anchor.setTo(0.5); // roll the dice when a mouse button is clicked this.game.input.onDown.add(this.flipCard, this); }, flipCard: function () { var tween1 = this.game.add.tween(this.card.scale); tween1.to({ x: 0 }, 300, Phaser.Easing.Linear.None, false, 0); tween1.onComplete.addOnce(function (sprite, tween) { if(this.card.frame == 0) this.card.frame = 1; else this.card.frame = 0; }, this); var tween2 = this.game.add.tween(this.card.scale); tween2.to({ x: 1 }, 300, Phaser.Easing.Linear.None, false, 0); tween1.chain(tween2); tween1.start(); } }; This example flips the card around x-axis. In order to flip it around y-axis, change as following flipCard: function () { var[…]

Phaser Dice Roller

While exploring Phaser online, I came across a very nice example which can be used for dice roll in a Phaser game. I probably downloaded it from github, but cannot find the original source. If someone happens to know the source, please send the URL to update in this article. Meanwhile I can not resist posting the code since it looks pretty good for use in Dice Games if someone wants to write one. The code below extends Sprite and uses Blur filters from Phaser examples. Dice = function (x, y) { Phaser.Sprite.call(this, mygame, x, y, ‘dice’); this.tween; this.anim; this.blurX = mygame.add.filter(“BlurX”); // Blur filters taken from this.blurY = mygame.add.filter(“BlurY”); // Filters -> blur example this.anchor.setTo(0.5, 0.5); var i; var frames = []; for (i=0; i < 15; i++) { frames[i] = mygame.rnd.pick([0,1,2,3,4,5]); } // the animation displays the frames from the spritesheet in a random order this.anim = this.animations.add(“roll”, frames); this.anim.onComplete.add(this.rollComplete, this);[…]

Display a hint using tween in Phaser

This is next task I planned to implement in Number Spread game I discussed in the previous article series. In a game we have many scenarios when we want to display a hint and I considered many options as to how this can be implemented in Phaser. The options could be either using a tween or animation. For Number Spread it was a simple scenario when I just needed to display a hand which moved in certain direction to give a hint to player what is to be done. A tween for this purpose seemed fine. Look at the complete code for it below. var TheGame = { }; TheGame.Params = { baseWidth: 1920, baseHeight: 1080, minPadding: 50, iconSize: 364, fieldSize: { rows: 6, cols: 6 } }; TheGame.Boot = function (game) { }; TheGame.Boot.prototype = { init: function () { this.scale.scaleMode = Phaser.ScaleManager.RESIZE; }, preload: function () { this.load.image(“loading”, “loadingback.png”); }, create:[…]