Merge branch 'main' into tiff

This commit is contained in:
tiffanyfrias10
2021-12-05 20:05:14 -06:00
115 changed files with 3371 additions and 107 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,80 @@
[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=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 = 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( 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.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 = 3
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"]

50
Enemies/DemonBoss.gd Normal file
View File

@@ -0,0 +1,50 @@
extends KinematicBody2D
const SPEED: int = 30
var player: KinematicBody2D = null
var velocity: Vector2 = Vector2.ZERO
var status = "walk"
func _physics_process(_delta: float) -> void:
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
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
func _on_player_detector_area_exited(_area: Area2D):
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
func _on_Player_Attack_area_exited(area: Area2D) -> void:
player = null
if not status == "attack":
$AnimatedSprite1.animation = "Walk"
return

404
Enemies/DemonBoss.tscn Normal file
View File

@@ -0,0 +1,404 @@
[gd_scene load_steps=68 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/demon_slime_FREE_v1.0_288x160_spritesheet.png" type="Texture" id=3]
[ext_resource path="res://Enemies/DemonBoss.gd" type="Script" id=4]
[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 288, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=5]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 576, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=6]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 864, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=7]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1152, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=8]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1440, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=9]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1728, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=10]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2016, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=11]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2304, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=12]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2592, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=13]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2880, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=14]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 3168, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=15]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 3456, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=16]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 3744, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=17]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 4032, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=18]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 4320, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=19]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 4608, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=20]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 4896, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=21]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 5184, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=22]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 5472, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=23]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 5760, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=24]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 6048, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=25]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=26]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 288, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=27]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 576, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=28]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 864, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=29]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1152, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=30]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1440, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=31]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1728, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=32]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2016, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=33]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2304, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=34]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2592, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=35]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2880, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=36]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 3168, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=37]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=38]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 288, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=39]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 576, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=40]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 864, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=41]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1152, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=42]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1440, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=43]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=44]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 288, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=45]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 576, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=46]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 864, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=47]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1152, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=48]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1440, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=49]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1728, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=50]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2016, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=51]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2304, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=52]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2592, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=53]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 2880, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=54]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 3168, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=55]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 3456, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=56]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 3744, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=57]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 4032, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=58]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=59]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 288, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=60]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 576, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=61]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 864, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=62]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 1152, 480, 288, 160 )
[sub_resource type="SpriteFrames" id=63]
animations = [ {
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ) ],
"loop": true,
"name": "Death",
"speed": 5.0
}, {
"frames": [ SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ), SubResource( 34 ), SubResource( 35 ), SubResource( 36 ) ],
"loop": true,
"name": "Walk",
"speed": 5.0
}, {
"frames": [ SubResource( 37 ), SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ) ],
"loop": true,
"name": "Idle",
"speed": 5.0
}, {
"frames": [ SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 56 ), SubResource( 57 ) ],
"loop": true,
"name": "Attack",
"speed": 15.0
}, {
"frames": [ SubResource( 58 ), SubResource( 59 ), SubResource( 60 ), SubResource( 61 ), SubResource( 62 ) ],
"loop": true,
"name": "Hit",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
height = 2.0
[sub_resource type="CircleShape2D" id=2]
radius = 50.0
[node name="DemonBoss" type="KinematicBody2D" groups=["enemies"]]
collision_layer = 2
script = ExtResource( 4 )
[node name="AnimatedSprite1" type="AnimatedSprite" parent="."]
position = Vector2( 1, -3 )
scale = Vector2( 0.5, 0.5 )
frames = SubResource( 63 )
animation = "Idle"
playing = true
[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"]
scale = Vector2( 2, 2 )
shape = SubResource( 2 )
[node name="Player Attack" type="Area2D" parent="."]
visible = false
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="Attack" type="CollisionShape2D" parent="Player Attack"]
position = Vector2( 0, 7 )
scale = Vector2( 1, 0.75 )
shape = SubResource( 2 )
[node name="Light2D" type="Light2D" parent="."]
visible = false
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="."]
visible = false
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
offset = Vector2( 5, -40 )
range_item_cull_mask = 4
[node name="LightOccluder2D" type="LightOccluder2D" parent="."]
visible = false
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"]
[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"]

View File

@@ -19,6 +19,7 @@ func _physics_process(_delta: float) -> void:
func _on_player_detector_area_entered(area: Area2D) -> void:
if area.get_parent().name == 'Player':
player = area.get_parent()
return

View File

@@ -1,9 +1,32 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=11 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]
[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]
[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 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
@@ -12,14 +35,14 @@ height = 2.0
[sub_resource type="CircleShape2D" id=2]
radius = 50.0
[node name="Glowing Ghost" type="KinematicBody2D" groups=["enemies"]]
[node name="Flaming Skull" 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="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.0446429, 0.0446429 )
frames = SubResource( 6 )
playing = true
[node name="Hitbox" type="CollisionShape2D" parent="."]
visible = false
@@ -37,6 +60,7 @@ visible = false
shape = SubResource( 2 )
[node name="Light2D" type="Light2D" parent="."]
visible = false
scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 2 )
color = Color( 0.984314, 0.94902, 0.211765, 0.392157 )
@@ -44,12 +68,14 @@ energy = 2.0
range_item_cull_mask = 11
[node name="Light2DEyes" type="Light2D" parent="."]
visible = false
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
offset = Vector2( 5, -40 )
range_item_cull_mask = 4
[node name="LightOccluder2D" type="LightOccluder2D" parent="."]
visible = false
show_behind_parent = true
occluder = ExtResource( 1 )

47
Enemies/Hellhound.gd Normal file
View File

@@ -0,0 +1,47 @@
extends KinematicBody2D
const SPEED: int = 60
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
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
func _on_player_detector_area_entered(area: Area2D) -> void:
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
func _on_Player_Attack_area_entered(area: Area2D) -> void:
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

183
Enemies/Hellhound.tscn Normal file
View File

@@ -0,0 +1,183 @@
[gd_scene load_steps=27 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/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]
[sub_resource type="AtlasTexture" id=9]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=10]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 64, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=11]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 128, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=12]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 192, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=13]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 256, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=14]
flags = 4
atlas = ExtResource( 3 )
region = Rect2( 320, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 0, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 65, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=5]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 130, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=6]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 195, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=7]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 260, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=8]
flags = 4
atlas = ExtResource( 5 )
region = Rect2( 325, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=15]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 0, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=16]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 67, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=17]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 134, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=18]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 201, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=19]
flags = 4
atlas = ExtResource( 6 )
region = Rect2( 268, 0, 67, 32 )
[sub_resource type="SpriteFrames" id=20]
animations = [ {
"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ) ],
"loop": true,
"name": "Idle",
"speed": 3.0
}, {
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ],
"loop": true,
"name": "Jump",
"speed": 8.0
}, {
"frames": [ SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ) ],
"loop": true,
"name": "Running",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
height = 2.0
[sub_resource type="CircleShape2D" id=2]
radius = 50.0
[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( 20 )
animation = "Idle"
frame = 5
playing = true
[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
scale = Vector2( 1.5, 1.5 )
shape = SubResource( 2 )
[node name="Player Attack" type="Area2D" parent="."]
visible = 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( 2 )
[node name="Light2D" type="Light2D" parent="."]
visible = false
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="."]
visible = false
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
offset = Vector2( 5, -40 )
range_item_cull_mask = 4
[node name="LightOccluder2D" type="LightOccluder2D" parent="."]
visible = false
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"]
[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"]

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"]