tweaks to ai, pickup drops, and added scene image capturerer
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
extends EnemyState
|
||||
class_name EnemySearch
|
||||
|
||||
@export var max_search_time : float = 10.0
|
||||
@export var scan_time : float = 3
|
||||
@export var scan_cone_angle : float = 90
|
||||
|
||||
var search_timer = max_search_time
|
||||
var scan_timer
|
||||
var scan_direction = scan_cone_angle/2
|
||||
|
||||
@@ -11,13 +14,17 @@ func Enter():
|
||||
get_new_point_of_interest()
|
||||
|
||||
func Update(delta):
|
||||
update_minimap(0,1.0,ColorSwatch.ORANGE_COLOR)
|
||||
attack_on_sight()
|
||||
#on timeout change scan direction
|
||||
if scan_timer > 0:
|
||||
scan_timer -= delta
|
||||
if search_timer > 0:
|
||||
search_timer -= delta
|
||||
update_minimap(0,1.0,ColorSwatch.ORANGE_COLOR)
|
||||
attack_on_sight()
|
||||
#on timeout change scan direction
|
||||
if scan_timer > 0:
|
||||
scan_timer -= delta
|
||||
else:
|
||||
change_scan_direction()
|
||||
else:
|
||||
change_scan_direction()
|
||||
Transitioned.emit(self,"idle")
|
||||
|
||||
func Physics_Update(delta):
|
||||
#draw target for debug purposes
|
||||
|
||||
@@ -7,5 +7,5 @@ signal body_part_hit(dam,bullet_damage)
|
||||
func hit(bullet_damage):
|
||||
emit_signal("body_part_hit", damage, bullet_damage)
|
||||
|
||||
#func _on_body_entered(body: Node3D) -> void:
|
||||
#hit(body.bullet_damage)
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
hit(body.bullet_damage)
|
||||
|
||||
@@ -233,9 +233,9 @@ func pickup_spawn(randomized):
|
||||
"1":
|
||||
value = randi_range(int(gamemode.max_stamina * .25),gamemode.max_stamina)
|
||||
"2":
|
||||
value = randi_range(int(gamemode.start_health * .25),gamemode.start_health)
|
||||
value = 1
|
||||
"3":
|
||||
var bill_denoms = [5,10,20,50,100]
|
||||
var bill_denoms = [5,10,20]
|
||||
value = bill_denoms.pick_random()
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ extends Node3D
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
die_particles.emitting = true
|
||||
die_particles_2.emitting = true
|
||||
# die_particles_2.emitting = true
|
||||
audio_explode.play()
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
||||
@@ -99,7 +99,7 @@ func _ready():
|
||||
target.body_part_hit.connect(take_damage)
|
||||
|
||||
func _process(delta):
|
||||
line_of_sight.global_position = global_position
|
||||
line_of_sight.global_position = global_position + Vector3(0,1.5,0)
|
||||
move_and_slide()
|
||||
|
||||
look_at_player()
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
class_name TextureCamera
|
||||
|
||||
@onready var sub_viewport: SubViewport = $CAPTURE/SubViewport
|
||||
@onready var snapshot_model: Node3D = $CAPTURE/SubViewport/snapshotModel
|
||||
|
||||
@export var path : String = "assets/Textures/ObjectTextures/%s.png"
|
||||
@export var take_snapshot : bool = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
@@ -17,6 +19,6 @@ func _process(delta: float) -> void:
|
||||
var snapshot_name = snapshot_model.get_child(0).get_name()
|
||||
await get_tree().create_timer(.5).timeout
|
||||
var img = sub_viewport.get_viewport().get_texture().get_image()
|
||||
var image_path = "assets/Textures/ObjectTextures/%s.png" % snapshot_name
|
||||
var image_path = path % snapshot_name
|
||||
img.save_png(image_path)
|
||||
take_snapshot = false
|
||||
|
||||
Reference in New Issue
Block a user