Fix merge conflicts when trying to merge main into forest

This commit is contained in:
Jasmine Hyder
2021-12-08 14:43:39 -06:00
131 changed files with 3271 additions and 294 deletions

View File

@@ -0,0 +1,40 @@
extends KinematicBody2D
const SPEED: int = 50
var player: KinematicBody2D = null
var velocity: Vector2 = Vector2.ZERO
var health: int = 2
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
if player and position.distance_to(player.position) > 1:
velocity = position.direction_to(player.position).normalized() * SPEED
velocity = move_and_slide(velocity)
return
func _on_player_detector_body_entered(body: Node) -> void:
if body.is_in_group('player'):
player = body
return
func _on_player_detector_body_exited(body: Node) -> void:
if body.is_in_group('player'):
player = null
return
func _on_hitbox_area_entered(area: Area2D) -> void:
if area.is_in_group('player_weapon_1'):
health -= 1
elif area.is_in_group('player_weapon_2'):
health -= 2
if health <= 0:
call_deferred('queue_free')
return

View File

@@ -0,0 +1,84 @@
[gd_scene load_steps=8 format=2]
[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/Chasing_Glowing_Ghost.png" type="Texture" id=3]
[ext_resource path="res://Enemies/Chasing Glowing Ghost.gd" type="Script" id=4]
[sub_resource type="CapsuleShape2D" id=1]
radius = 1.5
height = 3.0
[sub_resource type="CapsuleShape2D" id=2]
radius = 3.0
height = 2.0
[sub_resource type="CircleShape2D" id=3]
radius = 50.0
[node name="Chasing Glowing Ghost" type="KinematicBody2D" groups=[
"enemy",
]]
light_mask = 0
collision_layer = 4
collision_mask = 5
script = ExtResource( 4 )
[node name="Sprite" type="Sprite" parent="."]
light_mask = 4
position = Vector2( 0, -3 )
texture = ExtResource( 3 )
offset = Vector2( 0, 0.5 )
[node name="Collision" type="CollisionShape2D" parent="."]
visible = false
light_mask = 0
rotation = 1.5708
shape = SubResource( 1 )
[node name="Hitbox" type="Area2D" parent="." groups=[
"enemy_hitbox_1",
]]
light_mask = 0
collision_layer = 4
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
visible = false
light_mask = 0
position = Vector2( 0, -2.5 )
shape = SubResource( 2 )
[node name="Player Detector" type="Area2D" parent="."]
light_mask = 0
input_pickable = false
monitorable = false
collision_layer = 0
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector"]
visible = false
light_mask = 0
shape = SubResource( 3 )
[node name="Light" type="Light2D" parent="."]
texture = ExtResource( 2 )
texture_scale = 0.5
color = Color( 0.984314, 0.94902, 0.211765, 0.392157 )
energy = 2.0
range_item_cull_mask = 11
[node name="Eyes" type="Light2D" parent="."]
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
offset = Vector2( 5, -35 )
range_item_cull_mask = 4
shadow_item_cull_mask = 0
[node name="Occluder" type="LightOccluder2D" parent="."]
show_behind_parent = true
occluder = ExtResource( 1 )
[connection signal="area_entered" from="Hitbox" to="." method="_on_hitbox_area_entered"]
[connection signal="body_entered" from="Player Detector" to="." method="_on_player_detector_body_entered"]
[connection signal="body_exited" from="Player Detector" to="." method="_on_player_detector_body_exited"]

View File

@@ -0,0 +1,53 @@
extends KinematicBody2D
const SPEED: int = 35
export var creepy_hand: PackedScene
var player: KinematicBody2D = null
var velocity: Vector2 = Vector2.ZERO
var health: int = 1
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
if player:
if position.distance_to(player.position) < 40:
velocity = position.direction_to(player.position).normalized() * -SPEED
elif position.distance_to(player.position) > 41:
velocity = position.direction_to(player.position).normalized() * SPEED
velocity = move_and_slide(velocity)
return
func _on_player_detector_body_entered(body: Node) -> void:
if body.is_in_group('player'):
player = body
return
func _on_player_detector_body_exited(body: Node) -> void:
if body.is_in_group('player'):
player = null
return
func _on_projectile_timer_timeout() -> void:
if player:
var projectile: Node = creepy_hand.instance()
projectile.init($Sprite.global_position, player.position)
get_tree().get_current_scene().get_node('Projectiles').add_child(projectile)
return
func _on_hitbox_area_entered(area: Area2D) -> void:
if area.is_in_group('player_weapon_1'):
health -= 1
elif area.is_in_group('player_weapon_2'):
health -= 2
if health <= 0:
call_deferred('queue_free')
return

View File

@@ -0,0 +1,87 @@
[gd_scene load_steps=9 format=2]
[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/Creepy_Glowing_Ghost.png" type="Texture" id=3]
[ext_resource path="res://Enemies/Creepy Glowing Ghost.gd" type="Script" id=4]
[ext_resource path="res://Enemies/Projectiles/Creepy Hand.tscn" type="PackedScene" id=5]
[sub_resource type="CapsuleShape2D" id=3]
radius = 1.5
height = 3.0
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
height = 2.0
[sub_resource type="CircleShape2D" id=2]
radius = 60.0
[node name="Creepy Glowing Ghost" type="KinematicBody2D" groups=["enemy"]]
light_mask = 0
collision_layer = 4
collision_mask = 5
script = ExtResource( 4 )
creepy_hand = ExtResource( 5 )
[node name="Sprite" type="Sprite" parent="."]
light_mask = 4
position = Vector2( 0, -3 )
texture = ExtResource( 3 )
offset = Vector2( 0, 0.5 )
[node name="Collision" type="CollisionShape2D" parent="."]
visible = false
light_mask = 0
rotation = 1.5708
shape = SubResource( 3 )
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox_1"]]
light_mask = 0
collision_layer = 4
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
visible = false
light_mask = 0
position = Vector2( 0, -2.5 )
shape = SubResource( 1 )
[node name="Player Detector" type="Area2D" parent="."]
light_mask = 0
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector"]
visible = false
light_mask = 0
shape = SubResource( 2 )
[node name="Light" type="Light2D" parent="."]
texture = ExtResource( 2 )
texture_scale = 0.5
color = Color( 0.698039, 0.211765, 0.984314, 0.392157 )
energy = 2.0
range_item_cull_mask = 11
[node name="Eyes" type="Light2D" parent="."]
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
offset = Vector2( 5, -35 )
range_item_cull_mask = 4
shadow_item_cull_mask = 0
[node name="Occluder" type="LightOccluder2D" parent="."]
show_behind_parent = true
occluder = ExtResource( 1 )
[node name="Projectile Timer" type="Timer" parent="."]
wait_time = 2.0
autostart = true
[connection signal="area_entered" from="Hitbox" to="." method="_on_hitbox_area_entered"]
[connection signal="body_entered" from="Player Detector" to="." method="_on_player_detector_body_entered"]
[connection signal="body_exited" from="Player Detector" to="." method="_on_player_detector_body_exited"]
[connection signal="timeout" from="Projectile Timer" to="." method="_on_projectile_timer_timeout"]

78
Enemies/Dark Matter.gd Normal file
View File

@@ -0,0 +1,78 @@
extends KinematicBody2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
#onready var label = get_node("Label")
onready var timer = get_node("Timer")
var speed : = 0.5
var position_tracker = 0.0
var player = null
var obstacle = null
var DisplayValue = 10
var health: int = 2
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func _physics_process(_delta):
if player == null:
translate(Vector2(speed, 0))
position_tracker += speed
if position_tracker >= 50 or position_tracker <=0:#enemy move back and forth
speed *= -1
if player:
translate(Vector2(position.direction_to(player.position) * abs(speed))) #enemy follow player
if obstacle == null:
$Sprite.texture = load("res://Sprites/Enemies/DarkMatter_barrier.png")
if obstacle:
$Sprite.texture = load("res://Sprites/Enemies/DarkMatter.png")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Player_detect_body_entered(body):
#print("player entered") # Replace with function body.
#print(body.name)#"Player"
if body.name == 'Player': #sometimes map_boundary is detected
#if body.get_parent().name == 'Player':
player = body
func _on_Player_detect_body_exited(_body):
#print("player exit")
if _body.name == 'Player':
player = null
func _on_Star_detect_body_entered(body_star):
#print("obstacle entered")
#print(body_star.name)#Obstacle
if 'Star' in body_star.name:
obstacle = body_star
timer.set_wait_time(DisplayValue)
timer.start()
#print("timer start")
func _on_Star_detect_body_exited(_body):
#if _body.name == 'Star':
#print("obstacle exited")
#if _body.name == 'Obstacle':
#obstacle = null
null
func _on_Timer_timeout():
#print("time out")
obstacle = null # Replace with function body.
func _on_Hitbox_area_entered(area: Area2D):
if obstacle: #when the enemy is vulnerable
if area.is_in_group('player_weapon_1'):
health -= 1
elif area.is_in_group('player_weapon_2'):
health -= 2
if health <= 0:
call_deferred('queue_free')
return

57
Enemies/Dark Matter.tscn Normal file
View File

@@ -0,0 +1,57 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Sprites/Enemies/DarkMatter_barrier.png" type="Texture" id=1]
[ext_resource path="res://Enemies/Dark Matter.gd" type="Script" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 5.55527, 4.93821 )
[sub_resource type="CircleShape2D" id=2]
radius = 55.4916
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 5.48996, 5.06427 )
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 5.50204, 4.89798 )
[node name="Dark Matter" type="KinematicBody2D"]
collision_layer = 2
collision_mask = 6
script = ExtResource( 2 )
[node name="Enemy_body" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
[node name="Player_detect" type="Area2D" parent="."]
collision_layer = 2
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player_detect"]
shape = SubResource( 2 )
[node name="Star_detect" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Star_detect"]
shape = SubResource( 3 )
[node name="Timer" type="Timer" parent="."]
[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource( 4 )
[connection signal="body_entered" from="Player_detect" to="." method="_on_Player_detect_body_entered"]
[connection signal="body_exited" from="Player_detect" to="." method="_on_Player_detect_body_exited"]
[connection signal="body_entered" from="Star_detect" to="." method="_on_Star_detect_body_entered"]
[connection signal="body_exited" from="Star_detect" to="." method="_on_Star_detect_body_exited"]
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]

View File

@@ -8,43 +8,43 @@ var velocity: Vector2 = Vector2.ZERO
var status = "walk"
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 = "Walk"
return
if area.get_parent().name == 'Player':
player = area.get_parent()
$AnimatedSprite1.animation = "Walk"
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 = "Attack"
status = "attack"
return
if area.get_parent().name == 'Player':
player = area.get_parent()
$AnimatedSprite1.animation = "Attack"
status = "attack"
return
func _on_Player_Attack_area_exited(area: Area2D) -> void:
player = null
if not status == "attack":
$AnimatedSprite1.animation = "Walk"
return
player = null
if not status == "attack":
$AnimatedSprite1.animation = "Walk"
return

View File

@@ -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]
@@ -401,4 +401,4 @@ occluder = ExtResource( 1 )
[connection signal="area_entered" from="Player Detector" to="." method="_on_player_detector_area_entered"]
[connection signal="area_exited" from="Player Detector" to="." method="_on_player_detector_area_exited"]
[connection signal="area_entered" from="Player Attack" to="." method="_on_Player_Attack_area_entered"]
[connection signal="area_exited" from="Player Attack" to="." method="_on_Player_Attack_area_exited"]
[connection signal="area_exited" from="Player Attack" to="." method="_on_Player_Attack_area_exited"]

View File

@@ -7,6 +7,7 @@ var velocity: Vector2 = Vector2.ZERO
func _physics_process(_delta: float) -> void:
<<<<<<< HEAD
velocity = Vector2.ZERO
if player:
@@ -26,3 +27,24 @@ func _on_player_detector_area_entered(area: Area2D) -> void:
func _on_player_detector_area_exited(_area: Area2D):
player = null
return
=======
velocity = Vector2.ZERO
if player:
velocity = position.direction_to(player.position).normalized() * SPEED
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()
return
func _on_player_detector_area_exited(_area: Area2D):
player = null
return
>>>>>>> main

View File

@@ -3,6 +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]
<<<<<<< HEAD
[ext_resource path="res://Sprites/Enemies/flaming skull design.png" type="Texture" id=5]
[sub_resource type="AtlasTexture" id=1]
@@ -20,11 +21,34 @@ region = Rect2( 1344, 0, 672, 672 )
[sub_resource type="SpriteFrames" id=4]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ) ],
=======
[ext_resource path="res://Sprites/Enemies/Flaming_Skull_Design.png" type="Texture" id=5]
[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 0, 0, 672, 672 )
[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 672, 0, 672, 672 )
[sub_resource type="AtlasTexture" id=5]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 1344, 0, 672, 672 )
[sub_resource type="SpriteFrames" id=6]
animations = [ {
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
>>>>>>> main
"loop": true,
"name": "default",
"speed": 5.0
} ]
<<<<<<< HEAD
[sub_resource type="CapsuleShape2D" id=5]
radius = 3.0
height = 2.0
@@ -35,18 +59,33 @@ radius = 50.0
[node name="Flaming Skull" type="KinematicBody2D" groups=[
"enemies",
]]
=======
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
height = 2.0
[sub_resource type="CircleShape2D" id=2]
radius = 50.0
[node name="Flaming Skull" type="KinematicBody2D" groups=["enemies"]]
>>>>>>> main
collision_layer = 2
script = ExtResource( 4 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.0446429, 0.0446429 )
<<<<<<< HEAD
frames = SubResource( 4 )
frame = 1
=======
frames = SubResource( 6 )
>>>>>>> main
playing = true
[node name="Hitbox" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 0, -3 )
<<<<<<< HEAD
shape = SubResource( 5 )
[node name="Player Detector" type="Area2D" parent="."]
@@ -58,6 +97,19 @@ collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector"]
visible = false
shape = SubResource( 6 )
=======
shape = SubResource( 1 )
[node name="Player Detector" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector"]
visible = false
shape = SubResource( 2 )
>>>>>>> main
[node name="Light2D" type="Light2D" parent="."]
visible = false

View File

@@ -1,27 +0,0 @@
extends KinematicBody2D
const SPEED: int = 50
var player: KinematicBody2D = null
var velocity: Vector2 = Vector2.ZERO
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
if player:
velocity = position.direction_to(player.position).normalized() * SPEED
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()
return
func _on_player_detector_area_exited(_area: Area2D):
player = null
return

View File

@@ -1,57 +0,0 @@
[gd_scene load_steps=7 format=2]
[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/Glowing_Ghost.png" type="Texture" id=3]
[ext_resource path="res://Enemies/Glowing Ghost.gd" type="Script" id=4]
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
height = 2.0
[sub_resource type="CircleShape2D" id=2]
radius = 50.0
[node name="Glowing Ghost" type="KinematicBody2D" groups=["enemies"]]
collision_layer = 2
script = ExtResource( 4 )
[node name="Sprite" type="Sprite" parent="."]
light_mask = 4
position = Vector2( 0, -3 )
texture = ExtResource( 3 )
[node name="Hitbox" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 0, -3 )
shape = SubResource( 1 )
[node name="Player Detector" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector"]
visible = false
shape = SubResource( 2 )
[node name="Light2D" type="Light2D" parent="."]
scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 2 )
color = Color( 0.984314, 0.94902, 0.211765, 0.392157 )
energy = 2.0
range_item_cull_mask = 11
[node name="Light2DEyes" type="Light2D" parent="."]
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
offset = Vector2( 5, -40 )
range_item_cull_mask = 4
[node name="LightOccluder2D" type="LightOccluder2D" parent="."]
show_behind_parent = true
occluder = ExtResource( 1 )
[connection signal="area_entered" from="Player Detector" to="." method="_on_player_detector_area_entered"]
[connection signal="area_exited" from="Player Detector" to="." method="_on_player_detector_area_exited"]

View File

@@ -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

View File

@@ -2,114 +2,133 @@
[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=1]
[sub_resource type="AtlasTexture" id=9]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=2]
[sub_resource type="AtlasTexture" id=10]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 64, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=3]
[sub_resource type="AtlasTexture" id=11]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 128, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=4]
[sub_resource type="AtlasTexture" id=12]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 192, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=5]
[sub_resource type="AtlasTexture" id=13]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 256, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=6]
[sub_resource type="AtlasTexture" id=14]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 320, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=7]
[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 0, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=8]
[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 65, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=9]
[sub_resource type="AtlasTexture" id=5]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 130, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=10]
[sub_resource type="AtlasTexture" id=6]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 195, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=11]
[sub_resource type="AtlasTexture" id=7]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 260, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=12]
[sub_resource type="AtlasTexture" id=8]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 325, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=13]
[sub_resource type="AtlasTexture" id=15]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 0, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=14]
[sub_resource type="AtlasTexture" id=16]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 67, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=15]
[sub_resource type="AtlasTexture" id=17]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 134, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=16]
[sub_resource type="AtlasTexture" id=18]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 201, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=17]
[sub_resource type="AtlasTexture" id=19]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 268, 0, 67, 32 )
[sub_resource type="SpriteFrames" id=18]
[sub_resource type="SpriteFrames" id=20]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ],
"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ) ],
"loop": true,
"name": "Idle",
"speed": 3.0
}, {
<<<<<<< HEAD
"frames": [ SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ],
=======
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ],
>>>>>>> main
"loop": true,
"name": "Jump",
"speed": 8.0
}, {
"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ],
"frames": [ SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ) ],
"loop": true,
"name": "Running",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=19]
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
height = 2.0
[sub_resource type="CircleShape2D" id=20]
[sub_resource type="CircleShape2D" id=2]
radius = 50.0
[node name="Hellhound" type="KinematicBody2D" groups=[
"enemies",
]]
[node name="Hellhound" type="KinematicBody2D" groups=["enemies"]]
collision_layer = 2
script = ExtResource( 4 )
[node name="AnimatedSprite1" type="AnimatedSprite" parent="."]
position = Vector2( 1, -3 )
scale = Vector2( 0.5625, 0.5625 )
frames = SubResource( 18 )
frames = SubResource( 20 )
animation = "Idle"
frame = 5
playing = true
@@ -117,30 +136,30 @@ playing = true
[node name="Hitbox" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 0, -3 )
shape = SubResource( 19 )
shape = SubResource( 1 )
[node name="Player Detector" type="Area2D" parent="."]
input_pickable = false
monitorable = false
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector"]
visible = false
scale = Vector2( 1.5, 1.5 )
shape = SubResource( 20 )
shape = SubResource( 2 )
[node name="Player Attack" type="Area2D" parent="."]
visible = false
input_pickable = false
monitorable = false
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="Attack" type="CollisionShape2D" parent="Player Attack"]
visible = false
scale = Vector2( 0.5, 0.5 )
shape = SubResource( 20 )
shape = SubResource( 2 )
[node name="Light2D" type="Light2D" parent="."]
visible = false

View File

@@ -0,0 +1,28 @@
extends Area2D
const SPEED: int = 35
var player_position: Vector2
var velocity: Vector2 = Vector2.ZERO
func init(spawn_position: Vector2, shoot_position: Vector2) -> void:
position = spawn_position
player_position = shoot_position
$Sprite.rotation = player_position.angle_to_point(position) + deg2rad(90)
return
func _physics_process(delta: float) -> void:
velocity = Vector2.ZERO
if position.distance_to(player_position) > 1:
velocity = position.direction_to(player_position).normalized() * SPEED * delta
position += velocity
return
func _on_tifetime_timeout() -> void:
call_deferred('queue_free')
return

View File

@@ -0,0 +1,41 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Sprites/Assets/Light.png" type="Texture" id=1]
[ext_resource path="res://Sprites/Enemies/Projectiles/Creepy_Hand.png" type="Texture" id=2]
[ext_resource path="res://Enemies/Projectiles/Creepy Hand.gd" type="Script" id=3]
[sub_resource type="CircleShape2D" id=1]
radius = 12.0
[node name="Creepy Hand" type="Area2D" groups=["enemy_projectile_1"]]
light_mask = 0
scale = Vector2( 0.5, 0.5 )
collision_layer = 0
collision_mask = 2
input_pickable = false
monitoring = false
script = ExtResource( 3 )
[node name="Sprite" type="Sprite" parent="."]
light_mask = 0
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
light_mask = 0
shape = SubResource( 1 )
[node name="Light" type="Light2D" parent="."]
texture = ExtResource( 1 )
texture_scale = 0.3
color = Color( 0.698039, 0.211765, 0.984314, 1 )
energy = 1.5
range_item_cull_mask = 15
shadow_item_cull_mask = 0
[node name="Lifetime" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
autostart = true
[connection signal="timeout" from="Lifetime" to="." method="_on_tifetime_timeout"]