RobotKit API
Static Public Member Functions | Properties
RKAchievement Class Reference

Class that represents a SpheroWorld achievements and handles achievement tracking. More...

#import <RKAchievement.h>

List of all members.

Static Public Member Functions

(void) + recordEvent:
(void) + recordEvent:withCount:

Properties

NSString * name
NSString * description
NSString * img
int count_required
float percentComplete
int points

Detailed Description

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.

See also:
RKSpheroWorldAuth

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.

See also:
RKSpheroWorldAuth

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.


Member Function Documentation

+ (void) recordEvent: (NSString *)  name

Call to record an event related to an achievement, this call records the event with a count of 1

Parameters:
namethe 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

Parameters:
namethe event name that was entered on SpheroWorld when creating achievements
countthe number of times to record that the event happened

Property Documentation

- (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.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties