More file reorganizing and fixed some inconsistencies
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource path="res://Resources/Level_5_Enemy_Glowing_Ghost_Occluder.tres" type="OccluderPolygon2D" id=1]
|
||||
[ext_resource path="res://Sprites/Assets/Light.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Sprites/Enemies/demon_slime_FREE_v1.0_288x160_spritesheet.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Sprites/Enemies/Demon_Slime_Spritesheet.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Enemies/DemonBoss.gd" type="Script" id=4]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
|
@@ -3,7 +3,7 @@
|
||||
[ext_resource path="res://Resources/Level_5_Enemy_Glowing_Ghost_Occluder.tres" type="OccluderPolygon2D" id=1]
|
||||
[ext_resource path="res://Sprites/Assets/Light.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Enemies/Flaming Skull.gd" type="Script" id=4]
|
||||
[ext_resource path="res://Sprites/Enemies/flaming skull design.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/Enemies/Flaming_Skull_Design.png" type="Texture" id=5]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
flags = 4
|
||||
|
@@ -7,41 +7,41 @@ var velocity: Vector2 = Vector2.ZERO
|
||||
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
velocity = Vector2.ZERO
|
||||
velocity = Vector2.ZERO
|
||||
|
||||
if player:
|
||||
velocity = position.direction_to(player.position).normalized() * SPEED
|
||||
var angle = position.angle_to_point(player.position)
|
||||
if abs(angle) > PI/2:
|
||||
$AnimatedSprite1.scale.x = -0.563
|
||||
else:
|
||||
$AnimatedSprite1.scale.x = 0.563
|
||||
if player:
|
||||
velocity = position.direction_to(player.position).normalized() * SPEED
|
||||
var angle = position.angle_to_point(player.position)
|
||||
if abs(angle) > PI/2:
|
||||
$AnimatedSprite1.scale.x = -0.563
|
||||
else:
|
||||
$AnimatedSprite1.scale.x = 0.563
|
||||
|
||||
velocity = move_and_slide(velocity)
|
||||
return
|
||||
velocity = move_and_slide(velocity)
|
||||
return
|
||||
|
||||
|
||||
func _on_player_detector_area_entered(area: Area2D) -> void:
|
||||
if area.get_parent().name == 'Player':
|
||||
player = area.get_parent()
|
||||
$AnimatedSprite1.animation = "Running"
|
||||
return
|
||||
if area.get_parent().name == 'Player':
|
||||
player = area.get_parent()
|
||||
$AnimatedSprite1.animation = 'Running'
|
||||
return
|
||||
|
||||
|
||||
func _on_player_detector_area_exited(_area: Area2D):
|
||||
player = null
|
||||
$AnimatedSprite1.animation = "Idle"
|
||||
return
|
||||
player = null
|
||||
$AnimatedSprite1.animation = 'Idle'
|
||||
return
|
||||
|
||||
|
||||
func _on_Player_Attack_area_entered(area: Area2D) -> void:
|
||||
if area.get_parent().name == 'Player':
|
||||
player = area.get_parent()
|
||||
$AnimatedSprite1.animation = "Jump"
|
||||
return
|
||||
if area.get_parent().name == 'Player':
|
||||
player = area.get_parent()
|
||||
$AnimatedSprite1.animation = 'Jump'
|
||||
return
|
||||
|
||||
|
||||
func _on_Player_Attack_area_exited(area: Area2D) -> void:
|
||||
player = null
|
||||
$AnimatedSprite1.animation = "Running"
|
||||
return
|
||||
player = null
|
||||
$AnimatedSprite1.animation = 'Running'
|
||||
return
|
||||
|
@@ -2,10 +2,10 @@
|
||||
|
||||
[ext_resource path="res://Resources/Level_5_Enemy_Glowing_Ghost_Occluder.tres" type="OccluderPolygon2D" id=1]
|
||||
[ext_resource path="res://Sprites/Assets/Light.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Sprites/Enemies/hell-hound-idle.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Sprites/Enemies/Hell_Hound_Idle.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Enemies/Hellhound.gd" type="Script" id=4]
|
||||
[ext_resource path="res://Sprites/Enemies/hell-hound-jump.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/Enemies/hell-hound-run.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Sprites/Enemies/Hell_Hound_Jump.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/Enemies/Hell_Hound_Run.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=9]
|
||||
flags = 4
|
||||
|
Reference in New Issue
Block a user