added l4 win condition

This commit is contained in:
2021-12-09 22:35:48 -06:00
parent 022c084d28
commit 8e64a3677f
98 changed files with 527 additions and 350 deletions

View File

@@ -7,7 +7,7 @@ var velocity: Vector2 = Vector2.ZERO
var health: int = 15
var hit: bool = false
var counter: int = 0
signal demon_boss_death
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
@@ -60,6 +60,7 @@ func _on_hitbox_area_entered(area: Area2D) -> void:
if health <= 0:
call_deferred('queue_free')
emit_signal("demon_boss_death")
return
func _on_Player_Detector__Attack_body_entered(body: Node) -> void:

View File

@@ -10,49 +10,49 @@ var counter: int = 0
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
velocity = Vector2.ZERO
if player and position.distance_to(player.position) > 1:
velocity = position.direction_to(player.position).normalized() * SPEED
if player and position.distance_to(player.position) > 1:
velocity = position.direction_to(player.position).normalized() * SPEED
if hit == true:
if counter < 15:
if counter % 5 == 0:
$AnimatedSprite.visible = false
else:
$AnimatedSprite.visible = true
counter += 1
velocity = Vector2.ZERO
else:
counter = 0
hit = false
if hit == true:
if counter < 15:
if counter % 5 == 0:
$AnimatedSprite.visible = false
else:
$AnimatedSprite.visible = true
counter += 1
velocity = Vector2.ZERO
else:
counter = 0
hit = false
velocity = move_and_slide(velocity)
return
velocity = move_and_slide(velocity)
return
func _on_player_detector_body_entered(body: Node) -> void:
if body.is_in_group('player'):
player = body
return
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
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
hit = true
elif area.is_in_group('player_weapon_2'):
health -= 2
hit = true
if area.is_in_group('player_weapon_1'):
health -= 1
hit = true
elif area.is_in_group('player_weapon_2'):
health -= 2
hit = true
if health <= 0:
call_deferred('queue_free')
return
if health <= 0:
call_deferred('queue_free')
return

View File

@@ -10,65 +10,65 @@ var counter: int = 0
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
velocity = Vector2.ZERO
if player and position.distance_to(player.position) > 1:
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 and position.distance_to(player.position) > 1:
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 hit == true:
if counter < 15:
if counter % 5 == 0:
$AnimatedSprite1.visible = false
else:
$AnimatedSprite1.visible = true
counter += 1
velocity = Vector2.ZERO
else:
counter = 0
hit = false
if hit == true:
if counter < 15:
if counter % 5 == 0:
$AnimatedSprite1.visible = false
else:
$AnimatedSprite1.visible = true
counter += 1
velocity = Vector2.ZERO
else:
counter = 0
hit = false
velocity = move_and_slide(velocity)
return
velocity = move_and_slide(velocity)
return
func _on_player_detector_body_entered(body: Node) -> void:
if body.is_in_group('player'):
player = body
$AnimatedSprite1.animation = 'Running'
return
if body.is_in_group('player'):
player = body
$AnimatedSprite1.animation = 'Running'
return
func _on_player_detector_body_exited(body: Node) -> void:
if body.is_in_group('player'):
player = null
$AnimatedSprite1.animation = 'Idle'
return
if body.is_in_group('player'):
player = null
$AnimatedSprite1.animation = 'Idle'
return
func _on_hitbox_area_entered(area: Area2D) -> void:
if area.is_in_group('player_weapon_1'):
health -= 1
hit = true
elif area.is_in_group('player_weapon_2'):
health -= 2
hit = true
if area.is_in_group('player_weapon_1'):
health -= 1
hit = true
elif area.is_in_group('player_weapon_2'):
health -= 2
hit = true
if health <= 0:
call_deferred('queue_free')
return
if health <= 0:
call_deferred('queue_free')
return
func _on_Player_Detector__Attack_body_entered(body: Node) -> void:
if body.is_in_group('player'):
player = body
$AnimatedSprite1.animation = 'Jump'
if body.is_in_group('player'):
player = body
$AnimatedSprite1.animation = 'Jump'
func _on_Player_Detector__Attack_body_exited(body: Node) -> void:
if body.is_in_group('player'):
player = body
$AnimatedSprite1.animation = 'Running'
if body.is_in_group('player'):
player = body
$AnimatedSprite1.animation = 'Running'

View File

@@ -1,10 +1,99 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=30 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_Run.png" type="Texture" id=3]
[ext_resource path="res://Enemies/Hellhound.gd" type="Script" id=4]
[ext_resource path="res://Sprites/Enemies/Hell_Hound_Idle.png" type="Texture" id=5]
[ext_resource path="res://Sprites/Enemies/Hell_Hound_Jump.png" type="Texture" id=6]
[ext_resource path="res://Sprites/Enemies/Chasing_Glowing_Ghost.png" type="Texture" id=7]
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 6 )
region = Rect2( 0, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 6 )
region = Rect2( 65, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 6 )
region = Rect2( 130, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 6 )
region = Rect2( 195, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 6 )
region = Rect2( 260, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 6 )
region = Rect2( 325, 0, 65, 48 )
[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 3 )
region = Rect2( 67, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 3 )
region = Rect2( 134, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 3 )
region = Rect2( 201, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 3 )
region = Rect2( 268, 0, 67, 32 )
[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 5 )
region = Rect2( 0, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 5 )
region = Rect2( 64, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=18]
atlas = ExtResource( 5 )
region = Rect2( 128, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=19]
atlas = ExtResource( 5 )
region = Rect2( 192, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=20]
atlas = ExtResource( 5 )
region = Rect2( 256, 0, 64, 32 )
[sub_resource type="AtlasTexture" id=21]
atlas = ExtResource( 5 )
region = Rect2( 320, 0, 64, 32 )
[sub_resource type="SpriteFrames" id=22]
animations = [ {
"frames": [ SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ],
"loop": true,
"name": "Jump",
"speed": 5.0
}, {
"frames": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ) ],
"loop": true,
"name": "Running",
"speed": 5.0
}, {
"frames": [ SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ) ],
"loop": true,
"name": "Idle",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=1]
radius = 1.5
height = 3.0
@@ -19,9 +108,7 @@ radius = 82.0061
[sub_resource type="CircleShape2D" id=4]
radius = 25.02
[node name="Hellhound" type="KinematicBody2D" groups=[
"enemy",
]]
[node name="Hellhound" type="KinematicBody2D" groups=["enemy"]]
light_mask = 0
collision_layer = 4
collision_mask = 5
@@ -31,6 +118,8 @@ script = ExtResource( 4 )
light_mask = 0
position = Vector2( 1, -3 )
scale = Vector2( 0.5625, 0.5625 )
frames = SubResource( 22 )
animation = "Idle"
playing = true
[node name="Sprite" type="Sprite" parent="."]
@@ -46,9 +135,7 @@ light_mask = 0
rotation = 1.5708
shape = SubResource( 1 )
[node name="Hitbox" type="Area2D" parent="." groups=[
"enemy_hitbox_1",
]]
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox_1"]]
light_mask = 0
collision_layer = 4
collision_mask = 2
@@ -60,10 +147,10 @@ shape = SubResource( 2 )
[node name="Player Detector" type="Area2D" parent="."]
light_mask = 0
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
@@ -72,20 +159,20 @@ shape = SubResource( 3 )
[node name="Player Detector - Attack" type="Area2D" parent="."]
light_mask = 0
input_pickable = false
monitorable = false
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector - Attack"]
shape = SubResource( 4 )
[node name="Player Detector - Attack2" type="Area2D" parent="."]
light_mask = 0
input_pickable = false
monitorable = false
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector - Attack2"]
shape = SubResource( 4 )