Skip to content

Make Repel action a bit more generic#2088

Draft
manuq wants to merge 6 commits intomainfrom
abilities-prototypes
Draft

Make Repel action a bit more generic#2088
manuq wants to merge 6 commits intomainfrom
abilities-prototypes

Conversation

@manuq
Copy link
Copy Markdown
Collaborator

@manuq manuq commented Mar 26, 2026

The repel mechanic was initially intended for the ink blobs, then to any projectile. But we can now consider a repel action that affects more game elements.


Helps #2059

@github-actions
Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/endlessm/abilities-prototypes/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@manuq manuq force-pushed the abilities-prototypes branch 2 times, most recently from 6c335a0 to 0f013fe Compare March 26, 2026 21:59
manuq added 2 commits March 27, 2026 13:44
Similar to the "hookable" layer. To make the repel mechanic a bit more generic.

Update the enum and the references in eldrune StoryQuest.
Otherwise adding a RigidBody2D to the scene, the bodies go down
until they hit a wall.

Setting the default gravity to zero, the object looks like it's on
the ground.
@manuq manuq force-pushed the abilities-prototypes branch 2 times, most recently from 31d9bd2 to 2b85c96 Compare March 27, 2026 18:07
@manuq manuq changed the title Abilities prototypes Make Repel action a bit more generic Mar 27, 2026
That has a got_repelled() method.

So far we've been assuming a Projectile node for the on_body_entered handler of the Repel area.
But the Area2D.body_entered signal is sent with the body: Node2D parameter (which in reality
can be a PhysicsBody2D or a TileMap).

So use duck typing and also rename the expected method to "got_repelled". Also, call it
with the direction of the repel. Previously the Player was passed and the repel direction
was calculated on the called node.

This makes the repel ability more generic.

Also adapt the eldrune_projectile.gd script.
@manuq manuq force-pushed the abilities-prototypes branch from 12a60c1 to fd2f9c8 Compare March 27, 2026 18:18
manuq added 3 commits March 27, 2026 15:34
Pressing the Test button was failing with:
```
Invalid access to property or key 'device_index' on a base object of type 'Node (input_helper.gd)'.
```

And in any case, the vibration of the joypad while working in the editor is not desired.
And show warning in the editor when the target is not set.
@manuq manuq mentioned this pull request Mar 27, 2026
@manuq manuq force-pushed the abilities-prototypes branch from fd2f9c8 to a7e99a6 Compare March 27, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant