Username or E-mail
Password (Forgot?)
New? Sign Up
Join or Sign In
Forums Stencylpedia Stencyl TV Translations Go Pro - Plans & Pricing Download Stencyl


Switch to Book Layout

1: Getting Started

  • Getting Started
  • Crash Course
  • Crash Course 2
  • StencylForge

2: Building Logic

  • What is a Behavior?
  • Creating a Behavior
  • Attributes
  • Game Attributes
  • Attribute Types
  • Events
  • Our Behaviors

3: Actors

  • What are Actors?
  • Animations
  • Motion & Forces
  • Physics
  • Controls
  • Collisions & Groups
  • Killing vs. Recycling
  • Tweening
  • Effects
  • Chapter 3 Challenge

4: Scenes

  • Scene Basics
  • The Camera
  • Tilesets
  • Regions
  • Drawing Text & HUDs
  • Changing Scenes
  • Music, Sounds & Channels
  • Backgrounds
  • Customizing Actors
  • Chapter 4 Challenge

5: Game Mechanics

  • Saving
  • Pausing
  • 3rd Party Services
  • Web Requests

6: Advanced Topics

  • Get/Set Attributes
  • Custom Events
  • Blending Modes
  • Lists
  • Custom Blocks
  • Continuous Collisions

7: Testing & Tuning

  • Testing Games
  • Optimizing Performance 1
  • Optimizing Performance 2

8: The Last 10%

  • Flash Publishing
  • Standalone Apps
  • iOS App Store
  • Chrome Store
  • Making Money

M1: Mobile - Intro

  • Getting Started
  • Testing on your Device
  • Flash -> iOS Guide

M2: Mobile - Basics

  • Atlases
  • Drawing Text
  • Retina Display
  • Accelerometer
  • Joystick
  • Universal Games

M3: Mobile - Services

  • iAds
  • Game Center
  • In-App Purchases

M4: Mobile - Publishing

  • Debugging
  • Publishing to the App Store
  • Optimizing Performance
  • Promoting your Game

A: Troubleshooting

  • Showstoppers
  • General FAQ
  • iOS FAQ
  • The 90% Memory Warning
  • Recovering Broken Games
  • Can't Export to SWF
  • Reloading Documents
  • Generating Logs
  • Flash Security Settings
  • How to Report Bugs

B: How-To Guides

  • Importing Assets
  • Scene Designer
  • Code Mode
  • Font Editor
  • Pencyl (Image Editor)
  • Tile Editor (Shapes)
  • Game Cleaner

C: Reference

  • Glossary
  • Block Reference
  • Useful Shortcuts
  • Stencyl API

D: Resources

  • Stencyl TV
  • Abigayl's Guides
  • Giving Critiques
  • Creating Extensions
  • Translating Stencyl
  • Credits

3.0 Drafts (In Progress)

  • What's New in Stencyl 3.0?
  • Setup (Android)
  • Setup (Desktop)
  • Setup (iOS) - Concepts
  • Setup (iOS) - Mac
  • Setup (iOS) - Windows
  • Testing iOS on Windows
  • iOS Troubleshooter

  • Mobile App Scaling
  • Full Screen Mode
  • Simple Physics
  • Backgrounding an App

  • iOS App Store
  • Mac App Store
  • Windows Store
  • Google Play
  • HTML5

  • Android Ads
  • Android Purchases (WIP)
  • 4" Form Factor (iPhone 5)
  • Mobile Input
  • Mobile Features

  • Extending the Engine
  • iOS / Android Extensions
  • Developing the Official Extensions
  • Developing the Engine

  • iAds (Revised)
  • Game Center (Revised)
  • iOS Purchases (Revised)
  • Atlases (Revised)
  • Drawing Text (Revised)
  • Joystick (Revised)
  • Accelerometer (Revised)
  • Sounds (Revised, WIP)
  • Debugging (Revised, WIP)
  • iOS Performance (Revised)
Level: Beginner

Game Center

Contents

  • Introduction
  • Starting Game Center
  • Reporting High Scores
  • Reporting Achievements
  • Displaying Boards
  • Troubleshooting

 

Introduction

Game Center is an Apple-operated service that records high scores, achievements, and charts these types of stats against those of friends and acquaintances. If you’re familiar with XBox Live, it’s similar.

For Stencyl, we’re primarily interested in getting games to display and submit high scores and achievements.

Note: For brevity, we’ve assumed that you’ve set up Game Center in iTunes Connect - otherwise none of the following will work. If you have not done that, read this article (starting at Step 5) for details.

 

Starting Game Center

You must start the Game Center service through a behavior before using it. You want to do this as early as possible, preferably at the start of the game.

For example, create a behavior that uses the following block (located under Game > Mobile) and add it to your starting scene. 

When the Game Center bar appears, the player is signed in. 

You can check for this status using the following block, or you can use an Event (Add Event > Mobile > Game Center > Game Center is started) if you wish to be notified when this happens.


Reporting High Scores

To submit a score, use the block shown below (located under Game > Mobile). The ID is the Leaderboard ID you specified on iTunes Connect. The value should always be a number.

Note: Submitting a score does *not* pause the game. If you'd like to pause the game, consider using a Game Center event (Add Event > Mobile > Game Center > Game Center receives a score)

 

Reporting Achievements

To submit an achievement, use the block shown below (located under Game > Mobile). Use the Achievement ID you specified on iTunes Connect. The value must be between 0 - 100 inclusive.

Note: Submitting an achievement does *not* pause the game. If you'd like to pause the game, consider using a Game Center event (Add Event > Mobile > Game Center > Game Center receives an achievement)

 

Displaying the High Score and Achievements Boards

Displaying the high score or achievements board involves the following blocks (located under Game > Mobile). Like before, in the leaderboard case, you want to specify the Leaderboard ID entered into iTunes Connect.

Using these blocks in a behavior will cause the boards to slide in.

 

Troubleshooting

Scores and Achievements not showing up?

Sometimes you have to wait a few hours for the data to show up in Game Center. This seems to afflict those in Europe most frequently.

Another common cause is that sometimes, Game Center requires that at LEAST 2 players need to submit scores for the board to show up at all.



Last Updated: 2013-04-10 by Jon

6381 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game, please ask a question on the forums. Thanks!
4 Comments
baberuth
I can't get the leaderboard to launch on the iPad without crashing my game. Any ideas?

Also, the leaderboard almost always goes to my default leaderboard instead of the leaderboard for the specified ID.

0 2 weeks, 1 day ago
Jon
Cleaned up and updated for Stencyl 3.0.
0 1 month, 1 week ago
Jon
That's correct. You use the ID of the board. It's coincidental that the names used above looked like real names, but were in fact IDs.
0 9 months, 3 weeks ago
h1rnz1lla
Hello!

I had no luck displaying the right Leaderboard with using its name, like described above. But using the ID of the board instead fixed the issue!


0 11 months ago



Commenting Guidelines

Sign In to Comment

Make Games

  • What is Stencyl?
  • Roadmap
  • Pricing

Play

  • Arcade
  • Showcase

Community

  • Forums
  • Chat
  • Translations

Help

  • Stencylpedia
  • Stencyl TV

About Us

  • Blog
  • Contact Us
  • Press
  • Privacy
Follow Stencyl on Twitter



© 2013 Stencyl, LLC.