feat: implement plasma gun and rocket swarm mechanics along with various 3D asset imports

This commit is contained in:
DottsGit
2026-06-07 18:23:47 -04:00
parent c9f082ebba
commit 4bb867a6f2
50 changed files with 5372 additions and 437 deletions
+10 -37
View File
@@ -14,43 +14,16 @@ func _init() -> void:
spread_angle = 0.01
func _build_model() -> void:
position = Vector3(0.3, -0.3, -0.6)
var grey_mat = StandardMaterial3D.new()
grey_mat.albedo_color = Color(0.25, 0.25, 0.25)
var dark_mat = StandardMaterial3D.new()
dark_mat.albedo_color = Color(0.1, 0.1, 0.1)
# Receiver
var receiver = MeshInstance3D.new()
var rec_mesh = BoxMesh.new()
rec_mesh.size = Vector3(0.05, 0.14, 0.25)
rec_mesh.material = grey_mat
receiver.mesh = rec_mesh
receiver.position = Vector3(0, 0, 0.1)
model_root.add_child(receiver)
# Barrel
var barrel = MeshInstance3D.new()
var b_mesh = CylinderMesh.new()
b_mesh.top_radius = 0.012
b_mesh.bottom_radius = 0.012
b_mesh.height = 0.4
b_mesh.material = dark_mat
barrel.mesh = b_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.04, -0.2)
model_root.add_child(barrel)
# Handguard
var guard = MeshInstance3D.new()
var g_mesh = BoxMesh.new()
g_mesh.size = Vector3(0.06, 0.07, 0.22)
g_mesh.material = dark_mat
guard.mesh = g_mesh
guard.position = Vector3(0, 0.04, -0.1)
model_root.add_child(guard)
position = Vector3(0.3, -0.3, -0.656)
var model_scene = load("res://assets/weapons/m4/source/M4a4.fbx")
if model_scene:
var model = model_scene.instantiate()
model_root.add_child(model)
model.scale = Vector3(0.275, 0.275, 0.275)
model.rotation_degrees.y = 90
for light in model.find_children("*", "Light3D", true, false):
light.queue_free()
# Muzzle Flash
muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.8, 0.4)