Coder Social home page Coder Social logo

skwatch-game's Introduction

SpriteKit Rotating Triangle

Sample applications showing how to use SpriteKit on watchOS

  • Objective-C
  • RubyMotion

Requirements

  • show a triangle on the screen using a PNG
  • rotate the triangle
  • tap on the screen to start/stop the rotation

How to run

Objective-C

  • Open the project with XCode and press cmd+r
open objective-c/SKWatch.xcodeproj

RubyMotion

  • Pair a Apple Watch Series 2 - 42mm to a simulator

  • Enter the project directory

cd rm/skwatch
  • Install main app (iOS) dependencies
bundle
  • Enter the watch app (watchOS) directory
cd sk_watch_game
  • Install the watch app dependencies
bundle
  • Go back to the main app directory
cd ..

Run the main app (iOS)

[bundle exec] rake
May need to specify the iOS device id/name.
[bundle exec] rake device_name='iPhone 8'

Run the watch app (watchOS)

[bundle exec] rake watch
May need to specify the iOS device id/name that contains the previously paired
Series 2 watch.
[bundle exec] rake watch device_name='iPhone 8'

Notes

  • The Objective-C version was created from the iOS SpriteKit template. In the same project, the watchOS SpriteKit template was added as a new target.
  • The Objective-C version contains a shared TriangleNode class used by the iOS and watchOS apps
  • The RubyMotion version contains a shared TriangleNode class used by the iOS and watchOS apps as well
  • The RubyMotion version contains a shared TriangleRotationScene(rm/skwatch/shared/scenes/triangle_rotation_scene.rb) with the base code for adding the triangle PNG node and SKAction. A toggleRotateAction method also toggles the rotation SKAction of the TriangleNode.
  • The RubyMotion version iOS app contains a GameController without the use of storyboards. A GameController instance is created and assigned as the rootViewController in the app delegate.
  • The Objective-C and RubyMotion versions contain the same SpriteKit game scenes for both the iOS app and the watchOS app.

skwatch-game's People

Contributors

cmckni3 avatar

Watchers

James Cloos avatar  avatar

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.