And once again

This commit is contained in:
2025-02-18 13:30:48 +01:00
parent 37154955d6
commit 16b06ba642
77 changed files with 581 additions and 199 deletions

View File

@ -0,0 +1,26 @@
extends Node
class_name BulletSpawnerController
# This script shoud be able to find the player
func _get_spawner() -> MultiplayerSpawner:
return $MultiplayerSpawner
func _get_root() -> Node3D:
return $Bullets
# -- TODO: Better bullet naming handler
var bullet_amount: int = -2147483647
func spawn_bullet(starting_point: Node3D, speed: int, damage: int):
var node: Node3D = ResourceLoader.load("res://scenes/weapon/bullet.tscn").instantiate()
node.position = starting_point.global_position
node.transform.basis = starting_point.global_transform.basis
node.name = str(bullet_amount)
node.speed = speed
node.damage = damage
bullet_amount += 1
_get_root().add_child(node)

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://dp1lcbwr7vaq1"]
[ext_resource type="Script" path="res://scenes/maps/base/bullet_spawner/bullet_controller.gd" id="1_pwpt3"]
[node name="BulletSpawner" type="Node3D"]
script = ExtResource("1_pwpt3")
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("res://scenes/weapon/bullet.tscn")
spawn_path = NodePath("../Bullets")
[node name="Bullets" type="Node3D" parent="."]