Skip to Main Content
Learning iPhone Game Development with Cocos2D 3.0
book

Learning iPhone Game Development with Cocos2D 3.0

by Kirill Muzykov
June 2014
Beginner to intermediate content levelBeginner to intermediate
434 pages
9h 49m
English
Packt Publishing
Content preview from Learning iPhone Game Development with Cocos2D 3.0

Time for action – displaying highscores with CCTableView

Tables are great for displaying data. We are going to use a table control provided by Cocos2D to display a list of the highest scored points by our players. The table will contain a list of player names and their scores.

Since we are not prompting for the player's name just yet, we are going to display dummy data, and in the next section, we are going to replace it with real highscores.

Let's start:

  1. Open the HighscoresScene.h file and import the cocos2d-ui.h header:
    #import "cocos2d-ui.h"
  2. Then, make the HighscoresScene class conform to CCTableViewDataSource:
    @interface HighscoresScene: CCScene<CCTableViewDataSource>
    
  3. After that, switch to the HighscoresScene.m file and define the constants of the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Swift Games Development for iOS: Develop 2D and 3D games Using Apple's SceneKit and SpriteKit

Beginning Swift Games Development for iOS: Develop 2D and 3D games Using Apple's SceneKit and SpriteKit

James Goodwill, Wesley Matlock

Publisher Resources

ISBN: 9781782160144Supplemental Content