inching towards better class inheritence and multiplayer compatibility

This commit is contained in:
2023-11-15 15:19:40 +11:00
parent f004f64b71
commit 1500c22ccc
204 changed files with 1920 additions and 1951 deletions

View File

@@ -0,0 +1,16 @@
extends ExplosiveProjectile
class_name BombProjectile
var max_bounces := 1
var bounces := 0
func _ready() -> void:
apply_central_impulse(direction * force)
func _on_body_entered(_body: Node) -> void:
bounces += 1
var collided_body = get_colliding_bodies()[0].get_collision_layer_value(3)
if bounces > max_bounces or collided_body:
explode()