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
+24 -49
View File
@@ -16,55 +16,30 @@ func _init() -> void:
projectile_gravity = 5.0 # Slight drop
func _build_model() -> void:
position = Vector3(0.3, -0.3, -0.6)
var yellow_mat = StandardMaterial3D.new()
yellow_mat.albedo_color = Color(0.8, 0.7, 0.1) # Construction yellow
var dark_mat = StandardMaterial3D.new()
dark_mat.albedo_color = Color(0.2, 0.2, 0.2)
# Body
var body = MeshInstance3D.new()
var b_mesh = BoxMesh.new()
b_mesh.size = Vector3(0.06, 0.16, 0.25)
b_mesh.material = yellow_mat
body.mesh = b_mesh
body.position = Vector3(0, 0.02, 0)
model_root.add_child(body)
# Handle
var handle = MeshInstance3D.new()
var h_mesh = BoxMesh.new()
h_mesh.size = Vector3(0.04, 0.1, 0.04)
h_mesh.material = dark_mat
handle.mesh = h_mesh
handle.position = Vector3(0, -0.1, 0.05)
model_root.add_child(handle)
# Mag (Nail Drum)
var drum = MeshInstance3D.new()
var d_mesh = CylinderMesh.new()
d_mesh.top_radius = 0.05
d_mesh.bottom_radius = 0.05
d_mesh.height = 0.1
d_mesh.material = dark_mat
drum.mesh = d_mesh
drum.rotation.z = deg_to_rad(90)
drum.position = Vector3(0, -0.06, -0.05)
model_root.add_child(drum)
# Barrel
var barrel = MeshInstance3D.new()
var bar_mesh = CylinderMesh.new()
bar_mesh.top_radius = 0.01
bar_mesh.bottom_radius = 0.01
bar_mesh.height = 0.15
bar_mesh.material = dark_mat
barrel.mesh = bar_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.05, -0.2)
model_root.add_child(barrel)
position = Vector3(0.3, -0.3, -0.604)
var model_scene = load("res://assets/weapons/nailgun/source/Sopra.fbx")
if model_scene:
var model = model_scene.instantiate()
model_root.add_child(model)
model.scale = Vector3(0.06, 0.06, 0.06)
model.rotation_degrees.y = 180
for light in model.find_children("*", "Light3D", true, false):
light.queue_free()
var mat = StandardMaterial3D.new()
mat.albedo_texture = load("res://assets/weapons/nailgun/textures/Base_texture.png")
mat.normal_enabled = true
mat.normal_texture = load("res://assets/weapons/nailgun/textures/Normal_texture.png")
mat.metallic = 1.0
mat.metallic_texture = load("res://assets/weapons/nailgun/textures/Metallic_texture.png")
mat.roughness_texture = load("res://assets/weapons/nailgun/textures/Roughness_texture.png")
mat.ao_enabled = true
mat.ao_texture = load("res://assets/weapons/nailgun/textures/internal_ground_ao_texture.jpeg")
for child in model.find_children("*", "MeshInstance3D", true, false):
child.set_surface_override_material(0, mat)
# Muzzle Flash (Sparks)
muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.9, 0.6)