Repository navigation
levels
Armin Jodat edited this page May 18, 2024
·
5 revisions
our Levels section is a very important part of our game. The LevelManager class is a crucial component in our Android app responsible for managing game levels. It orchestrates various tasks related to level setup, job management, and gameplay mechanics. Let’s dive into the details:
- The
setupCriticalJobs()function initializes critical game jobs that directly impact gameplay. These include:- OrbitingJob: Manages orbiting behavior.
- MoveUpJob: Handles upward movement.
- SpawnJob: Controls spawning of game elements.
- CollisionJob: Detects collisions.
- WinJob: Determines win conditions.
- OrbitDetectionJob: Detects orbiting events.
- The
setupOptionalJobs()function allows customization by adding optional jobs specific to the current level. These jobs enhance gameplay or introduce unique mechanics.
- The
setup(level: Level)method sets up the level by configuring rotation speed, spawning speed, and critical and optional jobs. - It receives a Level object as input, which contains level-specific information.
- The
clearLevel()method resets the level state by clearing jobs and other relevant data. - It ensures a clean slate for transitioning to a new level.