Description:
A Scene represents a single state or screen in your game,
such as a main menu, level, or editor view. All rendering logic lives
inside the scene’s draw() method, which is automatically
called every frame by the GameEngine.
Without a Scene, nothing is drawn and no game logic can run. Every Vertex game must have at least one active scene.
from VertexEngine.scenes import Scene
class Main(Scene):
def __init__(self, engine):
super().__init__(engine)
def draw(self, surface):
# Put all drawing code here
# Example: draw images, shapes, UI, etc.
pass
__init__() – Initialize scene datadraw(surface) – Called every frame to render visualsupdate(delta_time) – (Optional) Update game logicsurface —
The surface to draw on. All rendering operations for the scene
should be performed on this surface.
None. The scene renders directly to the screen each frame.