KOBUGE-Games / jetpaca

Game about the rocket alpaca (KOBUGE continuation fork)
MIT License
58 stars 16 forks source link

Fluffs / sacra_pinchorbs are too passive/hard to trigger in attack mode #17

Closed akien-mga closed 8 years ago

akien-mga commented 8 years ago

Might be a regression in the logic due to newer Godot version, or maybe they were always like that, but it seems like they don't really behave as designed; they should trigger their attack/spikes mode when the player comes near them. Right now they trigger it only if you hit them on purpose to wake them up, making them hardly a threat.

bojidar-bg commented 8 years ago

For the record, staying near them for around 10-20 seconds (presumably busy with some puzzle) would awake them as well.

akien-mga commented 8 years ago

From what I could see they actually only wake up when touched/moving. It looks like the logic in _integrate_forces only starts processing one the physics are triggered. Strangely enough the RigidBody2D doesn't claim to be sleeping, so so far the only workaround I could find was:

diff --git a/enemies/fluff/fluff.gd b/enemies/fluff/fluff.gd
index 634c7cc..cef447f 100644
--- a/enemies/fluff/fluff.gd
+++ b/enemies/fluff/fluff.gd
@@ -38,6 +38,7 @@ var dead = false
 var spiked_count = 0

 func _on_body_enter_spikes(body):
+       set_linear_velocity(get_linear_velocity()) # Wake up
        if body extends preload("res://player/alpaca.gd"):
                spiked_count += 1