Compare commits

..

No commits in common. "52086df5cc4085848f46991ca517b6ebc30b2230" and "7acdc7633c4f1455e14d932d93bc62f3ec7de4e6" have entirely different histories.

5 changed files with 14 additions and 121 deletions

View File

@ -1,4 +1,4 @@
[gd_resource type="TileSet" load_steps=21 format=2]
[gd_resource type="TileSet" load_steps=17 format=2]
[ext_resource path="res://assets/levels/LegacyFantasy-High_Forest/Tiles/Tiles.png" type="Texture" id=1]
@ -38,18 +38,6 @@ points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=12]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=16]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=17]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=18]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=19]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=13]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
@ -215,34 +203,9 @@ points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
3/navigation_offset = Vector2( 0, 0 )
3/shape_offset = Vector2( 0, 0 )
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
3/shape = SubResource( 16 )
3/shape_one_way = false
3/shape_one_way_margin = 1.0
3/shapes = [ {
"autotile_coord": Vector2( 1, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 16 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 17 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 18 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 19 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
3/shape_one_way_margin = 0.0
3/shapes = [ ]
3/z_index = 0
4/name = "Pillar"
4/texture = ExtResource( 1 )

View File

@ -9,14 +9,10 @@ onready var current_state :StateAnimatedActor
## return to default when no state function
export var default_shape_when_no_state_function :bool = true
export var disable_shape_when_no_state_function :bool = false
# Declare member variables here. Examples:
# var a = 2
# var b = "text
## Generic parent ref node, can be kinematic2d area, etc.
var parent
# var b = "text"
var default_shape :Shape2D
var default_transform :Transform2D
@ -30,19 +26,15 @@ func _ready():
## A reference to the current state machine state
current_state = get_node(callable_state_machine).current_state
parent = get_parent()
default_shape = shape.duplicate()
##TODO: Are transforms primitives? Do they get passed by value?
default_transform = transform
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
#UiManager.debug_text = current_state.name
## Stard state process routines
if has_method('_state_physics_process_' + current_state.name):
call('_state_physics_process_' + current_state.name)
#func _process(delta):
# pass
## Standard function for receiving state change
func _on_state_change(old_state_name:String, new_state :State):
@ -57,8 +49,6 @@ func _on_state_change(old_state_name:String, new_state :State):
print ("Returning to default collision shape")
shape = default_shape
transform = default_transform
if disable_shape_when_no_state_function:
set_deferred("disabled", true)
else:
push_warning("Received non animated Actor state.")

View File

@ -1,32 +0,0 @@
extends CollisionShape2D_StateReceiver
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _state_physics_process_attack_sword():
match current_state.animation_frame:
0:
set_deferred("disabled", true)
1:
set_deferred("disabled", false)
2:
transform.origin = Vector2(0,-17)
3:
transform.origin = Vector2(20,0)
5:
transform.origin = Vector2(20,10)
_:
set_deferred("disabled", true)
func _on_state_change_attack_sword():
print ("<---- Hey you called me to Hurt Someone!")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=41 format=2]
[gd_scene load_steps=38 format=2]
[ext_resource path="res://lib/parent_scenes/actor.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/actors/players/playerE/PlayerE_SpriteFrames.tres" type="SpriteFrames" id=2]
@ -31,8 +31,6 @@
[ext_resource path="res://lib/components/Stamina_Component.tscn" type="PackedScene" id=29]
[ext_resource path="res://src/actors/players/playerE/states/death.tres" type="Resource" id=30]
[ext_resource path="res://src/actors/players/playerE/PlayerE-CollisionShape2D_StateReceiver.gd" type="Script" id=31]
[ext_resource path="res://src/actors/players/playerE/Hitbox-CollisionShape2D_StateReceiver.gd" type="Script" id=32]
[ext_resource path="res://lib/components/Hitbox_Component.tscn" type="PackedScene" id=33]
[sub_resource type="Resource" id=3]
resource_local_to_scene = true
@ -78,9 +76,6 @@ extents = Vector2( 7, 14 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 9, 15 )
[sub_resource type="RectangleShape2D" id=7]
extents = Vector2( 4, 3 )
[node name="PlayerE" instance=ExtResource( 1 )]
script = ExtResource( 3 )
actor_type = "Player"
@ -92,8 +87,7 @@ states = [ ExtResource( 4 ), ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8
[node name="AnimatedSprite_StateReceiver" parent="." index="1"]
frames = ExtResource( 2 )
animation = "attack-sword"
frame = 3
animation = "attack-shoot"
script = ExtResource( 5 )
__meta__ = {
"_aseprite_wizard_config_": {
@ -167,18 +161,5 @@ interactable_parent_callback = "touch_the_thing"
[node name="PewMachine" parent="." index="12" instance=ExtResource( 28 )]
[node name="Hitbox_Component" parent="." index="13" instance=ExtResource( 33 )]
collision_layer = 192
damage_amount = 10
[node name="CollisionShape2D_StateReceiver" type="CollisionShape2D" parent="Hitbox_Component" index="0"]
modulate = Color( 1, 0, 0, 1 )
position = Vector2( -15, 14 )
shape = SubResource( 7 )
disabled = true
script = ExtResource( 32 )
callable_state_machine = NodePath("../../Movement_StateMachine")
disable_shape_when_no_state_function = true
[connection signal="state_changed" from="Movement_StateMachine" to="." method="_on_Movement_StateMachine_state_changed"]
[connection signal="health_depleted" from="Health_Component" to="." method="_on_Health_Component_health_depleted"]

File diff suppressed because one or more lines are too long