Skip to content

Commit

Permalink
update: beetle bot
Browse files Browse the repository at this point in the history
  • Loading branch information
gtibo committed Feb 6, 2023
1 parent b4752f3 commit 8a991ff
Show file tree
Hide file tree
Showing 22 changed files with 470 additions and 3,929 deletions.
12 changes: 6 additions & 6 deletions Enemies/Beetle.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const PUFF_SCENE := preload("smoke_puff/smoke_puff.tscn")

@onready var _reaction_animation_player: AnimationPlayer = $ReactionLabel/AnimationPlayer
@onready var _detection_area: Area3D = $PlayerDetectionArea
@onready var _beetle_skin: Node3D = $BeetleRoot
@onready var _beetle_skin: Node3D = $BeetlebotSkin
@onready var _navigation_agent: NavigationAgent3D = $NavigationAgent3D
@onready var _death_collision_shape: CollisionShape3D = $DeathCollisionShape
@onready var _defeat_sound: AudioStreamPlayer3D = $DefeatSound
Expand All @@ -20,15 +20,15 @@ const PUFF_SCENE := preload("smoke_puff/smoke_puff.tscn")
func _ready() -> void:
_detection_area.body_entered.connect(_on_body_entered)
_detection_area.body_exited.connect(_on_body_exited)
_beetle_skin.play_idle()
_beetle_skin.idle()


func _physics_process(delta: float) -> void:
if not _alive:
return

if _target != null:
_beetle_skin.play_walk()
_beetle_skin.walk()
var target_look_position := _target.global_position
target_look_position.y = global_position.y
if target_look_position != Vector3.ZERO:
Expand All @@ -53,9 +53,9 @@ func _physics_process(delta: float) -> void:
force.y = 0.5
force *= 10.0
collider.damage(impact_point, force)
_beetle_skin.play_attack()
_beetle_skin.attack()
else:
_beetle_skin.play_idle()
_beetle_skin.idle()


func damage(impact_point: Vector3, force: Vector3) -> void:
Expand All @@ -68,7 +68,7 @@ func damage(impact_point: Vector3, force: Vector3) -> void:

_defeat_sound.play()
_alive = false
_beetle_skin.play_poweroff()
_beetle_skin.power_off()

_detection_area.body_entered.disconnect(_on_body_entered)
_detection_area.body_exited.disconnect(_on_body_exited)
Expand Down
8 changes: 4 additions & 4 deletions Enemies/Beetle.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[gd_scene load_steps=11 format=3 uid="uid://cvwkhlljkg06j"]

[ext_resource type="Script" path="res://Enemies/Beetle.gd" id="1_mefon"]
[ext_resource type="PackedScene" uid="uid://cq4m2udfv5lfg" path="res://Enemies/Beetle/BeetleModel.tscn" id="2_qcu3o"]
[ext_resource type="PackedScene" uid="uid://bpjqcswabdtyb" path="res://Enemies/beetle_bot/beetlebot_skin.tscn" id="2_1wpkj"]
[ext_resource type="AudioStream" uid="uid://c66nnoqtanfw2" path="res://Enemies/Sounds/robot_defeat.wav" id="3_w5eam"]

[sub_resource type="Animation" id="Animation_5pcps"]
Expand Down Expand Up @@ -142,12 +142,12 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.336327, -0.250324)
shape = SubResource("BoxShape3D_bm81s")
disabled = true

[node name="BeetlebotSkin" parent="." instance=ExtResource("2_1wpkj")]
transform = Transform3D(-1.4, 0, -2.11394e-07, 0, 1.4, 0, 2.11394e-07, 0, -1.4, 0, -0.43203, -0.147412)

[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
target_desired_distance = 0.1

[node name="BeetleRoot" parent="." instance=ExtResource("2_qcu3o")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, -0.426, 0)

[node name="DefeatSound" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource("3_w5eam")
volume_db = 1.0
53 changes: 0 additions & 53 deletions Enemies/Beetle/BeetleModel.gd

This file was deleted.

Loading

0 comments on commit 8a991ff

Please sign in to comment.