Dash momentum to jump.
This commit is contained in:
parent
4d4526a72d
commit
922b4d05aa
|
|
@ -144,6 +144,8 @@ b = Vector2( -1, 349 )
|
||||||
|
|
||||||
[node name="Main" type="Node2D"]
|
[node name="Main" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Level" type="Node2D" parent="."]
|
||||||
|
|
||||||
[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 )
|
||||||
scroll_limit_end = Vector2( 1300, 0 )
|
scroll_limit_end = Vector2( 1300, 0 )
|
||||||
|
|
|
||||||
BIN
assets/Mega.png
BIN
assets/Mega.png
Binary file not shown.
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
|
|
@ -34,3 +34,13 @@ func _on_attack_do_attack():
|
||||||
|
|
||||||
func _on_Health_Component_health_depleted():
|
func _on_Health_Component_health_depleted():
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
||||||
|
func _on_roll_frame_reached(state_name, animation_name, frame_number):
|
||||||
|
print("I'm invincible!!!")
|
||||||
|
$Hurtbox_Component.set_hurtbox(false)
|
||||||
|
|
||||||
|
func _on_roll_state_exited():
|
||||||
|
print("Nevermind. I'm vulnerable.")
|
||||||
|
$Hurtbox_Component.set_hurtbox(true)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=117 format=2]
|
[gd_scene load_steps=109 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]
|
||||||
|
|
@ -102,319 +102,287 @@ region = Rect2( 1920, 0, 240, 160 )
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 2160, 0, 240, 160 )
|
region = Rect2( 2160, 0, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=163]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 480, 160, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=112]
|
[sub_resource type="AtlasTexture" id=112]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1920, 160, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=113]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 2160, 160, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=114]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 0, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=115]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 240, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=116]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 480, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=117]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 720, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=118]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 960, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=119]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1440, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=120]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1680, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=121]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1920, 320, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=122]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 240, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=123]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 480, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=124]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 720, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=125]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 960, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=126]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1200, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=127]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1440, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=128]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1680, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=129]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1920, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=130]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 2160, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=131]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 0, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=132]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 240, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=133]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 480, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=134]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 720, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=135]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 960, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=136]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1200, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=137]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1440, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=138]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1680, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=139]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1920, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=140]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 2160, 960, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=141]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 0, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=142]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 240, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=143]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 480, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=144]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 720, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=145]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 960, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=146]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1200, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=147]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1440, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=148]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1680, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=149]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1920, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=150]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 2160, 480, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=151]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 240, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=152]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 480, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=153]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 720, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=154]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 960, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=155]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1200, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=156]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1440, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=157]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1680, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=158]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 1920, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=159]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 2160, 640, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=160]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 0, 800, 240, 160 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=161]
|
|
||||||
atlas = SubResource( 90 )
|
|
||||||
region = Rect2( 0, 160, 240, 160 )
|
region = Rect2( 0, 160, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=162]
|
[sub_resource type="AtlasTexture" id=113]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 240, 160, 240, 160 )
|
region = Rect2( 240, 160, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=164]
|
[sub_resource type="AtlasTexture" id=114]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 480, 160, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=115]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1920, 160, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=116]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 2160, 160, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=117]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 0, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=118]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 240, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=119]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 480, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=120]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 720, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=121]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 960, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=122]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1440, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=123]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1680, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=124]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1920, 320, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=125]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 240, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=126]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 480, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=127]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 720, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=128]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 960, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=129]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1200, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=130]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1440, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=131]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1680, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=132]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1920, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=133]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 2160, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=134]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 0, 960, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=135]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 240, 960, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=136]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 0, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=137]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 240, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=138]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 480, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=139]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 720, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=140]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 960, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=141]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1200, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=142]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1440, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=143]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1680, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=144]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1920, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=145]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 2160, 480, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=146]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 240, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=147]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 480, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=148]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 720, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=149]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 960, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=150]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1200, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=151]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1440, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=152]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1680, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=153]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 1920, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=154]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 2160, 640, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=155]
|
||||||
|
atlas = SubResource( 90 )
|
||||||
|
region = Rect2( 0, 800, 240, 160 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=156]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 0, 1280, 240, 160 )
|
region = Rect2( 0, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=165]
|
[sub_resource type="AtlasTexture" id=157]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 240, 1280, 240, 160 )
|
region = Rect2( 240, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=166]
|
[sub_resource type="AtlasTexture" id=158]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 480, 1280, 240, 160 )
|
region = Rect2( 480, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=167]
|
[sub_resource type="AtlasTexture" id=159]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 720, 1280, 240, 160 )
|
region = Rect2( 720, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=168]
|
[sub_resource type="AtlasTexture" id=160]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 960, 1280, 240, 160 )
|
region = Rect2( 960, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=169]
|
[sub_resource type="AtlasTexture" id=161]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1200, 1280, 240, 160 )
|
region = Rect2( 1200, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=170]
|
[sub_resource type="AtlasTexture" id=162]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1440, 1280, 240, 160 )
|
region = Rect2( 1440, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=171]
|
[sub_resource type="AtlasTexture" id=163]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1680, 1280, 240, 160 )
|
region = Rect2( 1680, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=172]
|
[sub_resource type="AtlasTexture" id=164]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1920, 1280, 240, 160 )
|
region = Rect2( 1920, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=173]
|
[sub_resource type="AtlasTexture" id=165]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 2160, 1280, 240, 160 )
|
region = Rect2( 2160, 1280, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=174]
|
[sub_resource type="AtlasTexture" id=166]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 0, 1440, 240, 160 )
|
region = Rect2( 0, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=175]
|
[sub_resource type="AtlasTexture" id=167]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 240, 1440, 240, 160 )
|
region = Rect2( 240, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=176]
|
[sub_resource type="AtlasTexture" id=168]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 480, 1440, 240, 160 )
|
region = Rect2( 480, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=177]
|
[sub_resource type="AtlasTexture" id=169]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 720, 1440, 240, 160 )
|
region = Rect2( 720, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=178]
|
[sub_resource type="AtlasTexture" id=170]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 960, 1440, 240, 160 )
|
region = Rect2( 960, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=179]
|
[sub_resource type="AtlasTexture" id=171]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1200, 1440, 240, 160 )
|
region = Rect2( 1200, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=180]
|
[sub_resource type="AtlasTexture" id=172]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1440, 1440, 240, 160 )
|
region = Rect2( 1440, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=181]
|
[sub_resource type="AtlasTexture" id=173]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1680, 1440, 240, 160 )
|
region = Rect2( 1680, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=182]
|
[sub_resource type="AtlasTexture" id=174]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 1920, 1440, 240, 160 )
|
region = Rect2( 1920, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=183]
|
[sub_resource type="AtlasTexture" id=175]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 2160, 1440, 240, 160 )
|
region = Rect2( 2160, 1440, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=184]
|
[sub_resource type="AtlasTexture" id=176]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 240, 0, 240, 160 )
|
region = Rect2( 240, 0, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=185]
|
[sub_resource type="AtlasTexture" id=177]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 480, 0, 240, 160 )
|
region = Rect2( 480, 0, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=186]
|
[sub_resource type="AtlasTexture" id=178]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 720, 0, 240, 160 )
|
region = Rect2( 720, 0, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=187]
|
[sub_resource type="AtlasTexture" id=179]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 960, 0, 240, 160 )
|
region = Rect2( 960, 0, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=188]
|
[sub_resource type="AtlasTexture" id=180]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 2160, 320, 240, 160 )
|
region = Rect2( 2160, 320, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=189]
|
[sub_resource type="AtlasTexture" id=181]
|
||||||
atlas = SubResource( 90 )
|
atlas = SubResource( 90 )
|
||||||
region = Rect2( 0, 640, 240, 160 )
|
region = Rect2( 0, 640, 240, 160 )
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=190]
|
[sub_resource type="SpriteFrames" id=182]
|
||||||
animations = [ {
|
animations = [ {
|
||||||
"frames": [ SubResource( 91 ), SubResource( 92 ), SubResource( 93 ), SubResource( 94 ), SubResource( 95 ), SubResource( 96 ), SubResource( 97 ), SubResource( 98 ), SubResource( 99 ), SubResource( 100 ) ],
|
"frames": [ SubResource( 91 ), SubResource( 92 ), SubResource( 93 ), SubResource( 94 ), SubResource( 95 ), SubResource( 96 ), SubResource( 97 ), SubResource( 98 ), SubResource( 99 ), SubResource( 100 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
|
|
@ -424,64 +392,59 @@ animations = [ {
|
||||||
"frames": [ SubResource( 101 ), SubResource( 101 ), SubResource( 101 ), SubResource( 102 ), SubResource( 103 ), SubResource( 104 ), SubResource( 105 ), SubResource( 105 ), SubResource( 105 ) ],
|
"frames": [ SubResource( 101 ), SubResource( 101 ), SubResource( 101 ), SubResource( 102 ), SubResource( 103 ), SubResource( 104 ), SubResource( 105 ), SubResource( 105 ), SubResource( 105 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "dash",
|
"name": "dash",
|
||||||
"speed": 10.0
|
"speed": 15.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 107 ), SubResource( 108 ), SubResource( 109 ), SubResource( 110 ), SubResource( 111 ) ],
|
"frames": [ SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 106 ), SubResource( 107 ), SubResource( 108 ), SubResource( 109 ), SubResource( 110 ), SubResource( 111 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "idle",
|
"name": "idle",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 163 ) ],
|
"frames": [ SubResource( 112 ), SubResource( 113 ), SubResource( 114 ) ],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": "idle_shoot",
|
"name": "idle_shoot",
|
||||||
"speed": 5.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 112 ), SubResource( 113 ), SubResource( 114 ), SubResource( 115 ), SubResource( 113 ), SubResource( 116 ), SubResource( 117 ), SubResource( 118 ) ],
|
"frames": [ SubResource( 115 ), SubResource( 116 ), SubResource( 117 ), SubResource( 118 ), SubResource( 116 ), SubResource( 119 ), SubResource( 120 ), SubResource( 121 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "jump",
|
"name": "jump",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 119 ), SubResource( 119 ), SubResource( 119 ), SubResource( 119 ), SubResource( 119 ), SubResource( 119 ), SubResource( 120 ), SubResource( 121 ) ],
|
"frames": [ SubResource( 122 ), SubResource( 122 ), SubResource( 122 ), SubResource( 122 ), SubResource( 122 ), SubResource( 122 ), SubResource( 123 ), SubResource( 124 ) ],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": "jump_shoot",
|
"name": "jump_shoot",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 122 ), SubResource( 123 ), SubResource( 124 ), SubResource( 125 ), SubResource( 126 ), SubResource( 127 ), SubResource( 128 ), SubResource( 129 ), SubResource( 130 ), SubResource( 131 ), SubResource( 132 ), SubResource( 133 ), SubResource( 134 ), SubResource( 135 ), SubResource( 136 ), SubResource( 137 ), SubResource( 138 ), SubResource( 139 ), SubResource( 140 ) ],
|
"frames": [ SubResource( 125 ), SubResource( 126 ), SubResource( 127 ), SubResource( 128 ), SubResource( 129 ), SubResource( 130 ), SubResource( 131 ), SubResource( 132 ), SubResource( 133 ), SubResource( 134 ), SubResource( 135 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "roll",
|
"name": "roll",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 141 ), SubResource( 142 ), SubResource( 143 ), SubResource( 144 ), SubResource( 145 ), SubResource( 146 ), SubResource( 147 ), SubResource( 148 ), SubResource( 149 ), SubResource( 150 ) ],
|
"frames": [ SubResource( 136 ), SubResource( 137 ), SubResource( 138 ), SubResource( 139 ), SubResource( 140 ), SubResource( 141 ), SubResource( 142 ), SubResource( 143 ), SubResource( 144 ), SubResource( 145 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "run",
|
"name": "run",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 151 ), SubResource( 152 ), SubResource( 153 ), SubResource( 154 ), SubResource( 155 ), SubResource( 156 ), SubResource( 157 ), SubResource( 158 ), SubResource( 159 ), SubResource( 160 ) ],
|
"frames": [ SubResource( 146 ), SubResource( 147 ), SubResource( 148 ), SubResource( 149 ), SubResource( 150 ), SubResource( 151 ), SubResource( 152 ), SubResource( 153 ), SubResource( 154 ), SubResource( 155 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "run_shoot",
|
"name": "run_shoot",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 161 ), SubResource( 162 ), SubResource( 163 ) ],
|
"frames": [ SubResource( 156 ), SubResource( 157 ), SubResource( 158 ), SubResource( 158 ), SubResource( 159 ), SubResource( 160 ), SubResource( 161 ), SubResource( 162 ), SubResource( 162 ), SubResource( 163 ), SubResource( 164 ), SubResource( 165 ), SubResource( 166 ), SubResource( 167 ), SubResource( 168 ), SubResource( 169 ), SubResource( 170 ), SubResource( 171 ), SubResource( 172 ), SubResource( 173 ), SubResource( 174 ), SubResource( 175 ) ],
|
||||||
"loop": false,
|
|
||||||
"name": "shoot",
|
|
||||||
"speed": 10.0
|
|
||||||
}, {
|
|
||||||
"frames": [ SubResource( 164 ), SubResource( 165 ), SubResource( 166 ), SubResource( 166 ), SubResource( 167 ), SubResource( 168 ), SubResource( 169 ), SubResource( 170 ), SubResource( 170 ), SubResource( 171 ), SubResource( 172 ), SubResource( 173 ), SubResource( 174 ), SubResource( 175 ), SubResource( 176 ), SubResource( 177 ), SubResource( 178 ), SubResource( 179 ), SubResource( 180 ), SubResource( 181 ), SubResource( 182 ), SubResource( 183 ) ],
|
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "slash",
|
"name": "slash",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 107 ), SubResource( 184 ), SubResource( 185 ), SubResource( 186 ), SubResource( 187 ) ],
|
"frames": [ SubResource( 107 ), SubResource( 176 ), SubResource( 177 ), SubResource( 178 ), SubResource( 179 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "stand",
|
"name": "stand",
|
||||||
"speed": 1.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 188 ) ],
|
"frames": [ SubResource( 180 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "step",
|
"name": "step",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 189 ) ],
|
"frames": [ SubResource( 181 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "step_shoot",
|
"name": "step_shoot",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
|
|
@ -497,9 +460,9 @@ player_number = 1
|
||||||
|
|
||||||
[node name="AnimatedSprite" parent="." index="0"]
|
[node name="AnimatedSprite" parent="." index="0"]
|
||||||
position = Vector2( -1, -51 )
|
position = Vector2( -1, -51 )
|
||||||
frames = SubResource( 190 )
|
frames = SubResource( 182 )
|
||||||
animation = "idle_shoot"
|
animation = "idle_shoot"
|
||||||
frame = 0
|
frame = 2
|
||||||
flip_h = false
|
flip_h = false
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_aseprite_wizard_config_": {
|
"_aseprite_wizard_config_": {
|
||||||
|
|
@ -558,7 +521,6 @@ jump_force = 250.0
|
||||||
[node name="attack" type="Node" parent="movement_state_machine" index="4"]
|
[node name="attack" type="Node" parent="movement_state_machine" index="4"]
|
||||||
script = ExtResource( 10 )
|
script = ExtResource( 10 )
|
||||||
timeout_seconds = 2.0
|
timeout_seconds = 2.0
|
||||||
animation_sequence = [ "shoot" ]
|
|
||||||
jump_node = NodePath("../jump")
|
jump_node = NodePath("../jump")
|
||||||
idle_node = NodePath("../idle")
|
idle_node = NodePath("../idle")
|
||||||
fall_node = NodePath("../fall")
|
fall_node = NodePath("../fall")
|
||||||
|
|
@ -591,6 +553,9 @@ jump_node = NodePath("../jump")
|
||||||
script = ExtResource( 14 )
|
script = ExtResource( 14 )
|
||||||
move_speed = 90.0
|
move_speed = 90.0
|
||||||
animation_sequence = [ "roll" ]
|
animation_sequence = [ "roll" ]
|
||||||
|
emitter_frame_subscriptions = {
|
||||||
|
2: "roll"
|
||||||
|
}
|
||||||
fall_node = NodePath("../fall")
|
fall_node = NodePath("../fall")
|
||||||
idle_node = NodePath("../idle")
|
idle_node = NodePath("../idle")
|
||||||
|
|
||||||
|
|
@ -608,7 +573,7 @@ max_health = 100
|
||||||
|
|
||||||
[node name="Gun" type="Position2D" parent="." index="7"]
|
[node name="Gun" type="Position2D" parent="." index="7"]
|
||||||
physics_interpolation_mode = 1
|
physics_interpolation_mode = 1
|
||||||
position = Vector2( 25, -5 )
|
position = Vector2( 23, -9 )
|
||||||
script = ExtResource( 13 )
|
script = ExtResource( 13 )
|
||||||
|
|
||||||
[node name="Cooldown" type="Timer" parent="Gun" index="0"]
|
[node name="Cooldown" type="Timer" parent="Gun" index="0"]
|
||||||
|
|
@ -616,9 +581,12 @@ wait_time = 0.5
|
||||||
one_shot = true
|
one_shot = true
|
||||||
|
|
||||||
[node name="Line2D" type="Line2D" parent="Gun" index="1"]
|
[node name="Line2D" type="Line2D" parent="Gun" index="1"]
|
||||||
points = PoolVector2Array( -5, 0, 5, 0 )
|
position = Vector2( -3, 0 )
|
||||||
|
points = PoolVector2Array( -5, 0, 1.25483, 0, 5, 0 )
|
||||||
width = 2.0
|
width = 2.0
|
||||||
default_color = Color( 1, 0.607843, 0, 1 )
|
default_color = Color( 1, 0.607843, 0, 1 )
|
||||||
|
|
||||||
[connection signal="do_attack" from="movement_state_machine/attack" to="." method="_on_attack_do_attack"]
|
[connection signal="do_attack" from="movement_state_machine/attack" to="." method="_on_attack_do_attack"]
|
||||||
|
[connection signal="frame_reached" from="movement_state_machine/roll" to="." method="_on_roll_frame_reached"]
|
||||||
|
[connection signal="state_exited" from="movement_state_machine/roll" to="." method="_on_roll_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"]
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ func enter() -> void:
|
||||||
#mod_animation_sequence = animation_sequence.duplicate(true)
|
#mod_animation_sequence = animation_sequence.duplicate(true)
|
||||||
mod_animation_sequence.append_array(animation_sequence)
|
mod_animation_sequence.append_array(animation_sequence)
|
||||||
# Reset animation suffix in case there isn't one
|
# Reset animation suffix in case there isn't one
|
||||||
animation_suffix = ''
|
animation_suffix = '_shoot'
|
||||||
animation_index = 0
|
animation_index = 0
|
||||||
current_animation_sequence = 0
|
current_animation_sequence = 0
|
||||||
#var enter_animation = ''
|
#var enter_animation = ''
|
||||||
|
|
@ -45,7 +45,7 @@ func enter() -> void:
|
||||||
previous_state_frame_number, " ", previous_state_name)
|
previous_state_frame_number, " ", previous_state_name)
|
||||||
match previous_animation_name:
|
match previous_animation_name:
|
||||||
"idle":
|
"idle":
|
||||||
animations.play("shoot")
|
animations.play("_shoot")
|
||||||
"run":
|
"run":
|
||||||
animations.play("run_shoot")
|
animations.play("run_shoot")
|
||||||
animations.frame = previous_state_frame_number
|
animations.frame = previous_state_frame_number
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ onready var fall_state: State = get_node(fall_node)
|
||||||
onready var idle_state: State = get_node(idle_node)
|
onready var idle_state: State = get_node(idle_node)
|
||||||
onready var attack_state: State = get_node(attack_node)
|
onready var attack_state: State = get_node(attack_node)
|
||||||
|
|
||||||
var speed_multiplier := 1.0
|
|
||||||
var speed_decay_rate := 1.0
|
var speed_decay_rate := 1.0
|
||||||
|
|
||||||
func enter():
|
func enter():
|
||||||
|
remove_animation_state_modifiers()
|
||||||
.enter()
|
.enter()
|
||||||
speed_multiplier = 2.8
|
speed_multiplier = 5
|
||||||
speed_decay_rate = 2.0
|
speed_decay_rate = 4
|
||||||
|
|
||||||
func process_physics(delta: float) -> State:
|
func process_physics(delta: float) -> State:
|
||||||
|
|
||||||
|
|
@ -25,14 +25,16 @@ func process_physics(delta: float) -> State:
|
||||||
|
|
||||||
if move_component.wants_jump():
|
if move_component.wants_jump():
|
||||||
return jump_state
|
return jump_state
|
||||||
|
|
||||||
|
var new_move_speed = move_speed * speed_multiplier
|
||||||
if speed_multiplier > 1.0:
|
if speed_multiplier > 1.0:
|
||||||
#print(speed_multiplier,", ", delta)
|
print("PPS: ", new_move_speed * delta)
|
||||||
speed_multiplier -= delta * speed_decay_rate
|
speed_multiplier -= delta * (speed_decay_rate * speed_multiplier)
|
||||||
speed_decay_rate += delta
|
#speed_decay_rate += delta * speed_decay_rate
|
||||||
|
|
||||||
elif speed_multiplier < 1.0:
|
elif speed_multiplier < 1.0:
|
||||||
speed_multiplier += delta * speed_decay_rate
|
speed_multiplier += delta * (speed_decay_rate * speed_multiplier)
|
||||||
speed_decay_rate += delta
|
#speed_decay_rate += delta * speed_decay_rate
|
||||||
|
|
||||||
# Deadzone
|
# Deadzone
|
||||||
if speed_multiplier < 1.1 and speed_multiplier > 0.9:
|
if speed_multiplier < 1.1 and speed_multiplier > 0.9:
|
||||||
|
|
@ -41,7 +43,7 @@ func process_physics(delta: float) -> State:
|
||||||
move_component.velocity.y += gravity * delta
|
move_component.velocity.y += gravity * delta
|
||||||
#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||||
#print(speed_multiplier)
|
#print(speed_multiplier)
|
||||||
move_component.velocity.x = parent.transform.x.x * move_speed * speed_multiplier
|
move_component.velocity.x = parent.transform.x.x * new_move_speed
|
||||||
move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ export var jump_force: float = 200.0
|
||||||
|
|
||||||
func enter() -> void:
|
func enter() -> void:
|
||||||
.enter()
|
.enter()
|
||||||
|
if previous_speed_multiplier > 1.0:
|
||||||
|
speed_multiplier = previous_speed_multiplier
|
||||||
# Apply initial jump velocity on state enter
|
# Apply initial jump velocity on state enter
|
||||||
move_component.velocity.y = -jump_force
|
move_component.velocity.y = -jump_force
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,13 @@ export (NodePath) var idle_node
|
||||||
onready var fall_state: State = get_node(fall_node)
|
onready var fall_state: State = get_node(fall_node)
|
||||||
onready var idle_state: State = get_node(idle_node)
|
onready var idle_state: State = get_node(idle_node)
|
||||||
|
|
||||||
var speed_multiplier := 1.0
|
|
||||||
var speed_decay_rate := 1.0
|
var speed_decay_rate := 1.0
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
remove_animation_state_modifiers()
|
||||||
|
.enter()
|
||||||
|
|
||||||
|
|
||||||
func process_physics(delta: float) -> State:
|
func process_physics(delta: float) -> State:
|
||||||
|
|
||||||
# if move_component.wants_shoot():
|
# if move_component.wants_shoot():
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ extends State
|
||||||
# export var animation_name: String
|
# export var animation_name: String
|
||||||
|
|
||||||
export var move_speed: float = 60
|
export var move_speed: float = 60
|
||||||
|
var speed_multiplier: float = 1.0
|
||||||
|
|
||||||
export(Array, String) var animation_sequence
|
export(Array, String) var animation_sequence
|
||||||
|
|
||||||
|
|
@ -45,6 +46,7 @@ var parent: KinematicBody2D
|
||||||
var previous_animation_name : String
|
var previous_animation_name : String
|
||||||
var previous_state_frame_number : int
|
var previous_state_frame_number : int
|
||||||
var previous_state_name: String
|
var previous_state_name: String
|
||||||
|
var previous_speed_multiplier: float
|
||||||
|
|
||||||
#var animation_sequence_timer: Timer
|
#var animation_sequence_timer: Timer
|
||||||
|
|
||||||
|
|
@ -187,9 +189,12 @@ func process_physics(_delta: float) -> State:
|
||||||
# animation_index += 1
|
# animation_index += 1
|
||||||
|
|
||||||
func move_actor_as_desired(delta: float):
|
func move_actor_as_desired(delta: float):
|
||||||
|
var new_speed = move_speed * speed_multiplier
|
||||||
|
# if (new_speed > move_speed):
|
||||||
|
# print("Go Faster Booooy! ", move_speed)
|
||||||
move_component.velocity.y += gravity * delta
|
move_component.velocity.y += gravity * delta
|
||||||
#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||||
move_component.velocity.x = move_component.desired_movement_vector.x * move_speed
|
move_component.velocity.x = move_component.desired_movement_vector.x * new_speed
|
||||||
move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||||
|
|
||||||
func push_animation_state_modifier(modifier: StateModifier):
|
func push_animation_state_modifier(modifier: StateModifier):
|
||||||
|
|
@ -236,3 +241,9 @@ func push_animation_state_modifier(modifier: StateModifier):
|
||||||
else:
|
else:
|
||||||
modifier_stack_ref.push_front(modifier)
|
modifier_stack_ref.push_front(modifier)
|
||||||
|
|
||||||
|
|
||||||
|
func remove_animation_state_modifiers():
|
||||||
|
for i in modifier_stack_ref.size():
|
||||||
|
if modifier_stack_ref[i].modifier_type != "None":
|
||||||
|
#print("Time to pop state modifer: ", state_modifiers[i].animation_name, current_state.animation_suffix, " <-> ", current_state.animations.animation + current_state.animation_suffix)
|
||||||
|
modifier_stack_ref.pop_at(i)
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,9 @@ class_name StateMachineAnimatedActor extends StateMachine
|
||||||
func change_state(new_state: State) -> void:
|
func change_state(new_state: State) -> void:
|
||||||
if current_state:
|
if current_state:
|
||||||
current_state.exit()
|
current_state.exit()
|
||||||
|
# Set parameters for information
|
||||||
# Set parameters for information
|
if new_state is StateAnimatedActor and current_state is StateAnimatedActor:
|
||||||
if new_state is StateAnimatedActor and current_state is StateAnimatedActor:
|
set_previous_animation( current_state, new_state)
|
||||||
set_previous_animation( current_state, new_state)
|
|
||||||
|
|
||||||
current_state = new_state
|
current_state = new_state
|
||||||
current_state.enter()
|
current_state.enter()
|
||||||
|
|
@ -19,7 +18,7 @@ func set_previous_animation( old_state: StateAnimatedActor, new_state: StateAnim
|
||||||
new_state.previous_animation_name = old_state.mod_animation_sequence[old_state.current_animation_sequence]
|
new_state.previous_animation_name = old_state.mod_animation_sequence[old_state.current_animation_sequence]
|
||||||
new_state.previous_state_frame_number = old_state.animations.frame
|
new_state.previous_state_frame_number = old_state.animations.frame
|
||||||
new_state.previous_state_name = old_state.name
|
new_state.previous_state_name = old_state.name
|
||||||
|
new_state.previous_speed_multiplier = old_state.speed_multiplier
|
||||||
#animation_name :String, frame_number : int, animation_sequence :Array
|
#animation_name :String, frame_number : int, animation_sequence :Array
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user