RobotKit API
|
Class that represents a SpheroWorld achievements and handles achievement tracking. More...
#import <RKAchievement.h>
Static Public Member Functions | |
(void) | + recordEvent: |
(void) | + recordEvent:withCount: |
Properties | |
NSString * | name |
NSString * | description |
NSString * | img |
int | count_required |
float | percentComplete |
int | points |
Achievements will need to be created and setup on the SpheroWorld website. In order to use achievements in your application you will need to properly set your appID and secret using the RKSpheroWorldAuth class when your application starts. This will also ensure that driving stats such as distances, drive times, color changes and boosts will be tracked on the users SpheroWorld profile.
Achievement meta data and progress will automatically be loaded from SpheroWorld if the user is logged in. Use the RKSpheroWorldAuth class to present a user with a login screen.
Register for the RKAchievementEarned notification to know when an achievement has been earned.
Call the recordEvent class method to update achievement progress as events in your game happen.
If you would like to track drive times, distances or color changes to give users achievements you may register for the RKDriveTimeNotification, RKDriveDistanceNotification or RKDriveColorNotification. The recordEvent class method can then be called from your code to give users progress towards achievements in a method appropriate to your game.
+ (void) recordEvent: | (NSString *) | name |
Call to record an event related to an achievement, this call records the event with a count of 1
name | the event name that was entered on SpheroWorld when creating achievements |
+ (void) recordEvent: | (NSString *) | name | |
withCount: | (int) | count | |
Call to record an event related to an achievement and specify a number of times it happened
name | the event name that was entered on SpheroWorld when creating achievements |
count | the number of times to record that the event happened |
- (int) count_required [read, write, assign] |
The number of times the associated event must be recorded to earn the acheivement
- (NSString *) description [read, write, retain] |
The human readable description of the achievement entered on SpheroWorld
- (NSString *) img [read, write, retain] |
The URL where the image associated with this achievement can be downloaded from
- (NSString *) name [read, write, retain] |
The human readable name of the achievement entered on SpheroWorld
- (float) percentComplete [read, write, assign] |
How close the user is to earning the achievement 0.0-1.0
- (int) points [read, write, assign] |
The number of points this achievement is worth.