Add pullable actor system, collision checks for push/pull#281
Draft
Dan512 wants to merge 1 commit into
Draft
Conversation
Owner
|
Thanks! I've left a comment on the GB Studio PR chrismaltby/gb-studio#1967 just setting these as drafts for now to prevent merging until I've been able to review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the Engine side of the Push/Pull system
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Feature
What is the current behavior?
Solid actors in Adventure scenes have no built-in push or pull mechanics. The only push that exists is a push animation if a player runs into an actor or wall. Players cannot interact with solid actors to move them around the scene.
What is the new behavior (if this is a feature change)?
Solid actors can now be marked as "Is Pushable" and/or "Is Pullable" via new collision flags. Each has a corresponding feature toggle in the Adventure engine settings.
Push: Player walks into a pushable actor and enters a Push state after a configurable delay. The actor's "On Pushed" script fires each frame, passing direction and hold frame count. A "Push Grace Frames" setting prevents animation flickering during movement. A collision check prevents the script from firing if the actor is blocked.
Pull: Player presses interact while facing a pullable actor, then walks away to pull. The actor's "On Pulled" script fires each frame, passing direction and hold frame count. Collision checks verify both the actor and player have room to move. Recommended to use threads in the pull script to move the player and actor simultaneously.
New conditional events "If Pushed Direction" and "If Pulled Direction" allow scripts to branch based on direction and an optional hold frame threshold.
Depends on GBStudio side changes in a separate PR by Dan512
Does this PR introduce a breaking change?
No. Both features are disabled by default and require opting in via engine settings. Existing projects are unaffected.
Other information:
GB Studio changes (compiler, editor UI, events, and localization) are in a separate PR on the gb-studio repo. This PR covers the adventure.c, gbs_types.h, engine.json