Implemented win/lose scenes and added fire spinner trap
This commit is contained in:
@@ -6,97 +6,94 @@
|
||||
[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/Chasing_Glowing_Ghost.png" type="Texture" id=7]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 0, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 65, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 130, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 195, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 260, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 325, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=15]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 0, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=16]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 67, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=17]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 134, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=18]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 201, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=19]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 268, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=9]
|
||||
[sub_resource type="AtlasTexture" id=23]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 0, 0, 64, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=10]
|
||||
[sub_resource type="AtlasTexture" id=24]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 64, 0, 64, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=11]
|
||||
[sub_resource type="AtlasTexture" id=25]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 128, 0, 64, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=12]
|
||||
[sub_resource type="AtlasTexture" id=26]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 192, 0, 64, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=13]
|
||||
[sub_resource type="AtlasTexture" id=27]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 256, 0, 64, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=14]
|
||||
[sub_resource type="AtlasTexture" id=28]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 320, 0, 64, 32 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=20]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ],
|
||||
[sub_resource type="AtlasTexture" id=29]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 0, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=30]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 67, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=31]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 134, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=32]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 201, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=33]
|
||||
atlas = ExtResource( 6 )
|
||||
region = Rect2( 268, 0, 67, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=34]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 0, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=35]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 65, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=36]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 130, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=37]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 195, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=38]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 260, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=39]
|
||||
atlas = ExtResource( 5 )
|
||||
region = Rect2( 325, 0, 65, 48 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=40]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ) ],
|
||||
"loop": true,
|
||||
"name": "Jump",
|
||||
"speed": 8.0
|
||||
"name": "Idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ],
|
||||
"frames": [ SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ) ],
|
||||
"loop": true,
|
||||
"name": "Running",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ) ],
|
||||
"frames": [ SubResource( 34 ), SubResource( 35 ), SubResource( 36 ), SubResource( 37 ), SubResource( 38 ), SubResource( 39 ) ],
|
||||
"loop": true,
|
||||
"name": "Idle",
|
||||
"speed": 3.0
|
||||
"name": "Jump",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=21]
|
||||
radius = 1.5
|
||||
height = 3.0
|
||||
@@ -115,14 +112,13 @@ radius = 25.02
|
||||
light_mask = 0
|
||||
collision_layer = 4
|
||||
collision_mask = 5
|
||||
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="AnimatedSprite1" type="AnimatedSprite" parent="."]
|
||||
light_mask = 0
|
||||
position = Vector2( 1, -3 )
|
||||
scale = Vector2( 0.5625, 0.5625 )
|
||||
frames = SubResource( 18 )
|
||||
frames = SubResource( 40 )
|
||||
animation = "Idle"
|
||||
frame = 3
|
||||
playing = true
|
||||
@@ -131,7 +127,6 @@ playing = true
|
||||
visible = false
|
||||
light_mask = 4
|
||||
position = Vector2( 0, -3 )
|
||||
|
||||
texture = ExtResource( 7 )
|
||||
offset = Vector2( 0, 0.5 )
|
||||
|
||||
@@ -155,15 +150,11 @@ shape = SubResource( 1 )
|
||||
light_mask = 0
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
|
||||
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( 2 )
|
||||
|
||||
@@ -171,12 +162,8 @@ shape = SubResource( 2 )
|
||||
light_mask = 0
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
|
||||
input_pickable = false
|
||||
monitorable = false
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector - Attack"]
|
||||
shape = SubResource( 22 )
|
||||
@@ -191,7 +178,6 @@ monitorable = false
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player Detector - Attack2"]
|
||||
shape = SubResource( 22 )
|
||||
|
||||
|
||||
[node name="Light" type="Light2D" parent="."]
|
||||
visible = false
|
||||
texture = ExtResource( 2 )
|
||||
|
21
Enemies/Projectiles/Glowing Fireball.gd
Normal file
21
Enemies/Projectiles/Glowing Fireball.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends Area2D
|
||||
|
||||
const SPEED: int = 50
|
||||
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
|
||||
|
||||
func init(spawn_position: Vector2, shoot_position: Vector2) -> void:
|
||||
position = spawn_position
|
||||
velocity = position.direction_to(shoot_position).normalized() * SPEED
|
||||
return
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position += velocity * delta
|
||||
return
|
||||
|
||||
|
||||
func _on_tifetime_timeout() -> void:
|
||||
call_deferred('queue_free')
|
||||
return
|
40
Enemies/Projectiles/Glowing Fireball.tscn
Normal file
40
Enemies/Projectiles/Glowing Fireball.tscn
Normal file
@@ -0,0 +1,40 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/Assets/Light.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Enemies/Projectiles/Glowing Fireball.gd" type="Script" id=2]
|
||||
[ext_resource path="res://Sprites/Enemies/Projectiles/Glowing_Fireball.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 12.0
|
||||
|
||||
[node name="Glowing Fireball" 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( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 3 )
|
||||
|
||||
[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.984314, 0.282353, 0.211765, 1 )
|
||||
energy = 1.5
|
||||
range_item_cull_mask = 15
|
||||
shadow_item_cull_mask = 0
|
||||
|
||||
[node name="Lifetime" type="Timer" parent="."]
|
||||
wait_time = 1.5
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="Lifetime" to="." method="_on_tifetime_timeout"]
|
Reference in New Issue
Block a user