Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to Spritekit and Gameplaykit

Intro to Spritekit and Gameplaykit

SpriteKit is Apple's framework for making 2D games. It has support for sprites and special effects like videos, filters, and masking.

GameplayKit is a framework introduced in iOS 9 that makes implementing many common tasks in your game much easier. GameplayKit is a collection of tools that can help you with features like pathfinding, randomization, state machines, rule systems, and more.

In this introduction, we will focus on Scenes and Nodes of SpriteKit and Agents, Goals, and Behaviors of GameplayKit.

Code can be found at https://github.com/kartikpatel/Combat

Kartik Patel

June 02, 2017
Tweet

More Decks by Kartik Patel

Other Decks in Programming

Transcript

  1. SKView • SKView is placed inside a window • Can

    be combined with view in the hierarchy
  2. SKScene • holds sprites and other content to be rendered

    • implements per-frame logic and content processing • view presents one scene at a time • can us SKTransition to animate between two scenes
  3. last chance to make changes to the scene didFinshUpdate() after

    constraints associated with notes in the scene are applied didApplyContraints() after all physics for the the frame have been simulated, see SKPhysicsBody didSimulatePhysics() called with time elapsed so far in the simulation, primary place to implement your own in-game simulation update(_:) after all actions for the frame have been processed didEvaluateActions() SKScene
  4. SKNode • nodes are the fundamental building blocks for all

    content, with the scene object acting as the root node for a tree of node objects • does not draw annything, but applies it’s properties to it’s descendants • nodes objects are responder objects, descending either from UIResponder or NSResponder
  5. SKTexture • shared images used to render sprites • can

    create textures by loading image files or creating at runtime
  6. SKAction • scene’s contents are animated using actions • when

    the scene processes frames of animation, the actions are executed • actions can span multiple frames
  7. Architect and organize your game logic. Incorporate common gameplay behaviors

    such as random number generation, artificial intelligence, pathfinding, and agent behavior.
  8. GameplayKit areas of functionality robust, flexible implementations of standard algorithms

    Randomization game world as a graph, plan optimal routes Pathfinding reusable gameplay code Entities & Components let game characters move themselves Agents, Goals, Behaviors untangle complex procedural code State Machines Separate game design from code, implement fuzzy logic reasoning Rule Systems model for your turn- based game Minmax