Code Monkey home page Code Monkey logo

boxesgameplaykitentity-componentbasics's Introduction

Boxes: GameplayKit Entity-Component Basics

This sample demonstrates how to use GameplayKit’s entity-component feature to create modular, scalable game architecture. It covers the classes GKEntity, GKComponent, and GKComponentSystem.

Structure

The Game object sets up the entities and their components. Each box is represented by an instance of the GKEntity class -- an abstract container for the GKComponent objects that together provide each entity's functionality.

Each box shows the effect of a different combination of the following components:

  • All boxes have a GeometryComponent that manage their SceneKit representation for display and physics simulator.
  • Boxes with a ParticleComponent also display a fiery or sparkly particle effect.
  • Boxes with a PlayerControlComponent jump up into the air when you interact with the scene.

In the Game object's setUpEntities method, try adding a particle or player-control component to the purple box.

Playing the game

Tap anywhere (iOS), press any key (OS X), or click the Siri Remote touch surface (tvOS) to interact with the scene, causing boxes with a PlayerControlComponent to jump.

Requirements

Build

Xcode 7.1, OS X 10.11 SDK, iOS 9.0 SDK, tvOS 9.0 SDK

Runtime

OS X 10.11, iOS 9.0, tvOS 9.0

Copyright (C) 2015-16 Apple Inc. All rights reserved.

boxesgameplaykitentity-componentbasics's People

Contributors

kenwilcox 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.