Deployment Instructions
- DeploymentGuide-CITYB-UILDER-GAME.pdf : this doc.
- src folder
- Sample Data Code City2
- Sample Date Code City1
Use the following package to install Lightning app.
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t36000000WSRo
As part of this challenge following files added and updated:
Following VF pages are update to support the requirement changes.
-
CB_Home: Showing city map with Quadrants and Blocks. -
CB_Play: Page showing selected block with Story question and answer options to play. -
CB_Leaderboard: Showing Game user order by budget with search functionality. -
CB_Templates: Template supporting dynamic loading of content.
Following apex classes are update (few blank classes provided as part the challenge assert)
CB_HomeController: Home controller class holding logic to laod cities and there related records to show on city Map.CB_HomeControllerTest: This class contains unit tests for validating the behavior of CB_HomeController Apex classesCB_LeaderboardController:Class holding method to get the list of all user to show on leader board UICB_LeaderboardControllerTest: This class contains unit tests for validating the behaviour of CB_LeaderboardController Apex classesCB_PlayController:Class holding logic to play for a selected block. The logic checks if selected block is valid to play or notCB_PlayControllerTest: This class contains unit tests for validating the behavior of CB_PlayController Apex classesCB_TestData: Class holding static method to create test data used by test classesCB_Utils: Utility class holding static utility method used on Home, Leaderboard and Play controller.
Overall code coverage is 92% above.
-
GameUser:Added a new rollup field “Blocks Completed”
Blocks Completed CB_Blocks_Completed__c Roll-Up Summary (COUNT User Block) -
Quadrant:Added a new field “Sequence” to allow user adding quadrant sequence.
Sequence CB_Sequence__c Number(18, 0)
####Static Resource:
CB_Base (updated):Updated CB_Base following two js files:- Script.js
- citymap.js
-
Use the above give packages to install the application in you org..

-
Once you done with successfully installing the application, you can go ahead create some basic data.

-
Creating some sample date:
City record is the main record that we need to create before creating any other records.
- Create city1 record with Image URl as “CB_City_0”_
- _Create city2 record with Image URl as “CB_City_1”
Once done with creating the city records you can use the sample “
Sample Date Code City1” and “Sample Data Code City2” files to create the other related data quickly.Copy past the code from these file to developer console “Anonymous Block” and update the city id. Set the start (start index as zero) and end (end index can by any number of quadrants you what to create) for the for loop and execute the code. It will create quadrants, blocks, stories, solution options. Refer to screen cast video for more detail.
-
Launching the app –
You can launch the game using the “Game” tab.
If you are logged in the demo org using the credentials provided as part of this challenge. Can use
following URL to directly access the app.
demo+user107@gmail.com topcoder#123
https://c.na30.visual.force.com/apex/CB_Home
Refer to the screen cast video for the overall function walk through.
As part of this challenge, the focus is on Home, Play and Leaderboard pages.
This the home page loaded with the city to play on clicking the “Game” tab.
User can hove over the block to view its cost. Blocks not played or completed will only show the cost and can be selected for playing.
Clicking the active block will take the user to Play page with selected block story question and related answer options to answer.
user can select the answer and move forward.
Correct answer will add amount to budget and wrong will reduce the budget amount.
A BRIEF DESCRIPTION OF THE GAME A user is allocated a budget, and he tries to build his city A city has several quadrants A Quadrant has upto 4 blocks.
Each block has a cost. The gamer has to pay the cost to answer a question a block.
Each Block contains 1 question (called stories), with usually 3 answers.(Best, OK, Bad)
User gains money by answering correctly or loose money by giving incorrect answers.There is no change when the user gives ok answers.
Leaderboard show top game user based on the budget. Game user having more budget will be having higher rank.
User can search for game user using the search box based user name and titile.
http://screencast.com/t/JsV0bXUcV
http://screencast.com/t/qJaggsZ5mg
topcoder#123



