Code Monkey home page Code Monkey logo

2048's Introduction

2048 Example Skillz iOS Integration

This repository contains an example iOS game that integrates the Skillz SDK. It is intended to supplement the documentation that walks users through the process of integrating an iOS game.

All credits to the design of this game belongs to:

  • Danqing Liu
  • Scott Matthewman
  • Sihao Lu

Original code: https://github.com/danqing/2048

Use governed by the MIT License.

Build Environment

This project integrated the Skillz SDK version 21.0.19 Beta. Check the Downloads page for the latest version.

The project was built on Xcode 10.1. Also, make sure you have the appropriate developer certificate and provisioning profiles so that it can be run on an iOS device. The provisioning profiles need to set the bundle name to com.skillz.examples.2048.

If you are experiencing trouble, please email [email protected] with a detailed description of the issue you are encountering.

Commit Instructions

The commits in this repository have been organized to make the SDK integration easier to follow.

Commit 01: Prepwork for SDK Integration

The first commit makes some preparations before integrating the SDK. Specifically, the UI was altered in anticipation of launching the Skillz SDK, being able to abort a match (the "Restart" button was renamed to "Forfeit"), and removing soon to be dead code.

Commit 02: Install the Skillz SDK

The second commit simply installs the Skillz SDK that was downloaded from the Skillz Developer Portal. This is done by dragging the Skillz.framework file into your XCode project, and adding it to both your Linked Libraries and Embedded Binaries build phases. Refer to the full instructions for more information.

At this point, the game is not integrated with the SDK and still compiles and runs normally.

Commit 03: Getting In and Out of the Skillz SDK

Finally, the Skillz SDK is integrated by following the instructions at this page.

Changes in this commit include:

  • Implementing the SkillzDelegate protocol so that the game is notified when a match will begin.
  • Modifying M2ViewController to launch the Skillz UI after the game's main view has been loaded.
  • Reporting the user's current score while a match is in progress.
  • Reporting the user's final score when the match ends.
  • Aborting a match.

Commit 04: Ensuring Fairness

This commit ensures fairness during a match by calling [Skillz getRandomNumberWithMin: andMax:] when setting a ball's initial direction and force. Refer to this page for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.