Compare commits
No commits in common. "6aed49924eb6caa48a830880d16713a04b48741c" and "592c8dffb1635ecaa4b9df51a9b22cbafd1df1bf" have entirely different histories.
6aed49924e
...
592c8dffb1
|
|
@ -13,6 +13,9 @@
|
||||||
[node name="Main" type="Node2D"]
|
[node name="Main" type="Node2D"]
|
||||||
|
|
||||||
[node name="Level" parent="." instance=ExtResource( 1 )]
|
[node name="Level" parent="." instance=ExtResource( 1 )]
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource( 14 )]
|
[node name="Player" parent="." instance=ExtResource( 14 )]
|
||||||
position = Vector2( 859, 236 )
|
position = Vector2( 859, 236 )
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
|
|
@ -1,35 +0,0 @@
|
||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="StreamTexture"
|
|
||||||
path="res://.import/elevator.png-acbb9d6b280a7beb809eaa023b52f90b.stex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://assets/elevator.png"
|
|
||||||
dest_files=[ "res://.import/elevator.png-acbb9d6b280a7beb809eaa023b52f90b.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
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
stream=false
|
|
||||||
size_limit=0
|
|
||||||
detect_3d=true
|
|
||||||
svg/scale=1.0
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
[gd_scene load_steps=13 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
|
||||||
[ext_resource path="res://src/Actors/Platform/PlatformVMove/states2/move.gd" type="Script" id=2]
|
|
||||||
[ext_resource path="res://src/Actors/Platform/PlatformVMove/states2/idle.gd" type="Script" id=3]
|
|
||||||
|
|
||||||
[sub_resource type="StreamTexture" id=1]
|
|
||||||
load_path = "res://.import/elevator.png-acbb9d6b280a7beb809eaa023b52f90b.stex"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=2]
|
|
||||||
atlas = SubResource( 1 )
|
|
||||||
region = Rect2( 0, 0, 86, 44 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=3]
|
|
||||||
atlas = SubResource( 1 )
|
|
||||||
region = Rect2( 86, 0, 86, 44 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=4]
|
|
||||||
atlas = SubResource( 1 )
|
|
||||||
region = Rect2( 172, 0, 86, 44 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=5]
|
|
||||||
atlas = SubResource( 1 )
|
|
||||||
region = Rect2( 0, 44, 86, 44 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=6]
|
|
||||||
atlas = SubResource( 1 )
|
|
||||||
region = Rect2( 86, 44, 86, 44 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=7]
|
|
||||||
atlas = SubResource( 1 )
|
|
||||||
region = Rect2( 172, 44, 86, 44 )
|
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=8]
|
|
||||||
animations = [ {
|
|
||||||
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "default",
|
|
||||||
"speed": 5.0
|
|
||||||
} ]
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=9]
|
|
||||||
extents = Vector2( 38, 15.5 )
|
|
||||||
|
|
||||||
[node name="PlatformVMove" instance=ExtResource( 1 )]
|
|
||||||
collision_layer = 0
|
|
||||||
collision_mask = 2
|
|
||||||
motion/sync_to_physics = true
|
|
||||||
actor_type = "Object"
|
|
||||||
|
|
||||||
[node name="AnimatedSprite" parent="." index="0"]
|
|
||||||
frames = SubResource( 8 )
|
|
||||||
frame = 1
|
|
||||||
__meta__ = {
|
|
||||||
"_aseprite_wizard_config_": {
|
|
||||||
"layer": "",
|
|
||||||
"o_ex_p": "",
|
|
||||||
"o_folder": "res://assets",
|
|
||||||
"o_name": "",
|
|
||||||
"only_visible": true,
|
|
||||||
"op_exp": false,
|
|
||||||
"slice": "",
|
|
||||||
"source": "D:/Sync/Assets/Library/elevator.ase"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"]
|
|
||||||
position = Vector2( 0, -3.5 )
|
|
||||||
shape = SubResource( 9 )
|
|
||||||
|
|
||||||
[node name="movement_state_machine" parent="." index="3"]
|
|
||||||
debug_state_machine = true
|
|
||||||
|
|
||||||
[node name="idle" parent="movement_state_machine" index="0"]
|
|
||||||
script = ExtResource( 3 )
|
|
||||||
debug_state = true
|
|
||||||
timeout_seconds = 2.0
|
|
||||||
move_speed = 0.0
|
|
||||||
|
|
||||||
[node name="move" parent="movement_state_machine" index="2"]
|
|
||||||
script = ExtResource( 2 )
|
|
||||||
debug_state = true
|
|
||||||
timeout_seconds = 1.0
|
|
||||||
move_speed = 30.0
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
extends StateAnimatedActor
|
|
||||||
|
|
||||||
export (NodePath) var move_node
|
|
||||||
|
|
||||||
onready var move_state: State = get_node(move_node)
|
|
||||||
|
|
||||||
func enter() -> void:
|
|
||||||
.enter()
|
|
||||||
# parent.set_hurtbox(true)
|
|
||||||
if debug_state:
|
|
||||||
print(owner.name, " Move Component: ", move_component.desired_movement_vector.x)
|
|
||||||
state_timeout.start()
|
|
||||||
|
|
||||||
func process_frame(delta):
|
|
||||||
if state_timeout.time_left == 0:
|
|
||||||
return move_state
|
|
||||||
return null
|
|
||||||
|
|
||||||
func process_physics(delta: float) -> State:
|
|
||||||
|
|
||||||
# parent.velocity.y += gravity * delta
|
|
||||||
# #parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
|
||||||
# parent.velocity.x = move_component.desired_movement_vector.x * move_speed
|
|
||||||
# parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
|
||||||
|
|
||||||
return null
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
extends StateAnimatedActor
|
|
||||||
|
|
||||||
export (NodePath) var idle_node
|
|
||||||
|
|
||||||
onready var idle_state: State = get_node(idle_node)
|
|
||||||
|
|
||||||
var flip_flop:bool = false
|
|
||||||
var recoil_velocity = Vector2.ZERO
|
|
||||||
var max_recoil:float = 8.0
|
|
||||||
|
|
||||||
func enter() -> void:
|
|
||||||
.enter()
|
|
||||||
# parent.set_hurtbox(true)
|
|
||||||
if debug_state:
|
|
||||||
print(owner.name, " Move Component: ", move_component.desired_movement_vector.x)
|
|
||||||
state_timeout.start()
|
|
||||||
|
|
||||||
|
|
||||||
func process_physics(delta: float) -> State:
|
|
||||||
|
|
||||||
if state_timeout.time_left == 0:
|
|
||||||
if flip_flop:
|
|
||||||
move_component.velocity.y = move_speed
|
|
||||||
flip_flop = false
|
|
||||||
return idle_state
|
|
||||||
else:
|
|
||||||
move_component.velocity.y = move_speed * - 1
|
|
||||||
flip_flop = true
|
|
||||||
return idle_state
|
|
||||||
|
|
||||||
#move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
|
||||||
#var collision = parent.move_and_collide(move_component.velocity * delta, true, true, true)
|
|
||||||
# var collision = parent.move_and_collide(Vector2.UP, true, true, true)
|
|
||||||
#
|
|
||||||
# if collision and recoil_velocity == Vector2.ZERO:
|
|
||||||
# print("Get off me!")
|
|
||||||
# recoil_velocity.y += max_recoil * delta
|
|
||||||
|
|
||||||
|
|
||||||
# if collision and recoil_velocity == Vector2.ZERO:
|
|
||||||
# print("Get off me!")
|
|
||||||
# recoil_velocity.y += max_recoil * delta
|
|
||||||
# else:
|
|
||||||
# if recoil_velocity.y < max_recoil:
|
|
||||||
# recoil_velocity.y -= max_recoil * delta
|
|
||||||
# else:
|
|
||||||
# recoil_velocity.y += max_recoil * delta
|
|
||||||
# if recoil_velocity.y < 0:
|
|
||||||
# recoil_velocity = Vector2.ZERO
|
|
||||||
|
|
||||||
#parent.global_translate(move_component.velocity * delta)
|
|
||||||
|
|
||||||
parent.position += (move_component.velocity + recoil_velocity) * delta
|
|
||||||
|
|
||||||
return null
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene load_steps=18 format=2]
|
[gd_scene load_steps=18 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/Actors/Platform/PlatformVMove/PlatformVMove.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/Tiles/Assets/Demo TileSet.tres" type="TileSet" id=2]
|
[ext_resource path="res://assets/Tiles/Assets/Demo TileSet.tres" type="TileSet" id=2]
|
||||||
[ext_resource path="res://assets/Backgrounds/bgmuck.png" type="Texture" id=3]
|
[ext_resource path="res://assets/Backgrounds/bgmuck.png" type="Texture" id=3]
|
||||||
[ext_resource path="res://src/Interactables/Chest.tscn" type="PackedScene" id=4]
|
[ext_resource path="res://src/Interactables/Chest.tscn" type="PackedScene" id=4]
|
||||||
|
|
@ -118,6 +118,13 @@ __meta__ = {
|
||||||
[node name="EnemyC2" parent="." instance=ExtResource( 7 )]
|
[node name="EnemyC2" parent="." instance=ExtResource( 7 )]
|
||||||
position = Vector2( 494, 39 )
|
position = Vector2( 494, 39 )
|
||||||
|
|
||||||
|
[node name="ActorTemplate" parent="." instance=ExtResource( 1 )]
|
||||||
|
position = Vector2( 262, 44 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
actor_type = "NPC"
|
||||||
|
|
||||||
[node name="HealthPickup" parent="." instance=ExtResource( 5 )]
|
[node name="HealthPickup" parent="." instance=ExtResource( 5 )]
|
||||||
position = Vector2( 226, 153 )
|
position = Vector2( 226, 153 )
|
||||||
|
|
||||||
|
|
@ -175,6 +182,3 @@ collision_mask = 0
|
||||||
modulate = Color( 0.360784, 0.0901961, 0.0901961, 1 )
|
modulate = Color( 0.360784, 0.0901961, 0.0901961, 1 )
|
||||||
position = Vector2( 441, 283 )
|
position = Vector2( 441, 283 )
|
||||||
shape = SubResource( 6 )
|
shape = SubResource( 6 )
|
||||||
|
|
||||||
[node name="PlatformVMove" parent="." instance=ExtResource( 1 )]
|
|
||||||
position = Vector2( 359, 319 )
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene load_steps=20 format=2]
|
[gd_scene load_steps=20 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/Level.gd" type="Script" id=1]
|
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/Tiles/Assets/Demo TileSet.tres" type="TileSet" id=2]
|
[ext_resource path="res://assets/Tiles/Assets/Demo TileSet.tres" type="TileSet" id=2]
|
||||||
[ext_resource path="res://assets/High Forest/Background/Background.png" type="Texture" id=3]
|
[ext_resource path="res://assets/High Forest/Background/Background.png" type="Texture" id=3]
|
||||||
[ext_resource path="res://assets/High Forest/Assets/Tiles.png" type="Texture" id=4]
|
[ext_resource path="res://assets/High Forest/Assets/Tiles.png" type="Texture" id=4]
|
||||||
|
|
@ -219,7 +219,6 @@ points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||||
4/z_index = 0
|
4/z_index = 0
|
||||||
|
|
||||||
[node name="Level3" type="Node2D"]
|
[node name="Level3" type="Node2D"]
|
||||||
script = ExtResource( 1 )
|
|
||||||
|
|
||||||
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
||||||
scroll_base_scale = Vector2( 0.4, 1 )
|
scroll_base_scale = Vector2( 0.4, 1 )
|
||||||
|
|
@ -284,8 +283,12 @@ __meta__ = {
|
||||||
"_edit_lock_": true
|
"_edit_lock_": true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="ActorTemplate" parent="." instance=ExtResource( 1 )]
|
||||||
|
position = Vector2( 221, 135 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
actor_type = "NPC"
|
||||||
|
|
||||||
[node name="EnemyC3" parent="." instance=ExtResource( 7 )]
|
[node name="EnemyC3" parent="." instance=ExtResource( 7 )]
|
||||||
position = Vector2( 796, 89 )
|
position = Vector2( 796, 89 )
|
||||||
|
|
||||||
[node name="PlayerStart" type="Position2D" parent="."]
|
|
||||||
position = Vector2( 89, 103 )
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ extends KinematicBody2D
|
||||||
#var velocity = Vector2(0,0)
|
#var velocity = Vector2(0,0)
|
||||||
#var direction = Vector2(-1,0)
|
#var direction = Vector2(-1,0)
|
||||||
|
|
||||||
export(String, "Player", "Enemy", "NPC", "Object") var actor_type
|
export(String, "Player", "Enemy", "NPC") var actor_type
|
||||||
#export var sprite_facing_right: bool = true
|
#export var sprite_facing_right: bool = true
|
||||||
export(Array, Resource) var SoundEffects
|
export(Array, Resource) var SoundEffects
|
||||||
export var debug_actor: bool = false
|
export var debug_actor: bool = false
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=34 format=2]
|
[gd_scene load_steps=33 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://src/enemyC/enemyC_movement_component.gd" type="Script" id=2]
|
[ext_resource path="res://src/enemyC/enemyC_movement_component.gd" type="Script" id=2]
|
||||||
|
|
@ -122,9 +122,6 @@ extents = Vector2( 9, 3.5 )
|
||||||
[sub_resource type="CapsuleShape2D" id=24]
|
[sub_resource type="CapsuleShape2D" id=24]
|
||||||
height = 10.0
|
height = 10.0
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=25]
|
|
||||||
extents = Vector2( 10.5, 17.5 )
|
|
||||||
|
|
||||||
[node name="EnemyC" instance=ExtResource( 1 )]
|
[node name="EnemyC" instance=ExtResource( 1 )]
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
actor_type = "Enemy"
|
actor_type = "Enemy"
|
||||||
|
|
@ -147,7 +144,10 @@ __meta__ = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="movement_component" parent="." index="1"]
|
[node name="CollisionShape2D" parent="." index="1"]
|
||||||
|
position = Vector2( -0.5, -2 )
|
||||||
|
|
||||||
|
[node name="movement_component" parent="." index="2"]
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="IdleTimeout" type="Timer" parent="movement_component" index="0"]
|
[node name="IdleTimeout" type="Timer" parent="movement_component" index="0"]
|
||||||
|
|
@ -189,14 +189,14 @@ timeout_seconds = 0.5
|
||||||
move_speed = -5.0
|
move_speed = -5.0
|
||||||
animation_sequence = [ "death" ]
|
animation_sequence = [ "death" ]
|
||||||
|
|
||||||
[node name="Hurtbox_Component" parent="." index="3"]
|
[node name="Hurtbox_Component" parent="." index="4"]
|
||||||
hurtbox_entered_function = "enemyHit"
|
hurtbox_entered_function = "enemyHit"
|
||||||
|
|
||||||
[node name="CollisionShape2D" parent="Hurtbox_Component" index="0"]
|
[node name="CollisionShape2D" parent="Hurtbox_Component" index="0"]
|
||||||
position = Vector2( -1, -2 )
|
position = Vector2( -1, -2 )
|
||||||
shape = SubResource( 22 )
|
shape = SubResource( 22 )
|
||||||
|
|
||||||
[node name="EdgeDetection" type="RayCast2D" parent="." index="5"]
|
[node name="EdgeDetection" type="RayCast2D" parent="." index="6"]
|
||||||
modulate = Color( 0.054902, 1, 0, 1 )
|
modulate = Color( 0.054902, 1, 0, 1 )
|
||||||
show_behind_parent = true
|
show_behind_parent = true
|
||||||
position = Vector2( 15, 3 )
|
position = Vector2( 15, 3 )
|
||||||
|
|
@ -204,12 +204,12 @@ enabled = true
|
||||||
cast_to = Vector2( 0, 17 )
|
cast_to = Vector2( 0, 17 )
|
||||||
collide_with_areas = true
|
collide_with_areas = true
|
||||||
|
|
||||||
[node name="PlayerDetection" type="RayCast2D" parent="." index="6"]
|
[node name="PlayerDetection" type="RayCast2D" parent="." index="7"]
|
||||||
enabled = true
|
enabled = true
|
||||||
cast_to = Vector2( 21, 0 )
|
cast_to = Vector2( 21, 0 )
|
||||||
collision_mask = 2
|
collision_mask = 2
|
||||||
|
|
||||||
[node name="Hitbox_Component" parent="." index="7" instance=ExtResource( 4 )]
|
[node name="Hitbox_Component" parent="." index="8" instance=ExtResource( 4 )]
|
||||||
damage_amount = 10
|
damage_amount = 10
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="0"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="0"]
|
||||||
|
|
@ -218,20 +218,16 @@ position = Vector2( 18, -8.5 )
|
||||||
shape = SubResource( 23 )
|
shape = SubResource( 23 )
|
||||||
disabled = true
|
disabled = true
|
||||||
|
|
||||||
[node name="GenericSender" parent="." index="8" instance=ExtResource( 5 )]
|
[node name="GenericSender" parent="." index="9" instance=ExtResource( 5 )]
|
||||||
receiver_node_name = "GenericReceiver"
|
receiver_node_name = "GenericReceiver"
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="GenericSender" index="0"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="GenericSender" index="0"]
|
||||||
position = Vector2( 48, 0 )
|
position = Vector2( 48, 0 )
|
||||||
shape = SubResource( 24 )
|
shape = SubResource( 24 )
|
||||||
|
|
||||||
[node name="Health_Component" parent="." index="9" instance=ExtResource( 7 )]
|
[node name="Health_Component" parent="." index="10" instance=ExtResource( 7 )]
|
||||||
max_health = 20
|
max_health = 20
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="10"]
|
|
||||||
position = Vector2( -0.5, -1.5 )
|
|
||||||
shape = SubResource( 25 )
|
|
||||||
|
|
||||||
[connection signal="frame_reached" from="movement_state_machine/attack" to="." method="_on_attack_frame_reached"]
|
[connection signal="frame_reached" from="movement_state_machine/attack" to="." method="_on_attack_frame_reached"]
|
||||||
[connection signal="state_exited" from="movement_state_machine/attack" to="." method="_on_attack_state_exited"]
|
[connection signal="state_exited" from="movement_state_machine/attack" to="." method="_on_attack_state_exited"]
|
||||||
[connection signal="health_depleted" from="Health_Component" to="." method="_on_Health_Component_health_depleted"]
|
[connection signal="health_depleted" from="Health_Component" to="." method="_on_Health_Component_health_depleted"]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=127 format=2]
|
[gd_scene load_steps=126 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://src/playerD/movement_component.gd" type="Script" id=2]
|
[ext_resource path="res://src/playerD/movement_component.gd" type="Script" id=2]
|
||||||
|
|
@ -18,9 +18,6 @@
|
||||||
[ext_resource path="res://src/templates/Interactable/Interactable_Receiver.gd" type="Script" id=16]
|
[ext_resource path="res://src/templates/Interactable/Interactable_Receiver.gd" type="Script" id=16]
|
||||||
[ext_resource path="res://src/playerD/states/climb.gd" type="Script" id=17]
|
[ext_resource path="res://src/playerD/states/climb.gd" type="Script" id=17]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=197]
|
|
||||||
extents = Vector2( 13, 18.5 )
|
|
||||||
|
|
||||||
[sub_resource type="StreamTexture" id=90]
|
[sub_resource type="StreamTexture" id=90]
|
||||||
load_path = "res://.import/Mega.png-93dfe0790902b932f7b46f7b23c5d4e7.stex"
|
load_path = "res://.import/Mega.png-93dfe0790902b932f7b46f7b23c5d4e7.stex"
|
||||||
|
|
||||||
|
|
@ -550,11 +547,7 @@ script = ExtResource( 3 )
|
||||||
actor_type = "Player"
|
actor_type = "Player"
|
||||||
player_number = 1
|
player_number = 1
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="0"]
|
[node name="AnimatedSprite" parent="." index="0"]
|
||||||
position = Vector2( 0, -3.5 )
|
|
||||||
shape = SubResource( 197 )
|
|
||||||
|
|
||||||
[node name="AnimatedSprite" parent="." index="1"]
|
|
||||||
position = Vector2( -1, -51 )
|
position = Vector2( -1, -51 )
|
||||||
frames = SubResource( 196 )
|
frames = SubResource( 196 )
|
||||||
animation = "idle_shoot"
|
animation = "idle_shoot"
|
||||||
|
|
|
||||||
|
|
@ -471,8 +471,5 @@ func move_actor_as_desired(delta: float, x_move_direction_override: float = 0):
|
||||||
#print(speed_multiplier)
|
#print(speed_multiplier)
|
||||||
# move_component.velocity.x = move_component.desired_movement_vector.x * _move_speed
|
# move_component.velocity.x = move_component.desired_movement_vector.x * _move_speed
|
||||||
move_component.velocity.x = move_direction * new_move_speed
|
move_component.velocity.x = move_direction * new_move_speed
|
||||||
#move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2.UP)
|
move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||||
var snap = Vector2.DOWN * 8
|
|
||||||
if move_component.velocity.y < -8:
|
|
||||||
snap = Vector2.ZERO
|
|
||||||
move_component.velocity = parent.move_and_slide_with_snap(move_component.velocity, snap , Vector2.UP, true)
|
|
||||||
|
|
|
||||||
59
src/templates/Actor/ActorTemplate.gd
Normal file
59
src/templates/Actor/ActorTemplate.gd
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
extends Actor
|
||||||
|
|
||||||
|
onready var actor_hurtbox = $Hurtbox_Component/CollisionShape2D
|
||||||
|
|
||||||
|
|
||||||
|
#var sound_effects = preload("res://src/playerC/resources/sound_effects.tres")
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
movement_state_machine.init_animated_actor(self, movement_animations, movement_component)
|
||||||
|
|
||||||
|
# Experimenting with sound based resources I did this and it worked
|
||||||
|
#sound_effect_player.stream = sound_effects.sounds["pew"]
|
||||||
|
#print(sounds.sounds["pew"])
|
||||||
|
#sound_effects.play()
|
||||||
|
|
||||||
|
# Trying something new with a custom resourse.
|
||||||
|
for i in SoundEffects:
|
||||||
|
sound_effects_dict[i.animation_name + str(i.frame_number)] = i.sound
|
||||||
|
print (sound_effects_dict)
|
||||||
|
|
||||||
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
|
movement_state_machine.process_input(event)
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
movement_state_machine.process_physics(delta)
|
||||||
|
# #TODO: So much hack
|
||||||
|
# if direction.x != 0:
|
||||||
|
# gun.set_scale( Vector2(direction.x,1))
|
||||||
|
|
||||||
|
# Commented out to try parent transforms instead
|
||||||
|
# if direction.x < 0:
|
||||||
|
# var t = Transform2D()
|
||||||
|
# # Translation
|
||||||
|
# t.origin = Vector2(gun.offset_position.x * -1, gun.offset_position.y)
|
||||||
|
# gun.transform = t
|
||||||
|
# elif direction.x > 0:
|
||||||
|
# var t = Transform2D()
|
||||||
|
# # Translation
|
||||||
|
# t.origin = Vector2(gun.offset_position.x, gun.offset_position.y)
|
||||||
|
# gun.transform = t
|
||||||
|
|
||||||
|
# Attempting a Kinematic2D level scale for flip operations instead.
|
||||||
|
#self.transform
|
||||||
|
#self.scale.x = -1
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
movement_component.process(delta)
|
||||||
|
movement_state_machine.process_frame(delta)
|
||||||
|
play_sound_frame(movement_animations.animation , movement_animations.frame)
|
||||||
|
|
||||||
|
|
||||||
|
##TODO: I don't like player class having do do this.
|
||||||
|
## Figure out how to programatically signal subscribe
|
||||||
|
#func _on_AnimatedSprite_animation_finished():
|
||||||
|
# if movement_animations.frames.get_animation_loop(movement_animations.animation) == false:
|
||||||
|
# movement_state_machine.current_state.animation_index += 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=17 format=2]
|
[gd_scene load_steps=18 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/components/Hurtbox_Component.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/components/Hurtbox_Component.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://src/state_machine_animated_actor.gd" type="Script" id=2]
|
[ext_resource path="res://src/state_machine_animated_actor.gd" type="Script" id=2]
|
||||||
|
|
@ -41,6 +41,9 @@ animations = [ {
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=74]
|
||||||
|
extents = Vector2( 14, 18.5 )
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=82]
|
[sub_resource type="CircleShape2D" id=82]
|
||||||
|
|
||||||
[node name="ActorTemplate" type="KinematicBody2D"]
|
[node name="ActorTemplate" type="KinematicBody2D"]
|
||||||
|
|
@ -49,7 +52,7 @@ script = ExtResource( 8 )
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||||
frames = SubResource( 75 )
|
frames = SubResource( 75 )
|
||||||
frame = 3
|
frame = 4
|
||||||
playing = true
|
playing = true
|
||||||
flip_h = true
|
flip_h = true
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
|
|
@ -65,6 +68,10 @@ __meta__ = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 0, -3.5 )
|
||||||
|
shape = SubResource( 74 )
|
||||||
|
|
||||||
[node name="movement_component" type="Node" parent="."]
|
[node name="movement_component" type="Node" parent="."]
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user