Trying to add new enemy

This commit is contained in:
Jasmine
2021-12-04 17:54:29 -06:00
parent 1e8a8a15f8
commit 5a3ae103f5
20 changed files with 865 additions and 120 deletions

16
Enemies/Ghost_Enemy.gd Normal file
View File

@@ -0,0 +1,16 @@
extends KinematicBody2D
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
onready var animation_player: AnimationPlayer = get_node("AnimationPlayer")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
animation_player.play("appear")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

38
Enemies/Ghost_Enemy.tscn Normal file
View File

@@ -0,0 +1,38 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Enemies/Ghost_Enemy.gd" type="Script" id=5]
[sub_resource type="Animation" id=1]
resource_name = "appear"
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( ),
"transitions": PoolRealArray( ),
"update": 1,
"values": [ ]
}
[sub_resource type="Animation" id=3]
resource_name = "idle"
length = 4.0
step = 0.6
[sub_resource type="CircleShape2D" id=28]
radius = 28.3009
[node name="KinematicBody2D" type="KinematicBody2D"]
script = ExtResource( 5 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/appear = SubResource( 1 )
anims/idle = SubResource( 3 )
[node name="Sprite" type="Sprite" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 28 )

View File

@@ -256,6 +256,6 @@ animations = [ {
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 56 )
animation = "attack"
frame = 11
animation = "running"
frame = 4
playing = true

View File

@@ -1,6 +1,7 @@
extends Area2D
onready var portal = get_node("../PortalDarkForest")
onready var shape = portal.get_child(0)
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
@@ -8,7 +9,7 @@ extends Area2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
self.visible = false
shape.set_deferred("disabled",true)
# Called every frame. 'delta' is the elapsed time since the previous frame.
@@ -16,5 +17,5 @@ func _ready() -> void:
# pass
func _on_Area2D_body_entered(body: Node) -> void:
self.visible = true
func _on_ChestDetection_body_entered(body: Node) -> void:
shape.set_deferred("disabled",false)

View File

@@ -16,11 +16,10 @@ func _ready() -> void:
# pass
func _on_Area2D_body_entered(body: Node) -> void:
self.limit_bottom = -223
self.limit_top = -737
func _on_PortalDarkForest_body_entered(body: Node) -> void:
self.limit_bottom = -224
self.limit_top = -736
self.limit_left = -32
self.limit_right = 448
var player = get_parent()
player.position = Vector2(-216,256)
#$YSort/Player/Camera2D.limit_bottom = -223
#$YSort/Player/Camera2D.limit_top = -737
player.position = Vector2(256,-232)

File diff suppressed because one or more lines are too long

View File

@@ -33,8 +33,6 @@ func _drop_object() -> void:
func _on_Area2D_player_entered(_player: KinematicBody2D) -> void:
is_player_inside = true
func _on_Area2D_player_exited(_player: KinematicBody2D) -> void:
is_player_inside = false

View File

@@ -127,7 +127,7 @@ tracks/3/keys = {
"values": [ 0 ]
}
[sub_resource type="SpriteFrames" id=6]
[sub_resource type="SpriteFrames" id=5]
animations = [ {
"frames": [ ExtResource( 6 ) ],
"loop": true,
@@ -140,12 +140,13 @@ animations = [ {
"speed": 5.0
} ]
[sub_resource type="Animation" id=8]
[sub_resource type="Animation" id=6]
resource_name = "closed"
[node name="TreasureChest" type="AnimatedSprite"]
position = Vector2( 1, 0 )
frames = SubResource( 1 )
animation = "open"
animation = "closed"
script = ExtResource( 3 )
[node name="Area" type="Area2D" parent="."]
@@ -166,12 +167,12 @@ texture = ExtResource( 4 )
[node name="Tween" type="Tween" parent="Key"]
[node name="Entrance" type="AnimatedSprite" parent="."]
position = Vector2( 494, -675 )
frames = SubResource( 6 )
animation = "open"
position = Vector2( 403, -715 )
frames = SubResource( 5 )
animation = "closed"
[node name="AnimationPlayer" type="AnimationPlayer" parent="Entrance"]
anims/closed = SubResource( 8 )
anims/closed = SubResource( 6 )
[connection signal="body_entered" from="Area" to="." method="_on_Area2D_player_entered"]
[connection signal="body_exited" from="Area" to="." method="_on_Area2D_player_exited"]

View File

@@ -0,0 +1,17 @@
extends Area2D
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
self.visible = false
$CollisionShape2D.visible = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

View File

@@ -22,11 +22,6 @@ animations = [ {
"loop": false,
"name": "look_down",
"speed": 5.0
}, {
"frames": [ ExtResource( 4 ) ],
"loop": false,
"name": "look_up",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=2]

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/ghost-appears.png-b817d1b29a37538d16648d8e950a1a90.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Sprites/Assets/ghost-appears.png"
dest_files=[ "res://.import/ghost-appears.png-b817d1b29a37538d16648d8e950a1a90.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/ghost-idle.png-5c86d015d4c1bb4c6c48d0f2eadc5209.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Sprites/Assets/ghost-idle.png"
dest_files=[ "res://.import/ghost-idle.png-5c86d015d4c1bb4c6c48d0f2eadc5209.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/ghost-shriek.png-59aa7ef45953ad35a66d5712d8dc79dc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Sprites/Assets/ghost-shriek.png"
dest_files=[ "res://.import/ghost-shriek.png-59aa7ef45953ad35a66d5712d8dc79dc.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/ghost-vanish.png-c825b21e42ac597e6e145cc1f5dce90b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Sprites/Assets/ghost-vanish.png"
dest_files=[ "res://.import/ghost-vanish.png-c825b21e42ac597e6e145cc1f5dce90b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Sprites/Assets/global.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/global.png-2f1dfd57d5a3af1294620818fd78a663.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Sprites/Assets/global.png"
dest_files=[ "res://.import/global.png-2f1dfd57d5a3af1294620818fd78a663.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0