You are browsing as a guest. Sign up (or log in) to start making projects!

2h 44m 6s logged

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:

  • CreateEntity Creates a new entity
  • Destroy Removes an entity
  • HasComponent Checks whether an entity has a specific component
  • RemoveComponent Removes a component from an entity

global functions

  • get_dt Retrieves delta time
  • CloseWindow Closes the glfw window

Input System

Added script access to input handling:

  • Input_IsKeyDown Checks if a key is currently held
  • Input_IsKeyPressed Checks for a key press event
  • Input_IsMousePressed Checks if a mouse button is pressed
  • Input_GetMouseWorldPos Gets the mouse position converted to world space

Movement / Hex Grid Functions

Added bindings for interacting with movement components:

  • GetSelectedHex Gets the currently hovered hex tile
  • SetPathToHex Sets a movement target path for an entity with a MovementComponent

Camera

Added camera manipulation support:

  • Camera_GetPosition Gets the camera position
  • Camera_SetPosition Sets the camera position
  • Camera_Move Moves the camera
  • Camera_PanScreenSpace Moves the camera relative to screen space
  • Camera_GetZoom Gets the current camera zoom

Hex Rendering

Added bindings for controlling grid visuals:

  • ClearSelectionOverlay Clears the hex selection overlay
  • ClearPathTarget Clears the path target visual marker

ClearPathTarget is 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 :)
0
4

Comments 0

No comments yet. Be the first!