Class TLevelLogic
Unit
Declaration
type TLevelLogic = class(TCastleBehavior)
Description
Level logic.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleBehavior
- TLevelLogic
Overview
Methods
![]() |
function LoadLevelScene(const URL: string; const PrepareForCollisions: boolean; const SceneClass: TCastleSceneClass): TCastleScene; deprecated 'create and prepare TCastleScene instance directly'; |
![]() |
function LoadLevelScene(const URL: string; const PrepareForCollisions: boolean): TCastleScene; deprecated 'create and prepare TCastleScene instance directly'; |
![]() |
function Placeholder(const Shape: TShape; const PlaceholderName: string): boolean; virtual; |
![]() |
procedure PlaceholdersEnd; virtual; |
![]() |
constructor Create(const AOwner: TComponent; const ALevel: TAbstractLevel; const MainScene: TCastleScene; const DOMElement: TDOMElement); reintroduce; virtual; |
![]() |
procedure PrepareNewPlayer(NewPlayer: TPlayer); virtual; |
![]() |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
Properties
![]() |
property Level: TAbstractLevel read FLevel; |
![]() |
property Time: TFloatTime read FTime; |
Description
Methods
![]() |
function LoadLevelScene(const URL: string; const PrepareForCollisions: boolean; const SceneClass: TCastleSceneClass): TCastleScene; deprecated 'create and prepare TCastleScene instance directly'; |
|
Warning: this symbol is deprecated: create and prepare TCastleScene instance directly Load scene from file, doing common tasks.
| |
![]() |
function LoadLevelScene(const URL: string; const PrepareForCollisions: boolean): TCastleScene; deprecated 'create and prepare TCastleScene instance directly'; |
|
Warning: this symbol is deprecated: create and prepare TCastleScene instance directly | |
![]() |
function Placeholder(const Shape: TShape; const PlaceholderName: string): boolean; virtual; |
|
Handle a | |
![]() |
procedure PlaceholdersEnd; virtual; |
|
Called after all placeholders have been processed, that is after TLevel.Load placed initial creatures, items and other stuff on the level. Override it to do anything you want. | |
![]() |
constructor Create(const AOwner: TComponent; const ALevel: TAbstractLevel; const MainScene: TCastleScene; const DOMElement: TDOMElement); reintroduce; virtual; |
|
Create new level instance. Called before resources (creatures and items) are initialized (override PlaceholdersEnd if you need to do something after creatures and items are added). You can modify MainScene contents here.
Parameters
| |
![]() |
procedure PrepareNewPlayer(NewPlayer: TPlayer); virtual; |
|
Called when new player starts new game on this level. This may be used to equip the player with some basic weapon / items. This is never called or used by the engine itself. This does nothing in the default TLevelLogic class implementation. Your particular game, where you can best decide when the player "starts a new game" and when the player merely "continues the previous game", may call it. And you may override this in your TLevelLogic descendants to equip the player. | |
![]() |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
Properties
![]() |
property Level: TAbstractLevel read FLevel; |
|
Level that we are part of. | |
![]() |
property Time: TFloatTime read FTime; |
|
Time of the level, in seconds. Time 0 when level is created. This is updated in our Update. | |
Generated by PasDoc 0.16.0.

