Jumpvalley 0.5.0
An app and library that can be used to test and run 3D platformer levels. Currently being made with Godot.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Jumpvalley.Levels.Level Class Reference

This class represents a level that's playable in Jumpvalley.
Each level contains four primary components: interactives, music, static objects, and start point. More details can be found on Jumpvalley's wiki article on Level Layout. More...

Inheritance diagram for Jumpvalley.Levels.Level:
Jumpvalley.Levels.Interactives.Interactive

Public Types

enum  RunState { Stopped = 0 , Paused = 1 , Playing = 2 }
 Indicates the current run state of the level. More...
 

Public Member Functions

 Level (LevelInfo info, Node root, TimeSpan lastElapsedTime, object runner=null)
 Constructs an instance of Level to represent a level corresponding to its info file.
 
Player GetCurrentPlayer ()
 Gets the player instance that this level is running under. Returns the player instance if found, null otherwise.

Player instance is obtained from this level's runner if it's of type LevelRunner.
 
virtual void InitializeInteractive (Node nodeMarker)
 The level's method for initializing each of its Interactives.

This method can be overriden to provide custom logic for initalizing an interactive (e.g. when a level has custom Interactive types).
 
void SendPlayerToCurrentCheckpoint ()
 Sends the player's character to the checkpoint they're currently on.
 
override void Initialize ()
 Level initialization method that initializes the level after the constructor runs, in case such method is needed.
By default, this method is only called once after the object's constructor runs. Initialize() typically shouldn't be called more than once for the same Level instance.
 
override void Start ()
 The level's start method. This method is called every time the user starts or restarts the level, and it's a great place to put code that will be run after initialization, but just before the level starts.
 
override void Stop ()
 The level's stop method. This method is called right after the user stops or exits the level.
 
new void Dispose ()
 Disposes of this Level instance. This method is a great place to free up resources being used by the level instance, especially right before the level itself gets freed from memory.
 
- Public Member Functions inherited from Jumpvalley.Levels.Interactives.Interactive
 Interactive (OffsetStopwatch clock, object runner=null)
 Creates a new instance of Interactive that will run on the given OffsetStopwatch.
 
new void Dispose ()
 Disposes of this Interactive instance. This method is a great place to free up resources being used by the interactive instance, especially right before the interactive itself gets freed from memory.
 

Public Attributes

LevelPackage Package = null
 The LevelPackage that this Level instance belongs to.
 
- Public Attributes inherited from Jumpvalley.Levels.Interactives.Interactive
object Runner
 The object that's running this interactive.
 

Static Public Attributes

static readonly string INTERACTIVES_NODE_NAME = "Interactives"
 
static readonly string MUSIC_NODE_NAME = "Music"
 
static readonly string MUSIC_ZONES_NODE_NAME = "MusicZones"
 
static readonly string PRIMARY_MUSIC_NODE_NAME = "PrimaryMusic"
 
static readonly string STATIC_OBJECTS_NODE_NAME = "StaticObjects"
 
static readonly string CHECKPOINTS_NODE_NAME = "Checkpoints"
 
static readonly string LIGHTING_NODE_NAME = "Lighting"
 
static readonly string LEVEL_DIRECTIONAL_LIGHT_NODE_NAME = "LevelDirectionalLight"
 
static readonly string LEVEL_ENVIRONMENT_META_NAME = "level_environment"
 

Properties

LevelInfo Info [get]
 Information about the level that's specified in the level's info file. This includes things like level ID and full name.
 
Node RootNode [get]
 The root node of the level.
 
Node InteractivesNode [get]
 The node containing the level's interactives.
 
List< InteractiveInteractives [get]
 The list of the level's interactives as instances of the Interactive class.
 
List< InteractiveCheckpointInteractives [get]
 Interactives as instances of the Interactive class that are stored in CheckpointsNode
 
Node Music [get]
 The node containing the level's music.
 
List< MusicZoneMusicZones [get]
 The level's music zones.
 
MusicGroup PrimaryPlaylist [get]
 The level's primary music playlist.
 
Node StaticObjects [get]
 The node containing the level's static objects.
 
Node CheckpointsNode [get]
 The node where the level's checkpoints should be stored.

This can be used as a place to load interactives that should be loaded after interactives placed in InteractivesNode.
 
CheckpointSet Checkpoints [get]
 The object that contains the code handling the level's checkpoints.
 
Node Lighting [get]
 The node where the level's lighting is specified.
 
Godot.Environment LevelEnvironment [get]
 The Godot.Environment specified by the level.
 
DirectionalLight3D LevelDirectionalLight [get]
 The DirectionalLight3D specified by the level.
 
RunState CurrentRunState [get]
 The level's current run state.
 
- Properties inherited from Jumpvalley.Levels.Interactives.Interactive
bool IsInitialized [get, protected set]
 Whether or not Initialize has been called once already.
 
bool IsRunning [get, protected set]
 Whether or not the interactive is running (e.g. after Start has been called).
 
OffsetStopwatch Clock [get]
 The OffsetStopwatch that the Interactive will run on. This stopwatch can be used to synchronize the Interactive's various operations to whatever the current time on this stopwatch is.
 

Detailed Description

This class represents a level that's playable in Jumpvalley.
Each level contains four primary components: interactives, music, static objects, and start point. More details can be found on Jumpvalley's wiki article on Level Layout

.

Member Enumeration Documentation

◆ RunState

Indicates the current run state of the level.

Enumerator
Stopped 

Indicates that the level is not running.

Paused 

Indicates that the level is still running (in the background) but is paused.

Playing 

Indicates that the level is actively running and not paused.

Constructor & Destructor Documentation

◆ Level()

Jumpvalley.Levels.Level.Level ( LevelInfo info,
Node root,
TimeSpan lastElapsedTime,
object runner = null )
inline

Constructs an instance of Level to represent a level corresponding to its info file.

Parameters
infoInfo about the level
rootThe root node of the level to represent
lastElapsedTimeThe most recent amount of elapsed running time that the level left off of
runnerThe object that's running this level. Typically, this should be a LevelRunner.


Member Function Documentation

◆ Initialize()

override void Jumpvalley.Levels.Level.Initialize ( )
inlinevirtual

Level initialization method that initializes the level after the constructor runs, in case such method is needed.
By default, this method is only called once after the object's constructor runs. Initialize() typically shouldn't be called more than once for the same Level instance.

Reimplemented from Jumpvalley.Levels.Interactives.Interactive.

◆ InitializeInteractive()

virtual void Jumpvalley.Levels.Level.InitializeInteractive ( Node nodeMarker)
inlinevirtual

The level's method for initializing each of its Interactives.

This method can be overriden to provide custom logic for initalizing an interactive (e.g. when a level has custom Interactive types).

Parameters
nodeMarkerThe interactive's node marker

◆ Start()

override void Jumpvalley.Levels.Level.Start ( )
inlinevirtual

The level's start method. This method is called every time the user starts or restarts the level, and it's a great place to put code that will be run after initialization, but just before the level starts.

Reimplemented from Jumpvalley.Levels.Interactives.Interactive.

◆ Stop()

override void Jumpvalley.Levels.Level.Stop ( )
inlinevirtual

The level's stop method. This method is called right after the user stops or exits the level.

Reimplemented from Jumpvalley.Levels.Interactives.Interactive.


The documentation for this class was generated from the following file: