From b58e56241c97f037897e2130347f00ee4c31fd01 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Tue, 10 Oct 2023 22:45:27 -0400 Subject: [PATCH] Summary (required) --- Scenes/Spawnables/bat_spawnable.tscn | 1 + Scripts/Enemy.gd | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Scenes/Spawnables/bat_spawnable.tscn b/Scenes/Spawnables/bat_spawnable.tscn index d9ba3b3..96dff93 100644 --- a/Scenes/Spawnables/bat_spawnable.tscn +++ b/Scenes/Spawnables/bat_spawnable.tscn @@ -9,6 +9,7 @@ attackSpeed = 50.0 speed = 4000.0 damage = 1 priority = 1 +expReward = 50 [node name="AnimatedSprite2D" parent="." index="1"] frame_progress = 0.482614 diff --git a/Scripts/Enemy.gd b/Scripts/Enemy.gd index b83c74f..b263efd 100644 --- a/Scripts/Enemy.gd +++ b/Scripts/Enemy.gd @@ -22,8 +22,8 @@ extends CharacterBody2D @onready var lvlanim: Node = get_node("LvlUp") @onready var lvlsnd: Node = get_node("LvlUpSnd") @onready var hitanim: Node = get_node("Hit") -@onready var atk1l: Node = get_node("AttackArea/Attack1CollisionL") -@onready var atk1r: Node = get_node("AttackArea/Attack1CollisionR") +@onready var atk1l: Node = get_node("AttackArea/Attack1CollisionR") +@onready var atk1r: Node = get_node("AttackArea/Attack1CollisionL") @onready var atk2l: Node = get_node("AttackArea/Attack2CollisionR") @onready var atk2r: Node = get_node("AttackArea/Attack2CollisionL") @@ -43,7 +43,7 @@ func remove_foe(foe): # Called when the node enters the scene tree for the first time. func _ready(): - setLevel(4) + setLevel(2) atk1l.set_disabled(true) atk1r.set_disabled(true) atk2l.set_disabled(true) @@ -126,6 +126,7 @@ func processAI(objs): if velocity.length() < 95 && objs.size() > 1: vec.y += 10 + vec.x += 5 return vec.normalized() * 100 @@ -170,6 +171,7 @@ func setLevel(lvl): level = lvl lvlanim.restart() lvlsnd.play() + stop_attack() if level > 3: atk = "Attack2"