GameHeavyObject

class GameHeavyObject : GameTileSpriteNode

A class representation of a heavy object in the game.

Heavy objects can be manipulated by the player when wearing the sorceress costume.

  • Whether the object is being carried by the player.

    Declaration

    Swift

    public var carrying: Bool { get }
  • Whether the object can be carried by the player. Defaults to true.

    Declaration

    Swift

    public var canBeCarried: Bool
  • Initialize a heavy object.

    Declaration

    Swift

    public init(with texture: String, at location: CGPoint)

    Parameters

    texture

    The texture name of the heavy object.

    location

    The matrix location of the heavy object.

  • Required initializer for this class. Will result in a fatal error if you initialize the object this way.

    Declaration

    Swift

    required init?(coder aDecoder: NSCoder)
  • Attach the heavy object to the player.

    Declaration

    Swift

    public func attach(to player: Player?)

    Parameters

    player

    The player object to attach to.

  • Resign the attachment status from the player.

    Declaration

    Swift

    public func resign(from player: Player?)

    Parameters

    player

    The player object to detach or resign from.