Questions tagged [gameplay-kit]

Apple's GameplayKit framework provides pathfinding, goal-based movement, rulesystems, entity-component systems, finite state machines and random distribution classes for game developers. Also included is a class and related protocols for building turn-based AIs based on minmax tree search. Available for iOS 9 and OS X 10.11.

190 questions
0
votes
2 answers

GKEntity not being identified

I'm re-using the approach used in DemoBots for contact detection. I've come across a problem because of a difference between how my code works and how DemoBots is written. In DemoBots, the component RenderComponent has a variable 'node' let node =…
Shane O'Seasnain
  • 3,534
  • 5
  • 24
  • 31
0
votes
1 answer

Placing SKPhysicsContact within a GKComponent

At the moment, I use SKPhysicsContact to trigger a change in behaviour for my sprites, from within the GameScene. The problem is with each development, the game scene becomes longer and longer. Has anyone managed to make a GKComponent with…
Shane O'Seasnain
  • 3,534
  • 5
  • 24
  • 31
0
votes
1 answer

Program getting confused between GKAgent2D position and SpriteKit position

I'm using GameplayKit and Swift. In my agent's move component, I'm running agentWillUpdate: but get an error "Cannot invoke initialiser for type 'Float2' with an argument list of type '(CGPoint)'" on the line where position is…
Shane O'Seasnain
  • 3,534
  • 5
  • 24
  • 31
0
votes
1 answer

Keeping SKNodes upright with GameplayKit

I'm working on a SpriteKit game with animal characters. The animals move left and right across the screen using agents from GameplayKit. They follow an invisible agent that goes from one side of the screen to the other. This works ok except that…
Shane O'Seasnain
  • 3,534
  • 5
  • 24
  • 31
0
votes
1 answer

NSCoding and GameplayKit Classes

In my game I have a NSCoding-conforming Combat class, which also uses GameplayKit's GKGridGraph and GKGridGraphNode objects, which do not conform to NSCoding. Is there a way to serialize/unserialize these objects?
Rhuantavan
  • 445
  • 3
  • 17
0
votes
0 answers

Entity-Component communication correctness

I am writing a game following an Entity Component-style design pattern, and have run into an issue I have been able to solve, but am not sure if it is a best practice (or if there even is such a thing). I have a state machine that handles the main…
diatrevolo
  • 2,782
  • 26
  • 45
-1
votes
1 answer

GKRTree doesn't want to work at all, any other similar method?

I'm making a game, where i need to define the object in the radius of the explosion in certain radius. Firstly, i was making it through distance between all objects, but i saw that there is GKRTree class in GameplayKit. But after many tries, it…
dandand
  • 3
  • 1
  • 4
-1
votes
1 answer

Initialising a set of dice - using dropValuesWithCount on a GKARC4RandomSource

I'm initialising a set of dice in swift 2.0. I've declared a class Die with a name (:String), a list of states(:[String]) and a face (an index to the states array) (:[Int]) As per the recommendations in the GameplayKit Framework Reference and in…
Paul A.
  • 11
  • 5
-1
votes
3 answers

Entity/Component concepts of GameplayKit

I am designing my game with Entity/Component concepts of GameplayKit in iOS 9, for ShootComponent, should define bullet/missile as Entity? Reason for Yes: separate logic from its parent, e.g. playerTank or enemyTank; if not, TankEntity need…
Robin
  • 81
  • 6
-3
votes
1 answer

Swift 3.0 online tutorial error to type [String]

I am new to programming in general. I decided to learn through online tutorials and have been following a tutorial on Youtube creating a game of a space like (bootleg galaga). I checked everything and I am not sure what I am doing wrong or if there…
Shakur
  • 3
  • 3
1 2 3
12
13