diff options
Diffstat (limited to 'godot/scenes/environment')
| -rw-r--r-- | godot/scenes/environment/BallBarrel.gd | 3 | ||||
| -rw-r--r-- | godot/scenes/environment/Water.gd | 4 | ||||
| -rw-r--r-- | godot/scenes/environment/Water.tscn | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/godot/scenes/environment/BallBarrel.gd b/godot/scenes/environment/BallBarrel.gd index 80b721e..6ad3a22 100644 --- a/godot/scenes/environment/BallBarrel.gd +++ b/godot/scenes/environment/BallBarrel.gd @@ -3,6 +3,9 @@ extends RigidBody const balls_max = 100 onready var balls_left = balls_max +func _ready(): + add_collision_exception_with(owner) + func use_generic(player: NetChar) -> void: if balls_left > 0 and player.inventory["cannonball"] < player.inventory_caps["cannonball"]: player.inventory["cannonball"] += 1 diff --git a/godot/scenes/environment/Water.gd b/godot/scenes/environment/Water.gd index 6fd4dc2..54bb237 100644 --- a/godot/scenes/environment/Water.gd +++ b/godot/scenes/environment/Water.gd @@ -9,5 +9,9 @@ func create_splash(pos, size): func _on_WaterArea_body_entered(body): if body.has_method("extinguish"): body.extinguish() + if body.has_method("enter_water"): body.enter_water() #print(body.get_aabb().get_area()) create_splash(body.global_transform.origin, 1.5) + +func _on_WaterArea_body_exited(body): + if body.has_method("exit_water"): body.exit_water() diff --git a/godot/scenes/environment/Water.tscn b/godot/scenes/environment/Water.tscn index 8b7718b..c73e3c3 100644 --- a/godot/scenes/environment/Water.tscn +++ b/godot/scenes/environment/Water.tscn @@ -111,3 +111,4 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 ) shape = SubResource( 4 ) [connection signal="body_entered" from="WaterArea" to="." method="_on_WaterArea_body_entered"] +[connection signal="body_exited" from="WaterArea" to="." method="_on_WaterArea_body_exited"] |
