struct Character

Overview

Represents the player's character in the game. The character is serializable and any fields annotated with YAML::Field will persist between saves.

You can extend this for additional functionality.

Example:

We could add a skill field to the character.

struct Character
  @[YAML::Field(key: "skill")]
  property skill : Int32 = 0
end

The new skill field can now be utilized in a Scene or Command.

Included Modules

Defined in:

engine/character.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(name) #

[View source]

Instance Method Detail

def name : String #

[View source]
def name=(name : String) #

[View source]