|
| | LevelScene (Game *game, const unsigned int stage, const unsigned int prevScore, std::optional< uint32_t > mapSeed=std::nullopt) |
| | Construct a shared level scene scaffold.
|
| |
| void | onEnter () override |
| | Called when scene become activated.
|
| |
| void | onExit () override |
| | CAlled when scene become deactivated.
|
| |
|
FieldTransform | getFieldTransform () const |
| | Returns the field transform needed to map tile-Q8 world coords to screen pixels.
|
| |
| virtual void | onEvent (const SDL_Event &event) override |
| | Catch SDL2 events.
|
| |
| virtual void | update (const unsigned int delta) override |
| | Update level scene.
|
| |
|
void | clearLocalMovementInput () |
| | Clears locally held movement input and resets player facing/animation state.
|
| |
| virtual bool | usesEventDrivenLocalMovement () const |
| | Returns true when this level consumes SDL key press/release events as local movement state.
|
| |
| | Scene (Game *game) |
| | Construct a new Scene object.
|
| |
|
virtual | ~Scene () |
| | Destroy the Scene object.
|
| |
| void | addObject (std::shared_ptr< Object > object) |
| | Add object to scene for drawing.
|
| |
| void | insertObject (std::shared_ptr< Object > object, int position) |
| | Add object to scene for drawing to specific position.
|
| |
| void | removeObject (std::shared_ptr< Object > object) |
| | Remove object from scene.
|
| |
| void | setCamera (const int x, const int y) |
| | Set the Camera object to specific position.
|
| |
|
void | draw () const |
| | Draw objects on the screen.
|
| |
|
SDL_Rect | getCamera () const |
| | Returns the current camera position.
|
| |
| virtual bool | wantsNetworkInputPolling () const |
| | Returns true when this scene wants Game to poll and send multiplayer input every sim tick.
|
| |
| virtual void | onNetInputQueued (uint32_t inputSeq, uint8_t buttons) |
| | Called after Game samples and queues a local input for multiplayer scenes.
|
| |
|
|
void | initializeLevelWorld (std::optional< uint32_t > mapSeed) |
| | Completes shared world setup after derived state is ready.
|
| |
|
void | generateTileMap (std::optional< uint32_t > mapSeed) |
| |
|
void | spawnGrass (const int positionX, const int positionY) |
| |
|
void | spawnBrick (const int positionX, const int positionY) |
| |
|
void | spawnStone (const int positionX, const int positionY) |
| |
|
void | spawnPlayer (const int positionX, const int positionY) |
| |
|
virtual void | onCollisionObjectSpawned (Tile tile, const std::shared_ptr< Object > &object) |
| | Allows derived scenes to collect collision objects during map spawn.
|
| |
|
void | updateMovement (const bool isPressed, const int keycode) |
| |
|
void | updateCamera () |
| |
| virtual void | updateLevel (const unsigned int delta)=0 |
| | Per-mode update body executed when the scene is not paused.
|
| |
| virtual void | onKeyPressed (SDL_Scancode scancode) |
| | Optional per-mode key-down handling.
|
| |
| virtual bool | supportsPause () const |
| | Whether ENTER pause toggle is enabled for this level mode.
|
| |
|
void | stepLocalPlayerMovement () |
| | Steps the local player position by one simulation tick.
|
| |
|
void | syncPlayerSpriteToSimPosition () |
| | Writes playerPos_ to the player sprite in screen space.
|
| |
|
void | setLocalPlayerPositionQ (sim::TilePos posQ) |
| | Replaces the canonical local player position and syncs the sprite immediately.
|
| |
Shared level-scene scaffold used by both singleplayer and multiplayer.