Created: 2/16/2017
By: demonisblack
Email: demonisblack@gmail.com
Thank you for purchasing my game. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!
Hacker Challenge is a HTML5 where you need to direct the flow of blue energy by changing the rotation of the junction shapes until it reaches an end-point that will unlock.
The ZIP package contains the game with 1280×768 resolution that scales to fit the whole screen device, but it may not be perfectly full screen.
How To Play:
1. Use finger or mouse press to change the rotation of junction shapes.
2. Unlock by Direct the flow of blue energy until it reaches an end-point.
To install the game just upload folder 'game' to your server. The game won't run locally with some browser like Chrome due to some security mode.
You need a website that runs PHP to make facebook share button work, and make sure to change Facebook Open Graph meta and Twitter meta in index.html, just replace [GAME_URL] to your game URL.
- <!-- for Facebook -->
- <meta property="og:image" content="[GAME_URL]/share.jpg" />
- <meta property="og:url" content="[GAME_URL]" />
- <!-- for Twitter -->
- <meta name="twitter:image" content="[GAME_URL]/share.jpg" />
You can easily customize game text and settings in game.js file
- var gameStageText = 'Stage[NUMBER]'; //stage display, [NUMBER] will replace with stage num
- var gameStageColour = '#fff'; //stage display colour
- var gameOverText = 'ACCESS DENIED'; //game access denied
- var gameOverColour = '#D90000'; //game access denied colour
- var strokeLine = 3; //stroke line
- var strokeColour = '#D90000'; //stroke colour
- var strokePowerColour = '#7cc5ed'; //stroke power colour
- var resultText = 'Completed'; //result text
- var resultStageText = 'Stage[NUMBER]'; //result stage
- //Social share, [SCORE] will replace with game score
- var shareEnable = true;
- var shareText ='share your score'; //text for share instruction
- var shareTitle = 'Highscore on HACKER CHALLENGE Game is Stage [SCORE]';//social share score title
- var shareMessage = 'Stage [SCORE] is mine new highscore on HACKER CHALLENGE Game! Try it now!'; //social share score message
Below is the explanation of each most important array item in 'hublock_arr' array:
- //hub lock
- var hublock_arr = [{image:'assets/hub_lock.png', power:'assets/hub_lock_power.png', indicator:'assets/hub_lock_indicator.png', indicatorPower:'assets/hub_lock_indicator_power.png'},{image:'assets/hub_lock_supply.png', power:'assets/hub_lock_supply_power.png', indicator:'assets/hub_lock_indicator_supply.png', indicatorPower:'assets/hub_lock_indicator_power_supply.png'}];
Below is the explanation of each most important array item in 'hub_arr' array:
- //hub type
- var hub_arr = [{type:'power', image:'assets/hub_power.png', power:'assets/hub_power.png', range:70, lock:0},
- {type:'supply', image:'assets/hub_supply.png', power:'assets/hub_supply_power.png', range:47, lock:1},
- {type:'linear', image:'assets/hub_linear.png', power:'assets/hub_linear_power.png', range:30, lock:0},
- {type:'corner', image:'assets/hub_corner.png', power:'assets/hub_corner_power.png', range:30, lock:0},
- {type:'cross', image:'assets/hub_cross.png', power:'assets/hub_cross_power.png', range:30, lock:0},
- {type:'t', image:'assets/hub_t.png', power:'assets/hub_t_power.png', range:30, lock:0}];
If you wish to add/edit stage, check out Stage Settings section.
If you wish to add/edit stage with build-in edit tools, check out Build-in Edit Tools section.
The sound can be easily disabled to avoid compatibility issues in sound.js file:
- var enableMobileSound = true;
The mobile rotate instruction can be easily change in mobile.js file:
- var rotateInstruction = true; //enable rotate instruction for mobile
- var forPortrait=false; //for portrait only, set false for landscape mode
The page start with the loader wrapper that covering the whole screen in the body. It shows loader progress when calls the function initPreload()
- <!-- PERCENT LOADER START-->
- <div id="mainLoader"><span>0</span></div>
- <!-- PERCENT LOADER END-->
This section is for browser not support page when calls the function checkBrowser(). It shows error message when detect the browser does not support canvas.
- <!-- BROWSER NOT SUPPORT START-->
- <div id="notSupportHolder">
- <div class="notSupport">YOUR BROWSER ISN'T SUPPORTED.<br/>PLEASE UPDATE YOUR BROWSER IN ORDER TO RUN THE GAME</div>
- </div>
- <!-- BROWSER NOT SUPPORT END-->
Device rotate instruction page when calls the function checkMobileOrientation(). It shows rotate instruction when device is in portrait view.
- <!-- ROTATE INSTRUCTION START-->
- <div id="rotateHolder">
- <div class="mobileRotate">
- <div class="rotateImg"><img src="assets/rotate.png" /></div>
- <div class="rotateDesc">ROTATE YOUR DEVICE <br/>TO LANDSCAPE</div>
- </div>
- </div>
- <!-- ROTATE INSTRUCTION END-->
Follow by one canvas tag in the body. The game start initiatie by calls the main function of the game initMain().
- <!-- CANVAS START-->
- <div id="canvasHolder">
- <canvas id="gameCanvas" width="1280" height="768"></canvas>
- </div>
- <!-- CANVAS END-->
I'm using two CSS files in this game. The first one is a generic reset file. Many browser interpret the default behavior of html elements differently. By using a general reset CSS file, we can work round this. This file also contains some general styling, such as anchor tag colors, font-sizes, etc. Keep in mind, that these values might be overridden somewhere else in the file.
The second file contains all of the specific stylings for the page.
This game using Javascript files below.
Complete game flow:
The most important functions used for page.
The most important functions used for game.
The game contain 'design' folder which include following:
The folder 'assets' in 'game' folder contains all the images of the game that can be replaced. Is better to have the same size of the old ones if you want to reskin the game graphic without coding.
You can easily customize stage settings in stage.js file
All stages are store in 'stage_arr' array, sample code below:
- var stage_arr = [
- {stage:{w:1280, h:768, x:0, y:0},
- hub:[{x:264, y:394, type:0, lock:[1,1,1,1], timer:0, trick:0, rotation:-1},{x:1051, y:393, type:1, lock:[1,0,0,0], timer:0, trick:0, rotation:-1},{x:579, y:597, type:3, lock:[0,0,0,0], timer:0, trick:0, rotation:90},{x:578, y:185, type:3, lock:[0,0,0,0], timer:0, trick:0, rotation:0},{x:577, y:393, type:5, lock:[0,0,0,0], timer:0, trick:0, rotation:180}],
- lines:[{startHub:0, startHubPos:2, endHub:2, endHubPos:3, array:[{x:264, y:598},]},
- {startHub:0, startHubPos:0, endHub:3, endHubPos:3, array:[{x:264, y:185},]},
- {startHub:3, startHubPos:2, endHub:4, endHubPos:0, array:[]},
- {startHub:2, startHubPos:0, endHub:4, endHubPos:2, array:[]},
- {startHub:4, startHubPos:1, endHub:1, endHubPos:3, array:[]}
- ],
- }
- ];
Below is the explanation of each most important array item in 'stage_arr' array:
This is the section where you can edit the stage with the tool by running edit.html. The page start with edit tools, click generate button to export the array when you complete editing, replace the new array in 'stage_arr' in stage.js.
Take note:
- When design the puzzle must at least have one power hub connect to supply hub in order to complete the game, test the game play if it work.
- Always remember to generate the new updated array and replace into 'stage_arr' in stage.js to see the new changes.
This game is build for Desktop browsers that support HTML5 canvas. Any mobile/tablet should work in landscape view, but they are not officially supported.
I've used the following font and sound files as listed.
Check out support policy here.
Wordpress Site
By using Scoreboard for HTML5 Games plugin, you can embed HTML5 game into WordPress post or page.
> Plugin
Help simulate ads on HTML5 Games, you can integrate and display static and takeover ads through different Ads Serving Platform.
> Documentation
Guide you through integrating Facebook Instant Games API in our HTML5 Games.
> Documentation
Once again, thank you so much for purchasing this game, if you have a more general question relating to the games on CodeCanyon, you might consider visiting the item page in the "Support" section.
If you like the game, please take a moment to rate it. Thanks!
demonisblack