Table of Contents

Class GameScene

Namespace
Gloam.Demo.Scenes
Assembly
gloam-demo.dll

Game scene with game-specific layers

public sealed class GameScene : BaseScene, IScene
Inheritance
GameScene
Implements
Inherited Members

Constructors

GameScene()

public GameScene()

Properties

PlayerPosition

Gets the current player position

public Position PlayerPosition { get; }

Property Value

Position

Methods

ActivateSceneAsync(CancellationToken)

Override this method to implement scene-specific activation logic. Default implementation does nothing.

protected override ValueTask ActivateSceneAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Cancellation token

Returns

ValueTask

DeactivateSceneAsync(CancellationToken)

Override this method to implement scene-specific deactivation logic. Default implementation does nothing.

protected override ValueTask DeactivateSceneAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Cancellation token

Returns

ValueTask

HandlePlayerInput(IInputDevice, int, int)

Handles player movement input with throttling

public void HandlePlayerInput(IInputDevice inputDevice, int screenWidth, int screenHeight)

Parameters

inputDevice IInputDevice

Input device to check for movement keys

screenWidth int

Screen width for bounds checking

screenHeight int

Screen height for bounds checking

MovePlayer(Position, int, int)

Moves the player to a new position, with bounds checking

public void MovePlayer(Position newPosition, int screenWidth, int screenHeight)

Parameters

newPosition Position

The new position to move to

screenWidth int

Screen width for bounds checking

screenHeight int

Screen height for bounds checking

ReturnToMenuAsync(CancellationToken)

public ValueTask ReturnToMenuAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

ValueTask

SetSceneManager(ISceneManager)

public void SetSceneManager(ISceneManager sceneManager)

Parameters

sceneManager ISceneManager

UpdateSceneAsync(CancellationToken)

Override this method to implement scene-specific update logic. Default implementation does nothing.

protected override ValueTask UpdateSceneAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Cancellation token

Returns

ValueTask