added enemy taunts
This commit is contained in:
13
assets/enemy_taunt.tscn
Normal file
13
assets/enemy_taunt.tscn
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://cl5k63f3hv68k"]
|
||||||
|
|
||||||
|
[ext_resource type="FontFile" uid="uid://bckxhcc1eudvn" path="res://assets/fonts/Plane Crash.ttf" id="1_vuoli"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/enemy_taunt.gd" id="2_n8vqg"]
|
||||||
|
|
||||||
|
[node name="enemyTaunt" type="Label3D" groups=["spawned"]]
|
||||||
|
billboard = 2
|
||||||
|
modulate = Color(1, 1, 1, 0)
|
||||||
|
text = "1
|
||||||
|
"
|
||||||
|
font = ExtResource("1_vuoli")
|
||||||
|
font_size = 60
|
||||||
|
script = ExtResource("2_n8vqg")
|
||||||
@@ -11,7 +11,7 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="First Person Test"
|
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/features=PackedStringArray("4.2", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ gun_2 = ExtResource("3_xdb5c")
|
|||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("4_a8lcp")]
|
[node name="Player" parent="." instance=ExtResource("4_a8lcp")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 26.4194, 1.40016, -29.1943)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 26.4194, 1.40016, -29.1943)
|
||||||
AUDIO = false
|
|
||||||
JUMP_VELOCITY = 6
|
JUMP_VELOCITY = 6
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
|
|||||||
@@ -1160,7 +1160,6 @@ _data = {
|
|||||||
[node name="Test Level 2" type="Node3D"]
|
[node name="Test Level 2" type="Node3D"]
|
||||||
script = ExtResource("1_tqbvs")
|
script = ExtResource("1_tqbvs")
|
||||||
money = 10
|
money = 10
|
||||||
health = 10
|
|
||||||
gun_1 = ExtResource("2_fu1eu")
|
gun_1 = ExtResource("2_fu1eu")
|
||||||
gun_2 = ExtResource("2_ayfr5")
|
gun_2 = ExtResource("2_ayfr5")
|
||||||
|
|
||||||
|
|||||||
@@ -1169,7 +1169,6 @@ health_drop_enabled = false
|
|||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("2_f87c2")]
|
[node name="Player" parent="." instance=ExtResource("2_f87c2")]
|
||||||
transform = Transform3D(-0.866025, 0, -0.5, 0, 1, 0, 0.5, 0, -0.866025, -16.0295, 1.4435, 12.1166)
|
transform = Transform3D(-0.866025, 0, -0.5, 0, 1, 0, 0.5, 0, -0.866025, -16.0295, 1.4435, 12.1166)
|
||||||
AUDIO = false
|
|
||||||
JUMP_VELOCITY = 6
|
JUMP_VELOCITY = 6
|
||||||
|
|
||||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func _process(delta):
|
|||||||
var position_diff = clamp((position.y - start_position.y)/5,0,1)
|
var position_diff = clamp((position.y - start_position.y)/5,0,1)
|
||||||
|
|
||||||
modulate = Color(1, 1, 1,1 - position_diff)
|
modulate = Color(1, 1, 1,1 - position_diff)
|
||||||
outline_modulate = Color(1, 1, 1, 1 - position_diff)
|
outline_modulate = Color(0, 0, 0, 1 - position_diff)
|
||||||
|
|
||||||
if position_diff == 1:
|
if position_diff == 1:
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ func hit(bullet_damage):
|
|||||||
|
|
||||||
var number_spawn = damage_number.instantiate()
|
var number_spawn = damage_number.instantiate()
|
||||||
number_spawn.damage_amt = bullet_damage * damage
|
number_spawn.damage_amt = bullet_damage * damage
|
||||||
number_spawn.position = global_position + Vector3(0,1,0)
|
number_spawn.position = global_position + Vector3(0,2,0)
|
||||||
get_tree().get_root().add_child(number_spawn)
|
get_tree().get_root().add_child(number_spawn)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ extends Node3D
|
|||||||
@onready var timer = $Timer
|
@onready var timer = $Timer
|
||||||
@onready var level_control = get_tree().current_scene
|
@onready var level_control = get_tree().current_scene
|
||||||
@onready var whiteout = $Whiteout
|
@onready var whiteout = $Whiteout
|
||||||
|
const ENEMY_TAUNT = preload("res://assets/enemy_taunt.tscn")
|
||||||
@onready var animation_player = $AnimationPlayer
|
@onready var animation_player = $AnimationPlayer
|
||||||
|
|
||||||
var focus_dist
|
var focus_dist
|
||||||
@@ -31,6 +32,14 @@ func _ready():
|
|||||||
|
|
||||||
#highlight target
|
#highlight target
|
||||||
if target != null:
|
if target != null:
|
||||||
|
var taunt_spawn = ENEMY_TAUNT.instantiate()
|
||||||
|
target.add_child(taunt_spawn)
|
||||||
|
taunt_spawn.global_transform.origin = target.position + Vector3(0,2,0)
|
||||||
|
|
||||||
|
|
||||||
|
#taunt_spawn.position = target.global_position + Vector3(0,4,0)
|
||||||
|
#target.add_child(taunt_spawn)
|
||||||
|
|
||||||
for i in target.outline_meshes:
|
for i in target.outline_meshes:
|
||||||
i.visible = true
|
i.visible = true
|
||||||
|
|
||||||
@@ -47,7 +56,7 @@ func _process(delta):
|
|||||||
focus_dist = camera.global_position.distance_to(target.global_position)
|
focus_dist = camera.global_position.distance_to(target.global_position)
|
||||||
else:
|
else:
|
||||||
focus_dist = 10.0
|
focus_dist = 10.0
|
||||||
camera.attributes.dof_blur_far_distance = focus_dist + 2
|
camera.attributes.dof_blur_far_distance = focus_dist + 7
|
||||||
camera.attributes.dof_blur_near_distance = focus_dist - 2
|
camera.attributes.dof_blur_near_distance = focus_dist - 2
|
||||||
|
|
||||||
if target == null:
|
if target == null:
|
||||||
|
|||||||
44
scripts/enemy_taunt.gd
Normal file
44
scripts/enemy_taunt.gd
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
extends Label3D
|
||||||
|
|
||||||
|
var start_position
|
||||||
|
|
||||||
|
const SPEED = 3
|
||||||
|
const SCALE_SPEED = 80
|
||||||
|
|
||||||
|
var taunts = ["tee hee",
|
||||||
|
"eat a bag of dicks",
|
||||||
|
"better luck next time",
|
||||||
|
"that's gotta hurt",
|
||||||
|
"did i do that",
|
||||||
|
"who? me?",
|
||||||
|
"another one down for me",
|
||||||
|
"niiiiiiiiice",
|
||||||
|
"the trick is to not get hit",
|
||||||
|
"try winning?"]
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
start_position = position
|
||||||
|
|
||||||
|
var rand_scale = randf_range(.5,1.5)
|
||||||
|
|
||||||
|
scale.x = .5 * rand_scale
|
||||||
|
scale.y = .5 * rand_scale
|
||||||
|
text = taunts.pick_random()
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta):
|
||||||
|
|
||||||
|
|
||||||
|
#scale.x = lerp(0,1,SCALE_SPEED * delta )
|
||||||
|
#scale.y = lerp(0,1,SCALE_SPEED * delta)
|
||||||
|
#position.y += SPEED * delta
|
||||||
|
|
||||||
|
var position_diff = clamp((position.y - start_position.y)/5,0,1)
|
||||||
|
|
||||||
|
modulate = Color(1, 1, 1,1 - position_diff)
|
||||||
|
outline_modulate = Color(0, 0, 0, 1 - position_diff)
|
||||||
|
|
||||||
|
if position_diff == 1:
|
||||||
|
queue_free()
|
||||||
Reference in New Issue
Block a user