feat: implement plasma gun and rocket swarm mechanics along with various 3D asset imports
This commit is contained in:
+17
-31
@@ -17,37 +17,23 @@ func _init() -> void:
|
||||
projectile_gravity = 0.0
|
||||
|
||||
func _build_model() -> void:
|
||||
position = Vector3(0.3, -0.3, -0.6)
|
||||
|
||||
var white_mat = StandardMaterial3D.new()
|
||||
white_mat.albedo_color = Color(0.8, 0.8, 0.9)
|
||||
var glow_mat = StandardMaterial3D.new()
|
||||
glow_mat.albedo_color = Color(0.2, 0.5, 1.0)
|
||||
glow_mat.emission_enabled = true
|
||||
glow_mat.emission = Color(0.2, 0.5, 1.0)
|
||||
glow_mat.emission_energy_multiplier = 4.0
|
||||
|
||||
# Body
|
||||
var body = MeshInstance3D.new()
|
||||
var b_mesh = BoxMesh.new()
|
||||
b_mesh.size = Vector3(0.08, 0.14, 0.35)
|
||||
b_mesh.material = white_mat
|
||||
body.mesh = b_mesh
|
||||
body.position = Vector3(0, 0, 0.05)
|
||||
model_root.add_child(body)
|
||||
|
||||
# Glow Core
|
||||
var core = MeshInstance3D.new()
|
||||
var c_mesh = CylinderMesh.new()
|
||||
c_mesh.top_radius = 0.02
|
||||
c_mesh.bottom_radius = 0.02
|
||||
c_mesh.height = 0.4
|
||||
c_mesh.material = glow_mat
|
||||
core.mesh = c_mesh
|
||||
core.rotation.x = deg_to_rad(90)
|
||||
core.position = Vector3(0, 0.02, -0.15)
|
||||
model_root.add_child(core)
|
||||
|
||||
position = Vector3(0.3, -0.3, -0.656)
|
||||
|
||||
var model_scene = load("res://assets/weapons/plasmagun/source/Plasma rifle.fbx")
|
||||
if model_scene:
|
||||
var model = model_scene.instantiate()
|
||||
model_root.add_child(model)
|
||||
model.scale = Vector3(1.0, 1.0, 1.0)
|
||||
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/plasmagun/textures/Plasma_rifle.png")
|
||||
|
||||
for child in model.find_children("*", "MeshInstance3D", true, false):
|
||||
child.set_surface_override_material(0, mat)
|
||||
|
||||
# Muzzle Flash
|
||||
muzzle_flash = OmniLight3D.new()
|
||||
muzzle_flash.light_color = Color(0.2, 0.5, 1.0)
|
||||
|
||||
Reference in New Issue
Block a user