more hivemind tweaks and added enemy counter to level manager
This commit is contained in:
6
assets/enemy_hivemind.tscn
Normal file
6
assets/enemy_hivemind.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cg42oc7ll2cnd"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/EnemyHivemind1.gd" id="1_vdw54"]
|
||||
|
||||
[node name="EnemyHivemind" type="Node3D" groups=["enemy_hivemind"]]
|
||||
script = ExtResource("1_vdw54")
|
||||
@@ -595,7 +595,6 @@ bullet = ExtResource("2_aew5r")
|
||||
casing = ExtResource("3_e5ft5")
|
||||
bullet_speed = 75
|
||||
bullet_drop = 0.01
|
||||
bullet_damage = 0
|
||||
stamina = ExtResource("4_p0ci7")
|
||||
ammo = ExtResource("5_k1lw4")
|
||||
money = ExtResource("6_ihv2y")
|
||||
|
||||
@@ -11,7 +11,7 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="First Person Test"
|
||||
run/main_scene="res://scenes/enemy_working_scene.tscn"
|
||||
run/main_scene="res://scenes/test_level_2v2.tscn"
|
||||
config/features=PackedStringArray("4.2", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
||||
@@ -1559,7 +1559,7 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -52.72
|
||||
[node name="Building1" parent="." instance=ExtResource("38_jjm5k")]
|
||||
transform = Transform3D(1.4, 0, 0, 0, 1.4, 0, 0, 0, 1.4, 30.5112, 0.0535234, 5.34559)
|
||||
|
||||
[node name="EnemyHivemind" type="Node3D" parent="."]
|
||||
[node name="EnemyHivemind" type="Node3D" parent="." groups=["enemy_hivemind"]]
|
||||
script = ExtResource("39_g18ck")
|
||||
|
||||
[node name="spider" parent="EnemyHivemind" instance=ExtResource("40_a0e3y")]
|
||||
|
||||
@@ -13,6 +13,8 @@ var ammo_reserve = [0]
|
||||
var guns_dict = {}
|
||||
var current_gun_index
|
||||
var particle_number = 0
|
||||
var enemy_hiveminds = []
|
||||
var remaining_enemies
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
@@ -35,9 +37,15 @@ func _ready():
|
||||
current_gun_index = 0
|
||||
gun_spawn(0)
|
||||
|
||||
#find enemy hiveminds
|
||||
for node in get_tree().get_nodes_in_group("enemy_hivemind"):
|
||||
enemy_hiveminds.append(node)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
pass
|
||||
for hivemind in enemy_hiveminds:
|
||||
remaining_enemies = hivemind.minions.size()
|
||||
print("remaining enemies: " + str(remaining_enemies))
|
||||
|
||||
func gun_spawn(index):
|
||||
#loop around if scrolling past available guns
|
||||
|
||||
@@ -38,7 +38,8 @@ func _process(delta):
|
||||
position += transform.basis * Vector3(0, 0, -bullet_speed) * delta
|
||||
rotation.x = clamp(rotation.x - delta * bullet_drop,deg_to_rad(-90),deg_to_rad(90))
|
||||
|
||||
if ray.is_colliding() and ray.get_collider().is_in_group("player"):
|
||||
if ray.is_colliding():
|
||||
if ray.get_collider().is_in_group("player"):
|
||||
var player = ray.get_collider()
|
||||
player.level_control.health -= bullet_damage
|
||||
player.hurt_audio.play()
|
||||
|
||||
@@ -74,7 +74,7 @@ func _process(delta):
|
||||
turret_look_next.look_at(player.global_position,Vector3.UP)
|
||||
turret_look.rotation = lerp(turret_look.rotation,turret_look_next.rotation,delta * turret_look_speed)
|
||||
|
||||
distance_to_player = abs(self.global_position - player.global_position)
|
||||
#distance_to_player = abs(self.global_position - player.global_position)
|
||||
|
||||
#apply gravity
|
||||
if !is_on_floor():
|
||||
|
||||
Reference in New Issue
Block a user