feat: implement plasma gun and rocket swarm mechanics along with various 3D asset imports
This commit is contained in:
@@ -20,46 +20,19 @@ func _ready() -> void:
|
||||
_build_model()
|
||||
|
||||
func _build_model() -> void:
|
||||
# Simple FPS weapon placement (bottom right)
|
||||
position = Vector3(0.3, -0.3, -0.6)
|
||||
|
||||
model_root = Node3D.new()
|
||||
add_child(model_root)
|
||||
|
||||
# Stock
|
||||
var stock = MeshInstance3D.new()
|
||||
var stock_mesh = BoxMesh.new()
|
||||
stock_mesh.size = Vector3(0.1, 0.1, 0.4)
|
||||
var stock_mat = StandardMaterial3D.new()
|
||||
stock_mat.albedo_color = Color(0.4, 0.2, 0.1) # Brown wood
|
||||
stock_mesh.material = stock_mat
|
||||
stock.mesh = stock_mesh
|
||||
stock.position = Vector3(0, 0, 0.2)
|
||||
model_root.add_child(stock)
|
||||
|
||||
# Left Barrel
|
||||
var barrel_l = MeshInstance3D.new()
|
||||
var barrel_mesh = CylinderMesh.new()
|
||||
barrel_mesh.top_radius = 0.03
|
||||
barrel_mesh.bottom_radius = 0.03
|
||||
barrel_mesh.height = 0.6
|
||||
var barrel_mat = StandardMaterial3D.new()
|
||||
barrel_mat.albedo_color = Color(0.2, 0.2, 0.2) # Dark grey metal
|
||||
barrel_mat.metallic = 0.8
|
||||
barrel_mat.roughness = 0.4
|
||||
barrel_mesh.material = barrel_mat
|
||||
barrel_l.mesh = barrel_mesh
|
||||
barrel_l.rotation.x = deg_to_rad(90)
|
||||
barrel_l.position = Vector3(-0.04, 0.03, -0.1)
|
||||
model_root.add_child(barrel_l)
|
||||
|
||||
# Right Barrel
|
||||
var barrel_r = MeshInstance3D.new()
|
||||
barrel_r.mesh = barrel_mesh
|
||||
barrel_r.rotation.x = deg_to_rad(90)
|
||||
barrel_r.position = Vector3(0.04, 0.03, -0.1)
|
||||
model_root.add_child(barrel_r)
|
||||
|
||||
if not model_root:
|
||||
model_root = Node3D.new()
|
||||
add_child(model_root)
|
||||
position = Vector3(0.3, -0.3, -0.690)
|
||||
|
||||
var model_scene = load("res://assets/weapons/double barrel/source/Double Deuce.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 Light
|
||||
muzzle_flash = OmniLight3D.new()
|
||||
muzzle_flash.light_color = Color(1.0, 0.8, 0.3)
|
||||
@@ -222,7 +195,7 @@ func _shoot_hitscan() -> void:
|
||||
|
||||
t_mesh_inst.mesh = t_mesh
|
||||
t_mesh_inst.rotation.x = deg_to_rad(90)
|
||||
t_mesh_inst.position = Vector3(0, 0, -0.5)
|
||||
t_mesh_inst.position = Vector3(0, 0, -0.719)
|
||||
tracer.add_child(t_mesh_inst)
|
||||
|
||||
tracer.target_position = final_target
|
||||
|
||||
Reference in New Issue
Block a user