Junk Punk - Game Template

This document should provide all the information you will need to customize the Junk Punk game template, and to get features such as in-app purchases, analytics, advertisements and Game Center working with your own Apple Developer account.

If at any point you're having problems integrating or extending the template, please see the Support section on how to contact us.



Junk Punk app template has the following key features: - Universal, so it works on iPods, iPhones and iPads - Easy configuration through a single file - Supports Analytics out of the box - Supports both Apples iAds and RevMob banner ads - Global Highscores with Game Center - Social media highscore & screenshot sharing with Facebook and Twitter - Done with Apples SpriteKit, so the game performs very well

Thank you for purchasing the Junk Punk game template and supporting independent app and game development!

 

This game template is a simplified version of the popular iOS freerunning game, Junk Punk, which you can find out more about here.

The game mechanics include procedurally generated structures (ie. randomised), as well as the game speed getting increasingly faster the longer you play.

Additionally, the template contains the ability to use either iAd or RevMob advertisements inside the game, to generate revenue for you, as well as Flurry analytics, Game Center support (global highscores) and a single IAP (In-App Purchase) that allows the player to remove advertisements for a set price.

This documentation tries to be as in-depth about the template and it's usage as possible, but it does assume at least some level of familiarity with iOS, XCode and Objective-C, so bare that in mind.

At it's core, the template provides a single file (Common.h) that is used to quickly change specific functionality of the game, like changing advertisement providers or Flurry API keys.

Note: Some features, such as Facebook and Twitter sharing, work automatically without any setup, so we won't go in to any further detail for those. The code is well documented, so you should find your way around the code to get an understanding of how some things work.

This game template requires at least the following:

 

All set? Good, read on.

We'll start by opening the Junk Punk project in XCode. The easiest way to do that would be to double-click the Junk Punk.xcodeproj file.

 

After the project has loaded, navigate to Common.h, as seen in the image below.

 

Next you should probably read the contents of the file thoroughly, as we will go through the most important bits next.

 

The lines that start with a #define statement are used for easier configuration of the game template, so you will definitely need to go through them and replace the predefined values with your own.

Don't worry though, I'll explain what they all do and where you can get your own values from!

 

Note: It is very important that you only change the values inside the double quotes (@"VALUE HERE") and do not modify anything else, unless you know what you are doing.

 

#define kITUNES_APP_ID @"ITUNES_APP_ID_HERE" is used for the "Rate This App" dialog which will automatically prompt your users to rate the app, after a certain amount of uses and time. You can only get an iTunes App ID if you're a registered developer, and if you are, you should have no trouble finding it when you login to iTunes Connect and go to your app page.

 

#define kFLURRY_API_KEY @"FLURRY_KEY_HERE" is used for analytical information and is entirely optional. Analytics is provided by Flurry, so you do need to signup with them to get an API KEY, which is just a string of letters and numbers and is what ties the analytical data to your own app and account. The Junk Punk game template uses Flurry to report a few statistics to your Flurry account, including when a user shares their scores to Facebook or Twitter, or fails doing so.

 

#define kAD_REMOVAL_IAP_ENABLED YES is used to determine whether you want to use an in-app purchase to allow the removal of all advertisements. In this case, you simple need to change the last word to either YES or NO (note the uppercase letters). This also controls whether or not the "Remove Advertisements" button is visible in the Game Over screen.

 

#define kIAP_REMOVEADS_IDENTIFIER @"RemoveAds" is used in conjunction with the previous value/configuration and is what ties the ad removal in-app purchase to the game. The string inside the double quotes needs to match the name of the in-app purchase in iTunes Connect. You can read more about setting that up here.

 

#define kBANNER_AD_PROVIDER @"IAD" is what allows you to choose your advertisement provider. Note that you need to provide the value in ALL CAPS, no lowercase letters allowed. At the time of writing this, the app template supports both Apple's iAds and RevMob's banner ads. iAd doesn't require any additional configuration in the template itself, but you do need to request and sign a contract for iAds in iTunes Connect. In RevMob's case, you need to signup for an account here.

 

#define kREVMOB_APP_ID @"APP_ID_HERE" is used to connect RevMob's banner ads to your app. This is only taken into consideration if you chose REVMOB in the previous value. RevMob recently renamed their "App ID" to "Media ID", so once you signup with them and add an application, look for Media ID instead and just copy and paste it inside the double quotes.

 

#define kGAME_HASHTAG @"#JunkPunk" is a hashtag (or just a word) that is used when sharing the score & screenshot to Twitter or Facebook. Hashtags can be pretty powerful and make it easier for you to search for your game on Twitter or Facebook, so I recommend setting one up.

 

#define kGAME_URL @"http://YOUR-URL-HERE" is a website address that is used to link to your game when sharing to Twitter or Facebook. It makes it much easier for people to discover your game.

 

#define kGAMECENTER_LEADERBOARD_NAME @"Highscore" is the Game Center leaderboard name, which needs to be the same as the one you set up in iTunes Connect, under Game Center and Leaderboards. It is used to globally track users highscores and works pretty much automatically, as long as you configure Game Center correctly in iTunes Connect. You can read more about configuring Game Center here.

 

 

Now that you're done configuring, go ahead and start playing, exploring and modifying the code!

 

The code is very well documented, so you shouldn't have any problems navigating the code and understanding what does what.

Reskinning, or swapping the art with your own, is a bit trickier to do if your own art assets are a lot different from the ones included with the game template, but we will still go through the process here and hope that it works flawlessly for you.

 

 

Changing the background

The background of the game template consists of two parts, an image, named TopHorizon.png, and a predefined color inside JPGameScene.m (line 67).

You can change these as you wish and they should (with any luck) behave nicely. For anything more complicated, you should be more familiar with Objective-C and SpriteKit.

 

 

Changing the player

The player and its animation consists of four different images, that are then played in sequence and looped. The images are named JP_Player_Animation_1.png through JP_Player_Animation_4.png and are all 16 by 16 pixels.

Player animation is done in JPGameScene.m (line 409), if you want to take a closer look at it.

We try to release new versions of the Junk Punk game template whenever there are issues or new features that should be implemented.

If at any point you run in to any issues, or have questions about the template, please feel free to contact us by sending an email to support@didstopia.com, and we will get back to you.