AIAbstractGamePlayer
class AIAbstractGamePlayer : NSObject, GKGameModelPlayer
An abstract class that represents a game player.
-
The player’s ID (required by GKGameModelPlayer).
Declaration
Swift
var playerId: Int
-
The player’s position in the world.
Declaration
Swift
var position: CGPoint
-
The current costume that the player is wearing.
Declaration
Swift
var currentCostume: PlayerCostumeType
-
Whether the player has deployed a clone.
Declaration
Swift
var deployedClone: Bool
-
Whether the player is carrying items.
Declaration
Swift
var carryingItems: Bool
-
A list of the positions of objects that the player is carrying.
Declaration
Swift
var inventory: [CGPoint]
-
Instantiate an abstract player.
Declaration
Swift
init(at position: CGPoint, with costumes: [PlayerCostumeType])
Parameters
position
The position of the player.
costumes
The list of costumes that the player can wear.
-
Switch to the next available costume.
Declaration
Swift
func nextCostume()
-
Switch to the previous available costume.
Declaration
Swift
func prevCostume()