summaryrefslogtreecommitdiff
path: root/godot/scenes/environment
diff options
context:
space:
mode:
authorAnson Bridges <bridges.anson@gmail.com>2022-10-20 13:54:06 -0400
committerAnson Bridges <bridges.anson@gmail.com>2022-10-20 13:54:06 -0400
commitd34c96aa69d2aee1aaa3bb12366b36ff22d674c0 (patch)
tree12c32c2c452922c92d1daf84a4bd5bebb539c204 /godot/scenes/environment
parent6dd265a0aee5fa0ed21b3d272fa3bc07d5d483d9 (diff)
network work work workHEADmaster
Diffstat (limited to 'godot/scenes/environment')
-rw-r--r--godot/scenes/environment/BallBarrel.gd3
-rw-r--r--godot/scenes/environment/Water.gd4
-rw-r--r--godot/scenes/environment/Water.tscn1
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"]