DevJoy.Scene.Challenge (DevJoy v2.0.0)

View Source

Challenge is a polimorfic custom content specific to your game. Challenges can be a mini-game or other custom action that the user must complete to progress in the game.

Usage

The challenge always requires its type. You can also optionally specify additional data.

defmodule MyApp.SceneName do
  use DevJoy.Scene

  part :challenge do
    challenge :challenge_type, some: :data
  end
end

Summary

Field types

The type representing the additional data for the challenge.

The type representing the challenge's type.

Main

The challenge structure contains the following keys

t()

The type representing the challenge structure.

Field types

data()

@type data() :: Keyword.t()

The type representing the additional data for the challenge.

type()

@type type() :: atom()

The type representing the challenge's type.

Main

%DevJoy.Scene.Challenge{}

(struct)

The challenge structure contains the following keys:

  • data - a keyword list of additional data for the challenge
  • type - the type of the challenge

t()

@type t() :: %DevJoy.Scene.Challenge{data: data(), type: type()}

The type representing the challenge structure.