feat: implement plasma gun and rocket swarm mechanics along with various 3D asset imports
This commit is contained in:
+10
-46
@@ -14,52 +14,16 @@ func _init() -> void:
|
||||
spread_angle = 0.025
|
||||
|
||||
func _build_model() -> void:
|
||||
position = Vector3(0.25, -0.25, -0.5)
|
||||
|
||||
var black_mat = StandardMaterial3D.new()
|
||||
black_mat.albedo_color = Color(0.05, 0.05, 0.05)
|
||||
|
||||
# Receiver
|
||||
var receiver = MeshInstance3D.new()
|
||||
var rec_mesh = BoxMesh.new()
|
||||
rec_mesh.size = Vector3(0.04, 0.1, 0.2)
|
||||
rec_mesh.material = black_mat
|
||||
receiver.mesh = rec_mesh
|
||||
receiver.position = Vector3(0, 0, 0)
|
||||
model_root.add_child(receiver)
|
||||
|
||||
# Grip
|
||||
var grip = MeshInstance3D.new()
|
||||
var g_mesh = BoxMesh.new()
|
||||
g_mesh.size = Vector3(0.03, 0.12, 0.04)
|
||||
g_mesh.material = black_mat
|
||||
grip.mesh = g_mesh
|
||||
grip.position = Vector3(0, -0.06, 0.08)
|
||||
grip.rotation.x = deg_to_rad(10)
|
||||
model_root.add_child(grip)
|
||||
|
||||
# Foregrip
|
||||
var fgrip = MeshInstance3D.new()
|
||||
var fg_mesh = BoxMesh.new()
|
||||
fg_mesh.size = Vector3(0.03, 0.08, 0.03)
|
||||
fg_mesh.material = black_mat
|
||||
fgrip.mesh = fg_mesh
|
||||
fgrip.position = Vector3(0, -0.05, -0.06)
|
||||
fgrip.rotation.x = deg_to_rad(-10)
|
||||
model_root.add_child(fgrip)
|
||||
|
||||
# Barrel
|
||||
var barrel = MeshInstance3D.new()
|
||||
var b_mesh = CylinderMesh.new()
|
||||
b_mesh.top_radius = 0.008
|
||||
b_mesh.bottom_radius = 0.008
|
||||
b_mesh.height = 0.1
|
||||
b_mesh.material = black_mat
|
||||
barrel.mesh = b_mesh
|
||||
barrel.rotation.x = deg_to_rad(90)
|
||||
barrel.position = Vector3(0, 0.02, -0.15)
|
||||
model_root.add_child(barrel)
|
||||
|
||||
position = Vector3(0.25, -0.25, -0.35)
|
||||
|
||||
var model_scene = load("res://assets/weapons/mp7/source/HK MP7.fbx")
|
||||
if model_scene:
|
||||
var model = model_scene.instantiate()
|
||||
model_root.add_child(model)
|
||||
model.scale = Vector3(0.08, 0.08, 0.08)
|
||||
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.9, 0.5)
|
||||
|
||||
Reference in New Issue
Block a user