Skip to content

helpers

joseph edited this page May 19, 2024 · 3 revisions

Configuration on the Fly

This folder contains helper classes that let you modify configurations or perform calculations at runtime.

Introducing ExecutionContext

Need to change a configuration during runtime? Look no further than the ExecutionContext class! It allows you to:

  1. Adjust the speed of rotating balls
  2. Modify the spawning speed of balls
  3. Access important game elements like the spawned ball or approaching balls

In essence, ExecutionContext provides runtime access to any element's configuration on the screen, making it a powerful tool.

Initialization and Usage

The ExecutionContext class is initialized within the engine class when the application starts. As the engine initializes, it naturally initializes the JobManager and passes the ExecutionContext through it. This ensures that all jobs running on each tick have access to the ExecutionContext.

Key Points

  1. Modify configurations or perform calculations at runtime.
  2. ExecutionContext allows runtime changes to various game elements.
  3. The engine class initializes ExecutionContext and makes it accessible to all jobs.

Introducing Position

The Position class within the aa.engine.helpers package offers a way to represent a 2D location with separate X and Y coordinates. It provides methods to retrieve and modify these values.

Clone this wiki locally