EngineLib Script Integration
I fully replaced the previously hardcoded PlayerMovementSystem with an ObSL script implementation using new EngineLib bindings.
The movement logic is now handled externally through scripting instead of being directly implemented in C++.
New EngineLib Bindings
entity management
Added bindings for basic entity operations:
-
CreateEntityCreates a new entity -
DestroyRemoves an entity -
HasComponentChecks whether an entity has a specific component -
RemoveComponentRemoves a component from an entity
global functions
-
get_dtRetrieves delta time -
CloseWindowCloses the glfw window
Input System
Added script access to input handling:
-
Input_IsKeyDownChecks if a key is currently held -
Input_IsKeyPressedChecks for a key press event -
Input_IsMousePressedChecks if a mouse button is pressed -
Input_GetMouseWorldPosGets the mouse position converted to world space
Movement / Hex Grid Functions
Added bindings for interacting with movement components:
-
GetSelectedHexGets the currently hovered hex tile -
SetPathToHexSets a movement target path for an entity with a MovementComponent
Camera
Added camera manipulation support:
-
Camera_GetPositionGets the camera position -
Camera_SetPositionSets the camera position -
Camera_MoveMoves the camera -
Camera_PanScreenSpaceMoves the camera relative to screen space -
Camera_GetZoomGets the current camera zoom
Hex Rendering
Added bindings for controlling grid visuals:
-
ClearSelectionOverlayClears the hex selection overlay -
ClearPathTargetClears the path target visual marker
ClearPathTargetis currently named poorly. It only clears the grid overlay visualization, not the actual movement target!!!
summary
- Removed the old hardcoded
PlayerMovementSystem - Migrated player movement logic into script format
- Added engine bindings required for script-driven gameplay
- Camera movement, input handling, and hex selection now work through scripts
- Even more gameplay code can now be modified without recompiling the engine :)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.