no message
This commit is contained in:
BIN
sidescroller/assets/textures/ledge hang 144x144.png
Normal file
BIN
sidescroller/assets/textures/ledge hang 144x144.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 915 B |
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dee2owliuw21p"
|
uid="uid://d4dnvylog631n"
|
||||||
path="res://.godot/imported/360x360 idle 4.png-117ef8683eb12d17036155a97c6705d5.ctex"
|
path="res://.godot/imported/ledge hang 144x144.png-38a6ad6401796dcb66209ee6ec21dbf1.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://resources/360x360 idle 4.png"
|
source_file="res://assets/textures/ledge hang 144x144.png"
|
||||||
dest_files=["res://.godot/imported/360x360 idle 4.png-117ef8683eb12d17036155a97c6705d5.ctex"]
|
dest_files=["res://.godot/imported/ledge hang 144x144.png-38a6ad6401796dcb66209ee6ec21dbf1.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
BIN
sidescroller/assets/textures/player ledge climb 144x144.png
Normal file
BIN
sidescroller/assets/textures/player ledge climb 144x144.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cry06ubemcrcf"
|
||||||
|
path="res://.godot/imported/player ledge climb 144x144.png-f3955fc9c12509b45508f7a29758572c.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/textures/player ledge climb 144x144.png"
|
||||||
|
dest_files=["res://.godot/imported/player ledge climb 144x144.png-f3955fc9c12509b45508f7a29758572c.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
4
sidescroller/resources/player ledge cshape.tres
Normal file
4
sidescroller/resources/player ledge cshape.tres
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[gd_resource type="RectangleShape2D" format=3 uid="uid://dncqi3j0k35v5"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
size = Vector2(58, 59.25)
|
||||||
@ -1,18 +1,34 @@
|
|||||||
[gd_scene load_steps=21 format=3 uid="uid://c3w3n7ysd02bd"]
|
[gd_scene load_steps=38 format=3 uid="uid://c3w3n7ysd02bd"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c1my4xbvhsdq8" path="res://assets/textures/Player Idle 144x144.png" id="1_p0vlq"]
|
[ext_resource type="Texture2D" uid="uid://c1my4xbvhsdq8" path="res://assets/textures/Player Idle 144x144.png" id="1_p0vlq"]
|
||||||
[ext_resource type="Shape2D" uid="uid://bsdsjlbi8h6cf" path="res://resources/player standing cshape.tres" id="2_khinc"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://crkx6pt8e4cmc" path="res://assets/textures/player new jump 144x144.png" id="2_qu4a1"]
|
[ext_resource type="Texture2D" uid="uid://crkx6pt8e4cmc" path="res://assets/textures/player new jump 144x144.png" id="2_qu4a1"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dvy7cws4egkmh" path="res://assets/textures/player fall 144x144.png" id="3_70d11"]
|
[ext_resource type="Texture2D" uid="uid://dvy7cws4egkmh" path="res://assets/textures/player fall 144x144.png" id="3_70d11"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d11goqqiewsdg" path="res://assets/textures/player run 144x144.png" id="4_cw2d6"]
|
[ext_resource type="Texture2D" uid="uid://d11goqqiewsdg" path="res://assets/textures/player run 144x144.png" id="4_cw2d6"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dletf8p3wr4n4" path="res://assets/textures/player air spin 144x144.png" id="5_khinc"]
|
[ext_resource type="Texture2D" uid="uid://dletf8p3wr4n4" path="res://assets/textures/player air spin 144x144.png" id="5_khinc"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cox74najv0828" path="res://assets/textures/player crouch-walk 144x144.png" id="6_70d11"]
|
[ext_resource type="Texture2D" uid="uid://cox74najv0828" path="res://assets/textures/player crouch-walk 144x144.png" id="6_70d11"]
|
||||||
[ext_resource type="Texture2D" uid="uid://co5l6328i3y76" path="res://assets/textures/Player Crouch-Idle 144x144.png" id="6_cw2d6"]
|
[ext_resource type="Texture2D" uid="uid://co5l6328i3y76" path="res://assets/textures/Player Crouch-Idle 144x144.png" id="6_cw2d6"]
|
||||||
|
[ext_resource type="Script" uid="uid://c0iqbs1ms86cw" path="res://scripts/State Machine.gd" id="9_bruh7"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d4dnvylog631n" path="res://assets/textures/ledge hang 144x144.png" id="9_sfy4j"]
|
||||||
|
[ext_resource type="Script" uid="uid://cawr3av2aa8jb" path="res://scripts/playercrouch.gd" id="10_6eyey"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cry06ubemcrcf" path="res://assets/textures/player ledge climb 144x144.png" id="10_b8lor"]
|
||||||
|
[ext_resource type="Script" uid="uid://dyee6xwb8js1s" path="res://scripts/playerrun.gd" id="11_p7iby"]
|
||||||
|
[ext_resource type="Script" uid="uid://dhvehwhg63p2h" path="res://scripts/playercrouchwalk.gd" id="11_srp4u"]
|
||||||
|
[ext_resource type="Script" uid="uid://d0cc7xgq16onu" path="res://scripts/playerjump.gd" id="12_0rnld"]
|
||||||
|
[ext_resource type="Script" uid="uid://bcnm70o0yo87k" path="res://scripts/playerwallrun.gd" id="13_srp4u"]
|
||||||
|
[ext_resource type="Script" uid="uid://cgsyaphtn6k6q" path="res://scripts/playerdoublejump.gd" id="14_61ith"]
|
||||||
|
[ext_resource type="Script" uid="uid://d34ia87aolokd" path="res://scripts/playeridle.gd" id="14_jfpux"]
|
||||||
|
[ext_resource type="Script" uid="uid://bxkdsl12qa7jy" path="res://scripts/playerwallrunpushoff.gd" id="16_61ith"]
|
||||||
|
[ext_resource type="Script" uid="uid://whap2d3r3yk" path="res://scripts/playerfall.gd" id="16_jfpux"]
|
||||||
|
[ext_resource type="Script" uid="uid://c46i4062efgw1" path="res://scripts/playerledgegrab.gd" id="19_ebwui"]
|
||||||
|
[ext_resource type="Script" uid="uid://boe7p8pcolkln" path="res://scripts/playerclimbup.gd" id="21_gv3ic"]
|
||||||
|
|
||||||
[sub_resource type="GDScript" id="GDScript_khinc"]
|
[sub_resource type="GDScript" id="GDScript_khinc"]
|
||||||
script/source = "extends CharacterBody2D
|
script/source = "extends CharacterBody2D
|
||||||
"
|
"
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_gv3ic"]
|
||||||
|
size = Vector2(58, 86.5)
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_6eyey"]
|
[sub_resource type="Animation" id="Animation_6eyey"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
@ -63,9 +79,75 @@ tracks/3/keys = {
|
|||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [1]
|
"values": [1]
|
||||||
}
|
}
|
||||||
|
tracks/4/type = "value"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("../Sprite2D:offset")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_6e537"]
|
||||||
|
resource_name = "climb up"
|
||||||
|
length = 0.5
|
||||||
|
step = 0.03
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("10_b8lor")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [5]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.0909091, 0.181818, 0.30303, 0.454545),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_cw2d6"]
|
[sub_resource type="Animation" id="Animation_cw2d6"]
|
||||||
resource_name = "crouch idle"
|
resource_name = "crouch idle"
|
||||||
|
loop_mode = 1
|
||||||
step = 0.1
|
step = 0.1
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
@ -381,6 +463,69 @@ tracks/3/keys = {
|
|||||||
"values": [0, 1, 2, 3, 4, 5]
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_gv3ic"]
|
||||||
|
resource_name = "ledge hang"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("9_sfy4j")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0.0666667),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0.0333333),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
tracks/4/type = "value"
|
||||||
|
tracks/4/imported = false
|
||||||
|
tracks/4/enabled = true
|
||||||
|
tracks/4/path = NodePath("../Sprite2D:offset")
|
||||||
|
tracks/4/interp = 1
|
||||||
|
tracks/4/loop_wrap = true
|
||||||
|
tracks/4/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(0, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_lkdrv"]
|
[sub_resource type="Animation" id="Animation_lkdrv"]
|
||||||
resource_name = "run"
|
resource_name = "run"
|
||||||
length = 0.81
|
length = 0.81
|
||||||
@ -438,35 +583,41 @@ tracks/3/keys = {
|
|||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0rnld"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0rnld"]
|
||||||
_data = {
|
_data = {
|
||||||
&"RESET": SubResource("Animation_6eyey"),
|
&"RESET": SubResource("Animation_6eyey"),
|
||||||
|
&"climb up": SubResource("Animation_6e537"),
|
||||||
&"crouch idle": SubResource("Animation_cw2d6"),
|
&"crouch idle": SubResource("Animation_cw2d6"),
|
||||||
&"crouch walk": SubResource("Animation_khinc"),
|
&"crouch walk": SubResource("Animation_khinc"),
|
||||||
&"double jump": SubResource("Animation_p7iby"),
|
&"double jump": SubResource("Animation_p7iby"),
|
||||||
&"fall": SubResource("Animation_o4126"),
|
&"fall": SubResource("Animation_o4126"),
|
||||||
&"idle": SubResource("Animation_bruh7"),
|
&"idle": SubResource("Animation_bruh7"),
|
||||||
&"jump": SubResource("Animation_d3wef"),
|
&"jump": SubResource("Animation_d3wef"),
|
||||||
|
&"ledge hang": SubResource("Animation_gv3ic"),
|
||||||
&"run": SubResource("Animation_lkdrv")
|
&"run": SubResource("Animation_lkdrv")
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bruh7"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bruh7"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sfy4j"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6eyey"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6eyey"]
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D"]
|
[node name="Player" type="CharacterBody2D"]
|
||||||
script = SubResource("GDScript_khinc")
|
script = SubResource("GDScript_khinc")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
position = Vector2(4, -48)
|
position = Vector2(0, -48)
|
||||||
texture = ExtResource("1_p0vlq")
|
texture = ExtResource("1_p0vlq")
|
||||||
hframes = 10
|
hframes = 10
|
||||||
frame = 1
|
frame = 1
|
||||||
|
|
||||||
[node name="mainbody" type="CollisionShape2D" parent="."]
|
[node name="mainbody" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2(0, -43)
|
position = Vector2(0, -43)
|
||||||
shape = ExtResource("2_khinc")
|
shape = SubResource("RectangleShape2D_gv3ic")
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
position = Vector2(0, -90)
|
position = Vector2(0, -90)
|
||||||
|
|
||||||
|
[node name="RootMotion" type="Node" parent="."]
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
root_node = NodePath("../Camera2D")
|
root_node = NodePath("../Camera2D")
|
||||||
libraries = {
|
libraries = {
|
||||||
@ -474,40 +625,102 @@ libraries = {
|
|||||||
}
|
}
|
||||||
autoplay = "idle"
|
autoplay = "idle"
|
||||||
|
|
||||||
[node name="crouchrc1" type="RayCast2D" parent="."]
|
[node name="topcheck1" type="RayCast2D" parent="."]
|
||||||
position = Vector2(-29, -50)
|
position = Vector2(-29, -50)
|
||||||
target_position = Vector2(0, -37)
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
[node name="crouchrc2" type="RayCast2D" parent="."]
|
[node name="topcheck2" type="RayCast2D" parent="."]
|
||||||
position = Vector2(29, -50)
|
position = Vector2(29, -50)
|
||||||
target_position = Vector2(0, -37)
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
[node name="wallrunrcright1" type="RayCast2D" parent="."]
|
[node name="wallrunrcright1" type="RayCast2D" parent="."]
|
||||||
position = Vector2(0, -22)
|
position = Vector2(0, -22)
|
||||||
target_position = Vector2(150, 0)
|
target_position = Vector2(120, 0)
|
||||||
|
|
||||||
[node name="wallrunrcright2" type="RayCast2D" parent="."]
|
[node name="wallrunrcright2" type="RayCast2D" parent="."]
|
||||||
position = Vector2(0, -97)
|
position = Vector2(0, -97)
|
||||||
target_position = Vector2(150, 0)
|
target_position = Vector2(120, 0)
|
||||||
|
|
||||||
[node name="wallrunrcleft1" type="RayCast2D" parent="."]
|
[node name="wallrunrcleft1" type="RayCast2D" parent="."]
|
||||||
position = Vector2(0, -22)
|
position = Vector2(0, -22)
|
||||||
target_position = Vector2(-150, 0)
|
target_position = Vector2(-120, 0)
|
||||||
|
|
||||||
[node name="wallrunrcleft2" type="RayCast2D" parent="."]
|
[node name="wallrunrcleft2" type="RayCast2D" parent="."]
|
||||||
position = Vector2(0, -97)
|
position = Vector2(0, -97)
|
||||||
target_position = Vector2(-150, 0)
|
target_position = Vector2(-120, 0)
|
||||||
|
|
||||||
|
[node name="wallcheckleft" type="ShapeCast2D" parent="."]
|
||||||
|
position = Vector2(-28, -60)
|
||||||
|
scale = Vector2(0.5, 0.8)
|
||||||
|
shape = SubResource("RectangleShape2D_bruh7")
|
||||||
|
|
||||||
|
[node name="wallcheckright" type="ShapeCast2D" parent="."]
|
||||||
|
position = Vector2(28, -60)
|
||||||
|
scale = Vector2(0.5, 0.8)
|
||||||
|
shape = SubResource("RectangleShape2D_sfy4j")
|
||||||
|
|
||||||
[node name="floorcheck" type="RayCast2D" parent="."]
|
[node name="floorcheck" type="RayCast2D" parent="."]
|
||||||
position = Vector2(-1.90735e-06, -42)
|
position = Vector2(0, -47)
|
||||||
scale = Vector2(3.5, 1)
|
|
||||||
|
|
||||||
[node name="wallcheck" type="ShapeCast2D" parent="."]
|
|
||||||
position = Vector2(0, -68)
|
|
||||||
scale = Vector2(3.4, 1)
|
|
||||||
shape = SubResource("RectangleShape2D_bruh7")
|
|
||||||
|
|
||||||
[node name="ledgecollision" type="CollisionShape2D" parent="."]
|
[node name="ledgecollision" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2(0, -90)
|
position = Vector2(0, -90)
|
||||||
scale = Vector2(3.4, 1e-05)
|
scale = Vector2(3.5, 1e-05)
|
||||||
shape = SubResource("RectangleShape2D_6eyey")
|
shape = SubResource("RectangleShape2D_6eyey")
|
||||||
|
|
||||||
|
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("player", "initial_state")]
|
||||||
|
script = ExtResource("9_bruh7")
|
||||||
|
player = NodePath("..")
|
||||||
|
initial_state = NodePath("PlayerIdle")
|
||||||
|
|
||||||
|
[node name="PlayerCrouch" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("10_6eyey")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://cawr3av2aa8jb"
|
||||||
|
|
||||||
|
[node name="PlayerCrouchWalk" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("11_srp4u")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://dhvehwhg63p2h"
|
||||||
|
|
||||||
|
[node name="PlayerRun" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("11_p7iby")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://dyee6xwb8js1s"
|
||||||
|
|
||||||
|
[node name="PlayerJump" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("12_0rnld")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://d0cc7xgq16onu"
|
||||||
|
|
||||||
|
[node name="PlayerDoubleJump" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("14_61ith")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://cgsyaphtn6k6q"
|
||||||
|
|
||||||
|
[node name="PlayerWallrun" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("13_srp4u")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://bcnm70o0yo87k"
|
||||||
|
|
||||||
|
[node name="PlayerWallrunPushoff" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("16_61ith")
|
||||||
|
metadata/_custom_type_script = "uid://bxkdsl12qa7jy"
|
||||||
|
|
||||||
|
[node name="PlayerIdle" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("14_jfpux")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://d34ia87aolokd"
|
||||||
|
|
||||||
|
[node name="PlayerFall" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("16_jfpux")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://whap2d3r3yk"
|
||||||
|
|
||||||
|
[node name="PlayerLedgeGrab" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("19_ebwui")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://c46i4062efgw1"
|
||||||
|
|
||||||
|
[node name="PlayerClimbUp" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("21_gv3ic")
|
||||||
|
metadata/_custom_type_script = "uid://boe7p8pcolkln"
|
||||||
|
|||||||
523
sidescroller/scenes/Player.tscn20170388760.tmp
Normal file
523
sidescroller/scenes/Player.tscn20170388760.tmp
Normal file
@ -0,0 +1,523 @@
|
|||||||
|
[gd_scene load_steps=23 format=3 uid="uid://c3w3n7ysd02bd"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c1my4xbvhsdq8" path="res://assets/textures/Player Idle 144x144.png" id="1_p0vlq"]
|
||||||
|
[ext_resource type="Shape2D" uid="uid://bsdsjlbi8h6cf" path="res://resources/player standing cshape.tres" id="2_khinc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://crkx6pt8e4cmc" path="res://assets/textures/player new jump 144x144.png" id="2_qu4a1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dvy7cws4egkmh" path="res://assets/textures/player fall 144x144.png" id="3_70d11"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d11goqqiewsdg" path="res://assets/textures/player run 144x144.png" id="4_cw2d6"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dletf8p3wr4n4" path="res://assets/textures/player air spin 144x144.png" id="5_khinc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cox74najv0828" path="res://assets/textures/player crouch-walk 144x144.png" id="6_70d11"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://co5l6328i3y76" path="res://assets/textures/Player Crouch-Idle 144x144.png" id="6_cw2d6"]
|
||||||
|
[ext_resource type="Script" uid="uid://c0iqbs1ms86cw" path="res://scripts/state_machine.gd" id="9_bruh7"]
|
||||||
|
[ext_resource type="Script" uid="uid://cawr3av2aa8jb" path="res://scripts/playercrouch.gd" id="10_6eyey"]
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_khinc"]
|
||||||
|
script/source = "extends CharacterBody2D
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_6eyey"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("1_p0vlq")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_cw2d6"]
|
||||||
|
resource_name = "crouch idle"
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("6_cw2d6")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_khinc"]
|
||||||
|
resource_name = "crouch walk"
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("6_70d11")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_p7iby"]
|
||||||
|
resource_name = "double jump"
|
||||||
|
length = 0.55
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("5_khinc")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [6]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_o4126"]
|
||||||
|
resource_name = "fall"
|
||||||
|
length = 0.05
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("3_70d11")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_bruh7"]
|
||||||
|
resource_name = "idle"
|
||||||
|
length = 0.95
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("1_p0vlq")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_d3wef"]
|
||||||
|
resource_name = "jump"
|
||||||
|
length = 0.55
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("2_qu4a1")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [6]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_lkdrv"]
|
||||||
|
resource_name = "run"
|
||||||
|
length = 0.81
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("4_cw2d6")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [8]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0rnld"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_6eyey"),
|
||||||
|
&"crouch idle": SubResource("Animation_cw2d6"),
|
||||||
|
&"crouch walk": SubResource("Animation_khinc"),
|
||||||
|
&"double jump": SubResource("Animation_p7iby"),
|
||||||
|
&"fall": SubResource("Animation_o4126"),
|
||||||
|
&"idle": SubResource("Animation_bruh7"),
|
||||||
|
&"jump": SubResource("Animation_d3wef"),
|
||||||
|
&"run": SubResource("Animation_lkdrv")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bruh7"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6eyey"]
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody2D"]
|
||||||
|
script = SubResource("GDScript_khinc")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(4, -48)
|
||||||
|
texture = ExtResource("1_p0vlq")
|
||||||
|
hframes = 10
|
||||||
|
frame = 1
|
||||||
|
|
||||||
|
[node name="mainbody" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, -43)
|
||||||
|
shape = ExtResource("2_khinc")
|
||||||
|
|
||||||
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
position = Vector2(0, -90)
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
root_node = NodePath("../Camera2D")
|
||||||
|
libraries = {
|
||||||
|
&"": SubResource("AnimationLibrary_0rnld")
|
||||||
|
}
|
||||||
|
autoplay = "idle"
|
||||||
|
|
||||||
|
[node name="crouchrc1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(-29, -50)
|
||||||
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
|
[node name="crouchrc2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(29, -50)
|
||||||
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
|
[node name="wallrunrcright1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -22)
|
||||||
|
target_position = Vector2(150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcright2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -97)
|
||||||
|
target_position = Vector2(150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcleft1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -22)
|
||||||
|
target_position = Vector2(-150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcleft2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -97)
|
||||||
|
target_position = Vector2(-150, 0)
|
||||||
|
|
||||||
|
[node name="floorcheck" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(-1.90735e-06, -42)
|
||||||
|
scale = Vector2(3.5, 1)
|
||||||
|
|
||||||
|
[node name="wallcheck" type="ShapeCast2D" parent="."]
|
||||||
|
position = Vector2(0, -68)
|
||||||
|
scale = Vector2(3.4, 1)
|
||||||
|
shape = SubResource("RectangleShape2D_bruh7")
|
||||||
|
|
||||||
|
[node name="ledgecollision" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, -90)
|
||||||
|
scale = Vector2(3.4, 1e-05)
|
||||||
|
shape = SubResource("RectangleShape2D_6eyey")
|
||||||
|
|
||||||
|
[node name="state machine" type="Node" parent="." node_paths=PackedStringArray("initial_state")]
|
||||||
|
script = ExtResource("9_bruh7")
|
||||||
|
initial_state = NodePath("PlayerCrouch")
|
||||||
|
|
||||||
|
[node name="PlayerCrouch" type="Node" parent="state machine"]
|
||||||
|
script = ExtResource("10_6eyey")
|
||||||
|
metadata/_custom_type_script = "uid://cawr3av2aa8jb"
|
||||||
523
sidescroller/scenes/Player.tscn20179383087.tmp
Normal file
523
sidescroller/scenes/Player.tscn20179383087.tmp
Normal file
@ -0,0 +1,523 @@
|
|||||||
|
[gd_scene load_steps=23 format=3 uid="uid://c3w3n7ysd02bd"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c1my4xbvhsdq8" path="res://assets/textures/Player Idle 144x144.png" id="1_p0vlq"]
|
||||||
|
[ext_resource type="Shape2D" uid="uid://bsdsjlbi8h6cf" path="res://resources/player standing cshape.tres" id="2_khinc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://crkx6pt8e4cmc" path="res://assets/textures/player new jump 144x144.png" id="2_qu4a1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dvy7cws4egkmh" path="res://assets/textures/player fall 144x144.png" id="3_70d11"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d11goqqiewsdg" path="res://assets/textures/player run 144x144.png" id="4_cw2d6"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dletf8p3wr4n4" path="res://assets/textures/player air spin 144x144.png" id="5_khinc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cox74najv0828" path="res://assets/textures/player crouch-walk 144x144.png" id="6_70d11"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://co5l6328i3y76" path="res://assets/textures/Player Crouch-Idle 144x144.png" id="6_cw2d6"]
|
||||||
|
[ext_resource type="Script" uid="uid://c0iqbs1ms86cw" path="res://scripts/state_machine.gd" id="9_bruh7"]
|
||||||
|
[ext_resource type="Script" uid="uid://cawr3av2aa8jb" path="res://scripts/playercrouch.gd" id="10_6eyey"]
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_khinc"]
|
||||||
|
script/source = "extends CharacterBody2D
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_6eyey"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("1_p0vlq")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_cw2d6"]
|
||||||
|
resource_name = "crouch idle"
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("6_cw2d6")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_khinc"]
|
||||||
|
resource_name = "crouch walk"
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("6_70d11")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_p7iby"]
|
||||||
|
resource_name = "double jump"
|
||||||
|
length = 0.55
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("5_khinc")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [6]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_o4126"]
|
||||||
|
resource_name = "fall"
|
||||||
|
length = 0.05
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("3_70d11")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_bruh7"]
|
||||||
|
resource_name = "idle"
|
||||||
|
length = 0.95
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("1_p0vlq")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_d3wef"]
|
||||||
|
resource_name = "jump"
|
||||||
|
length = 0.55
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("2_qu4a1")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [6]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_lkdrv"]
|
||||||
|
resource_name = "run"
|
||||||
|
length = 0.81
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("4_cw2d6")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [8]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0rnld"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_6eyey"),
|
||||||
|
&"crouch idle": SubResource("Animation_cw2d6"),
|
||||||
|
&"crouch walk": SubResource("Animation_khinc"),
|
||||||
|
&"double jump": SubResource("Animation_p7iby"),
|
||||||
|
&"fall": SubResource("Animation_o4126"),
|
||||||
|
&"idle": SubResource("Animation_bruh7"),
|
||||||
|
&"jump": SubResource("Animation_d3wef"),
|
||||||
|
&"run": SubResource("Animation_lkdrv")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bruh7"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6eyey"]
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody2D"]
|
||||||
|
script = SubResource("GDScript_khinc")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(4, -48)
|
||||||
|
texture = ExtResource("1_p0vlq")
|
||||||
|
hframes = 10
|
||||||
|
frame = 1
|
||||||
|
|
||||||
|
[node name="mainbody" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, -43)
|
||||||
|
shape = ExtResource("2_khinc")
|
||||||
|
|
||||||
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
position = Vector2(0, -90)
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
root_node = NodePath("../Camera2D")
|
||||||
|
libraries = {
|
||||||
|
&"": SubResource("AnimationLibrary_0rnld")
|
||||||
|
}
|
||||||
|
autoplay = "idle"
|
||||||
|
|
||||||
|
[node name="crouchrc1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(-29, -50)
|
||||||
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
|
[node name="crouchrc2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(29, -50)
|
||||||
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
|
[node name="wallrunrcright1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -22)
|
||||||
|
target_position = Vector2(150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcright2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -97)
|
||||||
|
target_position = Vector2(150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcleft1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -22)
|
||||||
|
target_position = Vector2(-150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcleft2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -97)
|
||||||
|
target_position = Vector2(-150, 0)
|
||||||
|
|
||||||
|
[node name="floorcheck" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(-1.90735e-06, -42)
|
||||||
|
scale = Vector2(3.5, 1)
|
||||||
|
|
||||||
|
[node name="wallcheck" type="ShapeCast2D" parent="."]
|
||||||
|
position = Vector2(0, -68)
|
||||||
|
scale = Vector2(3.4, 1)
|
||||||
|
shape = SubResource("RectangleShape2D_bruh7")
|
||||||
|
|
||||||
|
[node name="ledgecollision" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, -90)
|
||||||
|
scale = Vector2(3.4, 1e-05)
|
||||||
|
shape = SubResource("RectangleShape2D_6eyey")
|
||||||
|
|
||||||
|
[node name="state machine" type="Node" parent="." node_paths=PackedStringArray("initial_state")]
|
||||||
|
script = ExtResource("9_bruh7")
|
||||||
|
initial_state = NodePath("PlayerCrouch")
|
||||||
|
|
||||||
|
[node name="PlayerCrouch" type="Node" parent="state machine"]
|
||||||
|
script = ExtResource("10_6eyey")
|
||||||
|
metadata/_custom_type_script = "uid://cawr3av2aa8jb"
|
||||||
545
sidescroller/scenes/Player.tscn2581566153.tmp
Normal file
545
sidescroller/scenes/Player.tscn2581566153.tmp
Normal file
@ -0,0 +1,545 @@
|
|||||||
|
[gd_scene load_steps=27 format=3 uid="uid://c3w3n7ysd02bd"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c1my4xbvhsdq8" path="res://assets/textures/Player Idle 144x144.png" id="1_p0vlq"]
|
||||||
|
[ext_resource type="Shape2D" uid="uid://bsdsjlbi8h6cf" path="res://resources/player standing cshape.tres" id="2_khinc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://crkx6pt8e4cmc" path="res://assets/textures/player new jump 144x144.png" id="2_qu4a1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dvy7cws4egkmh" path="res://assets/textures/player fall 144x144.png" id="3_70d11"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d11goqqiewsdg" path="res://assets/textures/player run 144x144.png" id="4_cw2d6"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dletf8p3wr4n4" path="res://assets/textures/player air spin 144x144.png" id="5_khinc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cox74najv0828" path="res://assets/textures/player crouch-walk 144x144.png" id="6_70d11"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://co5l6328i3y76" path="res://assets/textures/Player Crouch-Idle 144x144.png" id="6_cw2d6"]
|
||||||
|
[ext_resource type="Script" uid="uid://c0iqbs1ms86cw" path="res://scripts/State Machine.gd" id="9_bruh7"]
|
||||||
|
[ext_resource type="Script" uid="uid://cawr3av2aa8jb" path="res://scripts/playercrouch.gd" id="10_6eyey"]
|
||||||
|
[ext_resource type="Script" uid="uid://dyee6xwb8js1s" path="res://scripts/playerrun.gd" id="11_p7iby"]
|
||||||
|
[ext_resource type="Script" uid="uid://d0cc7xgq16onu" path="res://scripts/playerjump.gd" id="12_0rnld"]
|
||||||
|
[ext_resource type="Script" uid="uid://bcnm70o0yo87k" path="res://scripts/playerwallrun.gd" id="13_srp4u"]
|
||||||
|
[ext_resource type="Script" uid="uid://d34ia87aolokd" path="res://scripts/playeridle.gd" id="14_jfpux"]
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_khinc"]
|
||||||
|
script/source = "extends CharacterBody2D
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_6eyey"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("1_p0vlq")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_cw2d6"]
|
||||||
|
resource_name = "crouch idle"
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("6_cw2d6")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_khinc"]
|
||||||
|
resource_name = "crouch walk"
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("6_70d11")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_p7iby"]
|
||||||
|
resource_name = "double jump"
|
||||||
|
length = 0.55
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("5_khinc")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [6]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_o4126"]
|
||||||
|
resource_name = "fall"
|
||||||
|
length = 0.05
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("3_70d11")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_bruh7"]
|
||||||
|
resource_name = "idle"
|
||||||
|
length = 0.95
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("1_p0vlq")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_d3wef"]
|
||||||
|
resource_name = "jump"
|
||||||
|
length = 0.55
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("2_qu4a1")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [6]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_lkdrv"]
|
||||||
|
resource_name = "run"
|
||||||
|
length = 0.81
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.1
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ExtResource("4_cw2d6")]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("../Sprite2D:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [8]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("../Sprite2D:vframes")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [1]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/path = NodePath("../Sprite2D:frame")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0rnld"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_6eyey"),
|
||||||
|
&"crouch idle": SubResource("Animation_cw2d6"),
|
||||||
|
&"crouch walk": SubResource("Animation_khinc"),
|
||||||
|
&"double jump": SubResource("Animation_p7iby"),
|
||||||
|
&"fall": SubResource("Animation_o4126"),
|
||||||
|
&"idle": SubResource("Animation_bruh7"),
|
||||||
|
&"jump": SubResource("Animation_d3wef"),
|
||||||
|
&"run": SubResource("Animation_lkdrv")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bruh7"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6eyey"]
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody2D"]
|
||||||
|
script = SubResource("GDScript_khinc")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(4, -48)
|
||||||
|
texture = ExtResource("1_p0vlq")
|
||||||
|
hframes = 10
|
||||||
|
frame = 1
|
||||||
|
|
||||||
|
[node name="mainbody" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, -43)
|
||||||
|
shape = ExtResource("2_khinc")
|
||||||
|
|
||||||
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
position = Vector2(0, -90)
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
root_node = NodePath("../Camera2D")
|
||||||
|
libraries = {
|
||||||
|
&"": SubResource("AnimationLibrary_0rnld")
|
||||||
|
}
|
||||||
|
autoplay = "idle"
|
||||||
|
|
||||||
|
[node name="crouchrc1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(-29, -50)
|
||||||
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
|
[node name="crouchrc2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(29, -50)
|
||||||
|
target_position = Vector2(0, -37)
|
||||||
|
|
||||||
|
[node name="wallrunrcright1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -22)
|
||||||
|
target_position = Vector2(150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcright2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -97)
|
||||||
|
target_position = Vector2(150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcleft1" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -22)
|
||||||
|
target_position = Vector2(-150, 0)
|
||||||
|
|
||||||
|
[node name="wallrunrcleft2" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(0, -97)
|
||||||
|
target_position = Vector2(-150, 0)
|
||||||
|
|
||||||
|
[node name="floorcheck" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(-1.90735e-06, -42)
|
||||||
|
scale = Vector2(3.5, 1)
|
||||||
|
|
||||||
|
[node name="wallcheck" type="ShapeCast2D" parent="."]
|
||||||
|
position = Vector2(0, -68)
|
||||||
|
scale = Vector2(3.4, 1)
|
||||||
|
shape = SubResource("RectangleShape2D_bruh7")
|
||||||
|
|
||||||
|
[node name="ledgecollision" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, -90)
|
||||||
|
scale = Vector2(3.4, 1e-05)
|
||||||
|
shape = SubResource("RectangleShape2D_6eyey")
|
||||||
|
|
||||||
|
[node name="State Machine" type="Node" parent="." node_paths=PackedStringArray("player", "initial_state")]
|
||||||
|
script = ExtResource("9_bruh7")
|
||||||
|
player = NodePath("..")
|
||||||
|
initial_state = NodePath("PlayerIdle")
|
||||||
|
|
||||||
|
[node name="PlayerCrouch" type="Node" parent="State Machine"]
|
||||||
|
script = ExtResource("10_6eyey")
|
||||||
|
metadata/_custom_type_script = "uid://cawr3av2aa8jb"
|
||||||
|
|
||||||
|
[node name="PlayerRun" type="Node" parent="State Machine"]
|
||||||
|
script = ExtResource("11_p7iby")
|
||||||
|
metadata/_custom_type_script = "uid://dyee6xwb8js1s"
|
||||||
|
|
||||||
|
[node name="PlayerJump" type="Node" parent="State Machine"]
|
||||||
|
script = ExtResource("12_0rnld")
|
||||||
|
metadata/_custom_type_script = "uid://d0cc7xgq16onu"
|
||||||
|
|
||||||
|
[node name="PlayerWallrun" type="Node" parent="State Machine"]
|
||||||
|
script = ExtResource("13_srp4u")
|
||||||
|
metadata/_custom_type_script = "uid://bcnm70o0yo87k"
|
||||||
|
|
||||||
|
[node name="PlayerIdle" type="Node" parent="State Machine" node_paths=PackedStringArray("player")]
|
||||||
|
script = ExtResource("14_jfpux")
|
||||||
|
player = NodePath("../..")
|
||||||
|
metadata/_custom_type_script = "uid://d34ia87aolokd"
|
||||||
@ -13,15 +13,15 @@ size = Vector2(1001, 98)
|
|||||||
[node name="World" type="Node2D"]
|
[node name="World" type="Node2D"]
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||||
position = Vector2(601, 137)
|
position = Vector2(589, 149)
|
||||||
script = ExtResource("2_5a7ea")
|
script = ExtResource("2_5a7ea")
|
||||||
speed = 350
|
speed = 350
|
||||||
gravity = 40
|
grav = 40
|
||||||
jump_force = 800
|
jump_force = 800
|
||||||
fallvelocity_cap = 1000
|
fallvelocity_cap = 1000
|
||||||
max_air_jumps = 1
|
max_air_jumps = 1
|
||||||
crouch_mult = 1
|
sprint_mult = 1.5
|
||||||
sprint_mult = 1
|
crouch_mult = 0.4
|
||||||
|
|
||||||
[node name="Platform" type="StaticBody2D" parent="."]
|
[node name="Platform" type="StaticBody2D" parent="."]
|
||||||
position = Vector2(604, 135)
|
position = Vector2(604, 135)
|
||||||
|
|||||||
42
sidescroller/scripts/State Machine.gd
Normal file
42
sidescroller/scripts/State Machine.gd
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var player: Node # In Godot im Inspector zuweisen!
|
||||||
|
@export var initial_state : State
|
||||||
|
|
||||||
|
var current_state : State
|
||||||
|
|
||||||
|
var states : Dictionary = {}
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
for child in get_children():
|
||||||
|
if child is State:
|
||||||
|
states[child.name.to_lower()] = child
|
||||||
|
child.Transitioned.connect(on_child_transitioned)
|
||||||
|
child.player = player
|
||||||
|
|
||||||
|
if initial_state:
|
||||||
|
initial_state.enter()
|
||||||
|
current_state = initial_state
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
if current_state:
|
||||||
|
current_state.update(delta)
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
if current_state:
|
||||||
|
current_state.physics_update(delta)
|
||||||
|
|
||||||
|
func on_child_transitioned(state, new_state_name):
|
||||||
|
if state != current_state:
|
||||||
|
return
|
||||||
|
|
||||||
|
var new_state = states.get(new_state_name.to_lower())
|
||||||
|
if !new_state:
|
||||||
|
return
|
||||||
|
|
||||||
|
if current_state:
|
||||||
|
current_state.exit()
|
||||||
|
|
||||||
|
new_state.enter()
|
||||||
|
|
||||||
|
current_state = new_state
|
||||||
1
sidescroller/scripts/State Machine.gd.uid
Normal file
1
sidescroller/scripts/State Machine.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://c0iqbs1ms86cw
|
||||||
19
sidescroller/scripts/State.gd
Normal file
19
sidescroller/scripts/State.gd
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
class_name State
|
||||||
|
|
||||||
|
@export var player: CharacterBody2D # HIER hinzugefügt
|
||||||
|
|
||||||
|
signal Transitioned
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func update(_delta: float):
|
||||||
|
pass
|
||||||
|
|
||||||
|
func physics_update(_delta: float):
|
||||||
|
pass
|
||||||
1
sidescroller/scripts/State.gd.uid
Normal file
1
sidescroller/scripts/State.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://c6qk0yh300myk
|
||||||
@ -1,113 +1,114 @@
|
|||||||
extends CharacterBody2D
|
extends CharacterBody2D
|
||||||
|
|
||||||
@export var speed = 350
|
@export var speed = 350
|
||||||
@export var gravity = 40
|
@export var grav = 40
|
||||||
@export var jump_force = 800
|
@export var jump_force = 800
|
||||||
@export var fallvelocity_cap = 1000 # How fast the player can get when falling
|
@export var fallvelocity_cap = 1000 # How fast the player can get when falling
|
||||||
@export var max_air_jumps = 1 # Number of total jumps allowed (1 = normal, 2 = double jump)
|
@export var max_air_jumps = 1 # Number of total jumps allowed (1 = normal, 2 = double jump)
|
||||||
@export var crouch_mult = 1
|
|
||||||
@export var sprint_mult = 1
|
var input_direction = 0
|
||||||
|
var direction_locked = false
|
||||||
|
var facing_direction = 1 # 1 = right, -1 = left
|
||||||
|
|
||||||
|
@export var sprint_mult = 1.5
|
||||||
|
@export var crouch_mult = 0.4
|
||||||
|
|
||||||
@onready var ap = $AnimationPlayer
|
@onready var ap = $AnimationPlayer
|
||||||
@onready var sprite = $Sprite2D
|
@onready var sprite = $Sprite2D
|
||||||
@onready var cshape = $mainbody
|
@onready var cshape = $mainbody
|
||||||
@onready var crouch_raycast1 = $crouchrc1
|
@onready var topcheck1 = $topcheck1
|
||||||
@onready var crouch_raycast2 = $crouchrc2
|
@onready var topcheck2 = $topcheck2
|
||||||
|
|
||||||
|
@onready var statemachine = $StateMachine
|
||||||
|
|
||||||
@onready var wallrun_raycast_left1 = $wallrunrcleft1
|
@onready var wallrun_raycast_left1 = $wallrunrcleft1
|
||||||
@onready var wallrun_raycast_left2 = $wallrunrcleft2
|
@onready var wallrun_raycast_left2 = $wallrunrcleft2
|
||||||
@onready var wallrun_raycast_right1 = $wallrunrcright1
|
@onready var wallrun_raycast_right1 = $wallrunrcright1
|
||||||
@onready var wallrun_raycast_right2 = $wallrunrcright2
|
@onready var wallrun_raycast_right2 = $wallrunrcright2
|
||||||
@onready var wallcheck = $wallcheck
|
@onready var wallcheckright = $wallcheckright
|
||||||
|
@onready var wallcheckleft = $wallcheckleft
|
||||||
@onready var floorcheck = $floorcheck
|
@onready var floorcheck = $floorcheck
|
||||||
|
|
||||||
|
var horizontal_direction = 0
|
||||||
|
var v_mult = 1 #velocity multiplier
|
||||||
|
var v_push = 0 #velocity push in either direction
|
||||||
|
|
||||||
var air_jumps_done = 0
|
var air_jumps_done = 0
|
||||||
var is_crouching = false
|
|
||||||
var stuck_under_object = false
|
var stuck_under_object = false
|
||||||
|
|
||||||
var wallrun_available := true
|
var wallrun_available := true
|
||||||
var wallrun_timer := 0.0 #:= bedeutet, dass der Typ fest festgelegt ist (z.B int, bool etc.)
|
var wallrun_timer := 0.0 #:= bedeutet, dass der Typ fest festgelegt ist (z.B int, bool etc.)
|
||||||
var wallrun_time := 1 # Dauer des Wallruns in Sekunden
|
var wallrun_time := 1 # Dauer des Wallruns in Sekunden
|
||||||
var wallrun_speed := -250.0 # Geschwindigkeit nach oben (negativ wegen y-Achse)
|
var wallrun_speed := -250.0 # Geschwindigkeit nach oben (negativ wegen y-Achse)
|
||||||
|
|
||||||
var wallpushoff_force := 450 # Stärke des Abstoßens
|
var wallpushoff_force := 450 # Stärke des Abstoßens
|
||||||
|
var wallpushoff_mult := 0.3 # schränkt die velocity.x Kontrolle des Spielers ein.
|
||||||
var wallpushoff_timer := 0.0
|
var wallpushoff_timer := 0.0
|
||||||
var wallpushoff_time := 0.5 # dauer des pushoffs
|
var wallpushoff_time := 0.5 # dauer des pushoffs
|
||||||
var wallrunning := false
|
|
||||||
var pushingoffwall := false
|
|
||||||
var wallrun_direction := 0 # -1 = links, 1 = rechts
|
|
||||||
|
|
||||||
var standing_cshape = preload("res://resources/player standing cshape.tres")
|
var climbup_pos1 = Vector2(0, 0)
|
||||||
var crouching_cshape = preload("res://resources/player crouching cshape.tres")
|
var climbup_pos2 = Vector2(0, 0)
|
||||||
|
var climbup_pos1_reached = false
|
||||||
|
var climbup_speed_y = 100
|
||||||
|
var climbup_speed_x = 500
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
#turnmovement()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func _physics_process(delta):
|
|
||||||
var horizontal_direction = Input.get_axis("move_left", "move_right")
|
|
||||||
|
|
||||||
if !is_on_floor():
|
|
||||||
velocity.y += gravity
|
|
||||||
if velocity.y > fallvelocity_cap:
|
|
||||||
velocity.y = fallvelocity_cap
|
|
||||||
else:
|
|
||||||
air_jumps_done = 0
|
|
||||||
wallrun_available = true
|
|
||||||
|
|
||||||
if Input.is_action_just_pressed("jump") && Input.is_action_pressed("move_right") && wall_detected_right() && wallrun_available:
|
|
||||||
start_wallrun(1)
|
|
||||||
elif Input.is_action_just_pressed("jump") && Input.is_action_pressed("move_left") && wall_detected_left() && wallrun_available:
|
|
||||||
start_wallrun(-1)
|
|
||||||
elif Input.is_action_just_pressed("jump"):
|
|
||||||
if is_on_floor():
|
|
||||||
velocity.y = -jump_force
|
|
||||||
elif air_jumps_done < max_air_jumps:
|
|
||||||
velocity.y = -jump_force
|
|
||||||
air_jumps_done += 1
|
|
||||||
|
|
||||||
if wallrunning:
|
|
||||||
wallrun_timer += delta
|
|
||||||
velocity.y = wallrun_speed # Bewegt nach oben
|
|
||||||
|
|
||||||
if wallrun_direction > 0 && !wallrun_raycast_right2.is_colliding():
|
|
||||||
ledgedetected()
|
|
||||||
if wallrun_direction < 1 && !wallrun_raycast_left2.is_colliding():
|
|
||||||
ledgedetected()
|
|
||||||
elif wallrun_timer >= wallrun_time:
|
|
||||||
wallpushoff()
|
|
||||||
|
|
||||||
elif pushingoffwall:
|
|
||||||
wallpushoff_timer += delta
|
|
||||||
velocity.x = speed * 0.3 * horizontal_direction + (-wallrun_direction * wallpushoff_force)
|
|
||||||
|
|
||||||
if wallpushoff_timer >= wallpushoff_time:
|
|
||||||
pushingoffwall = false
|
|
||||||
|
|
||||||
else:
|
|
||||||
velocity.x = speed * horizontal_direction * crouch_mult
|
|
||||||
if horizontal_direction != 0:
|
|
||||||
switchdirection(horizontal_direction)
|
|
||||||
|
|
||||||
|
|
||||||
if Input.is_action_just_pressed("crouch"):
|
|
||||||
crouch()
|
|
||||||
elif Input.is_action_just_released("crouch"):
|
|
||||||
if above_head_empty():
|
|
||||||
stand()
|
|
||||||
else:
|
|
||||||
if stuck_under_object != true:
|
|
||||||
stuck_under_object = true
|
|
||||||
print("player stuck under object")
|
|
||||||
|
|
||||||
if stuck_under_object && above_head_empty():
|
|
||||||
if !Input.is_action_pressed("crouch"):
|
|
||||||
stand()
|
|
||||||
stuck_under_object = false
|
|
||||||
|
|
||||||
move_and_slide()
|
|
||||||
|
|
||||||
update_animation(horizontal_direction)
|
|
||||||
|
|
||||||
func above_head_empty() -> bool:
|
func _physics_process(delta):
|
||||||
var result = !crouch_raycast1.is_colliding() && !crouch_raycast2.is_colliding()
|
|
||||||
|
move_and_slide()
|
||||||
|
input_direction = Input.get_axis("move_left", "move_right")
|
||||||
|
|
||||||
|
#print(statemachine.current_state.get_state_name()) # zum debuggen aktivieren
|
||||||
|
|
||||||
|
if statemachine.current_state.get_state_name() not in ["PlayerWallrun", "PlayerClimbUp"]:
|
||||||
|
gravity()
|
||||||
|
|
||||||
|
if statemachine.current_state.get_state_name() not in ["PlayerWallrun", "PlayerWallrunPushoff", "PlayerLedgeGrab", "PlayerClimbUp"]:
|
||||||
|
turnmovement()
|
||||||
|
|
||||||
|
|
||||||
|
$ledgecollision.disabled = statemachine.current_state.get_state_name() in ["PlayerIdle", "PlayerRun", "PlayerCrouch", "PlayerCrouchWalk", "PlayerJump", "PlayerWallrun", "PlayerClimbUp"] or velocity.y < 0 or Input.is_action_pressed("crouch") or(topcheck1.is_colliding() and topcheck2.is_colliding() and statemachine.current_state.get_state_name() != "PlayerLedgeGrab")
|
||||||
|
|
||||||
|
func movement():
|
||||||
|
velocity.x = speed * input_direction * v_mult + v_push
|
||||||
|
|
||||||
|
func turnmovement():
|
||||||
|
movement()
|
||||||
|
|
||||||
|
if direction_locked:
|
||||||
|
return
|
||||||
|
|
||||||
|
if input_direction != 0 and sign(input_direction) != facing_direction:
|
||||||
|
switch_direction(sign(input_direction))
|
||||||
|
|
||||||
|
func switch_direction(new_direction):
|
||||||
|
facing_direction = new_direction
|
||||||
|
sprite.flip_h = (facing_direction == -1)
|
||||||
|
|
||||||
|
func set_facing_direction(dir: int): #manual flip
|
||||||
|
if direction_locked:
|
||||||
|
return
|
||||||
|
if dir in [-1, 1] and dir != facing_direction:
|
||||||
|
switch_direction(dir)
|
||||||
|
|
||||||
|
func lock_direction():
|
||||||
|
direction_locked = true
|
||||||
|
|
||||||
|
func unlock_direction():
|
||||||
|
direction_locked = false
|
||||||
|
|
||||||
|
func gravity():
|
||||||
|
velocity.y += grav
|
||||||
|
if velocity.y > fallvelocity_cap:
|
||||||
|
velocity.y = fallvelocity_cap
|
||||||
|
|
||||||
|
func head_clear() -> bool:
|
||||||
|
var result = !topcheck1.is_colliding() && !topcheck2.is_colliding()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
func wall_detected_left() -> bool:
|
func wall_detected_left() -> bool:
|
||||||
@ -117,67 +118,42 @@ func wall_detected_left() -> bool:
|
|||||||
func wall_detected_right() -> bool:
|
func wall_detected_right() -> bool:
|
||||||
var result = wallrun_raycast_right1.is_colliding() && wallrun_raycast_right2.is_colliding()
|
var result = wallrun_raycast_right1.is_colliding() && wallrun_raycast_right2.is_colliding()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
# transition functions
|
||||||
|
|
||||||
|
func transitionidle() -> bool:
|
||||||
|
var result = Input.get_axis("move_left", "move_right") == 0 && is_on_floor()
|
||||||
|
return result
|
||||||
|
|
||||||
func start_wallrun(direction: int):
|
func transitionrun() -> bool:
|
||||||
wallrunning = true
|
var result = Input.get_axis("move_left", "move_right") != 0 && is_on_floor()
|
||||||
wallrun_available = false
|
return result
|
||||||
wallrun_direction = direction
|
|
||||||
velocity.x = 1000 * wallrun_direction # An Wand haften
|
|
||||||
print("start wallrun called")
|
|
||||||
|
|
||||||
func wallpushoff():
|
func transitionjump() -> bool:
|
||||||
wallrunning = false
|
var result = Input.is_action_just_pressed("jump") && is_on_floor()
|
||||||
pushingoffwall = true
|
return result
|
||||||
wallpushoff_timer = 0.0
|
|
||||||
wallrun_timer = 0.0
|
|
||||||
print("stop wallrun called")
|
|
||||||
|
|
||||||
func ledgedetected():
|
func transitiondoublejump() -> bool:
|
||||||
wallrunning = false
|
var result = Input.is_action_just_pressed("jump") && !is_on_floor() && (air_jumps_done < max_air_jumps)
|
||||||
wallrun_timer = 0.0
|
return result
|
||||||
|
|
||||||
func checkledgegrab() -> bool:
|
func transitionfall() -> bool:
|
||||||
var result = wallcheck.is_colliding() && !floorcheck.is_colliding() && velocity.y == 0
|
var result = velocity.y > 0 && !is_on_floor()
|
||||||
|
return result
|
||||||
|
|
||||||
|
func transitionledgegrab() -> bool:
|
||||||
|
var result = !floorcheck.is_colliding() && velocity.y - grav == 0 && (wallcheckright.is_colliding() or wallcheckleft.is_colliding())
|
||||||
return result
|
return result
|
||||||
|
|
||||||
func update_animation(horizontal_direction):
|
func transitioncrouch() -> bool:
|
||||||
if is_on_floor():
|
var result = is_on_floor() && Input.is_action_pressed("crouch")
|
||||||
if horizontal_direction == 0:
|
return result
|
||||||
if is_crouching:
|
|
||||||
ap.play("crouch idle")
|
|
||||||
else:
|
|
||||||
ap.play("idle")
|
|
||||||
else:
|
|
||||||
if is_crouching:
|
|
||||||
ap.play("crouch walk")
|
|
||||||
else:
|
|
||||||
ap.play("run")
|
|
||||||
else:
|
|
||||||
if velocity.y < 0:
|
|
||||||
if air_jumps_done == 0 :
|
|
||||||
ap.play("jump")
|
|
||||||
elif air_jumps_done == 1:
|
|
||||||
ap.play("double jump")
|
|
||||||
elif velocity.y > 0:
|
|
||||||
ap.play("fall")
|
|
||||||
|
|
||||||
func crouch():
|
|
||||||
if is_crouching:
|
|
||||||
return
|
|
||||||
is_crouching = true
|
|
||||||
crouch_mult = 0.4
|
|
||||||
cshape.shape = crouching_cshape
|
|
||||||
cshape.position.y = -31
|
|
||||||
|
|
||||||
func stand():
|
func transitioncrouchwalk() -> bool:
|
||||||
if is_crouching == false:
|
var result = is_on_floor() && Input.is_action_pressed("crouch") && Input.get_axis("move_left", "move_right") != 0
|
||||||
return
|
return result
|
||||||
is_crouching = false
|
|
||||||
crouch_mult = 1
|
|
||||||
cshape.shape = standing_cshape
|
|
||||||
cshape.position.y = -44
|
|
||||||
|
|
||||||
func switchdirection(horizontal_direction):
|
func transitionwallrun() -> bool:
|
||||||
sprite.flip_h = (horizontal_direction == -1)
|
var result = Input.is_action_just_pressed("jump") and ((Input.is_action_pressed("move_right") && wall_detected_right()) or (Input.is_action_pressed("move_left") && wall_detected_left())) and wallrun_available
|
||||||
sprite.position.x = horizontal_direction * 4
|
return result
|
||||||
|
|
||||||
|
|||||||
46
sidescroller/scripts/playerclimbup.gd
Normal file
46
sidescroller/scripts/playerclimbup.gd
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerClimbUp
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
var ledge_cshape = preload("res://resources/player ledge cshape.tres")
|
||||||
|
var standing_cshape = preload("res://resources/player standing cshape.tres")
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
|
||||||
|
player.climbup_pos1 = player.position + Vector2(0, -52)
|
||||||
|
player.climbup_pos2 = player.position + Vector2(player.facing_direction * 40, -52)
|
||||||
|
|
||||||
|
print(player.position)
|
||||||
|
print (player.climbup_pos1)
|
||||||
|
|
||||||
|
player.ap.play("climb up")
|
||||||
|
player.sprite.position.x = player.facing_direction * 11
|
||||||
|
player.sprite.position.y = -60
|
||||||
|
|
||||||
|
player.cshape.shape = ledge_cshape
|
||||||
|
player.cshape.position.y = -69
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
player.cshape.shape = standing_cshape
|
||||||
|
player.cshape.position.y = -43
|
||||||
|
|
||||||
|
player.sprite.position.x = 0
|
||||||
|
player.sprite.position.y = -48
|
||||||
|
|
||||||
|
player.climbup_pos1_reached = false
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
pass
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
|
||||||
|
if player.position != player.climbup_pos1 && !player.climbup_pos1_reached:
|
||||||
|
player.position = player.position.move_toward(player.climbup_pos1, player.climbup_speed_y * delta)
|
||||||
|
if player.position == player.climbup_pos1:
|
||||||
|
player.climbup_pos1_reached = true
|
||||||
|
elif player.position != player.climbup_pos2 && player.climbup_pos1_reached:
|
||||||
|
player.position = player.position.move_toward(player.climbup_pos2, player.climbup_speed_x * delta)
|
||||||
|
elif player.position == player.climbup_pos2:
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
1
sidescroller/scripts/playerclimbup.gd.uid
Normal file
1
sidescroller/scripts/playerclimbup.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://boe7p8pcolkln
|
||||||
37
sidescroller/scripts/playercrouch.gd
Normal file
37
sidescroller/scripts/playercrouch.gd
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerCrouch
|
||||||
|
|
||||||
|
var crouching_cshape = preload("res://resources/player crouching cshape.tres")
|
||||||
|
var standing_cshape = preload("res://resources/player standing cshape.tres")
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.cshape.shape = crouching_cshape
|
||||||
|
player.cshape.position.y = -31
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
player.cshape.shape = standing_cshape
|
||||||
|
player.cshape.position.y = -44
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
|
||||||
|
var horizontal_direction = Input.get_axis("move_left", "move_right")
|
||||||
|
|
||||||
|
if player.is_on_floor():
|
||||||
|
if horizontal_direction == 0:
|
||||||
|
player.ap.play("crouch idle")
|
||||||
|
else:
|
||||||
|
Transitioned.emit(self, "PlayerCrouchwalk")
|
||||||
|
|
||||||
|
if player.head_clear() and (Input.is_action_just_released("crouch") or !Input.is_action_pressed("crouch")):
|
||||||
|
Transitioned.emit(self, "PlayerIdle")
|
||||||
|
player.stuck_under_object = false
|
||||||
|
elif !player.head_clear():
|
||||||
|
if player.stuck_under_object != true:
|
||||||
|
player.stuck_under_object = true
|
||||||
|
print("player stuck under object", player.stuck_under_object)
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
pass
|
||||||
1
sidescroller/scripts/playercrouch.gd.uid
Normal file
1
sidescroller/scripts/playercrouch.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://cawr3av2aa8jb
|
||||||
32
sidescroller/scripts/playercrouchwalk.gd
Normal file
32
sidescroller/scripts/playercrouchwalk.gd
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerCrouchWalk
|
||||||
|
|
||||||
|
var crouching_cshape = preload("res://resources/player crouching cshape.tres")
|
||||||
|
var standing_cshape = preload("res://resources/player standing cshape.tres")
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.cshape.shape = crouching_cshape
|
||||||
|
player.cshape.position.y = -31
|
||||||
|
player.v_mult = player.crouch_mult
|
||||||
|
func exit():
|
||||||
|
player.cshape.shape = standing_cshape
|
||||||
|
player.cshape.position.y = -44
|
||||||
|
player.v_mult = 1
|
||||||
|
func update(delta):
|
||||||
|
player.ap.play("crouch walk")
|
||||||
|
|
||||||
|
if player.head_clear() and (Input.is_action_just_released("crouch") or !Input.is_action_pressed("crouch")):
|
||||||
|
Transitioned.emit(self, "PlayerIdle")
|
||||||
|
player.stuck_under_object = false
|
||||||
|
elif Input.get_axis("move_left", "move_right") == 0:
|
||||||
|
Transitioned.emit(self, "PlayerCrouch")
|
||||||
|
elif !player.head_clear():
|
||||||
|
if player.stuck_under_object != true:
|
||||||
|
player.stuck_under_object = true
|
||||||
|
print("player stuck under object")
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
pass
|
||||||
1
sidescroller/scripts/playercrouchwalk.gd.uid
Normal file
1
sidescroller/scripts/playercrouchwalk.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://dhvehwhg63p2h
|
||||||
26
sidescroller/scripts/playerdoublejump.gd
Normal file
26
sidescroller/scripts/playerdoublejump.gd
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerDoubleJump
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.ap.play("double jump")
|
||||||
|
player.velocity.y = -player.jump_force
|
||||||
|
player.air_jumps_done += 1
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
if player.velocity.y > 0 and !player.is_on_floor():
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
|
elif !player.is_on_floor() and Input.is_action_just_pressed("jump") and (player.air_jumps_done < player.max_air_jumps):
|
||||||
|
Transitioned.emit(self, "PlayerDoubleJump")
|
||||||
|
elif player.is_on_floor() && player.velocity.x != 0:
|
||||||
|
Transitioned.emit(self, "PlayerRun")
|
||||||
|
elif player.is_on_floor():
|
||||||
|
Transitioned.emit(self, "PlayerIdle")
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
pass
|
||||||
1
sidescroller/scripts/playerdoublejump.gd.uid
Normal file
1
sidescroller/scripts/playerdoublejump.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://cgsyaphtn6k6q
|
||||||
30
sidescroller/scripts/playerfall.gd
Normal file
30
sidescroller/scripts/playerfall.gd
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerFall
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
player.ap.play("fall")
|
||||||
|
|
||||||
|
if player.transitionledgegrab():
|
||||||
|
Transitioned.emit(self, "PlayerLedgeGrab")
|
||||||
|
elif player.transitiondoublejump():
|
||||||
|
Transitioned.emit(self, "PlayerDoubleJump")
|
||||||
|
elif player.transitionidle():
|
||||||
|
Transitioned.emit(self, "PlayerIdle")
|
||||||
|
elif player.transitionrun():
|
||||||
|
Transitioned.emit(self, "PlayerRun")
|
||||||
|
|
||||||
|
player.gravity()
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
pass
|
||||||
|
#player.turnmovement()
|
||||||
|
|
||||||
1
sidescroller/scripts/playerfall.gd.uid
Normal file
1
sidescroller/scripts/playerfall.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://whap2d3r3yk
|
||||||
27
sidescroller/scripts/playeridle.gd
Normal file
27
sidescroller/scripts/playeridle.gd
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerIdle
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.air_jumps_done = 0
|
||||||
|
player.wallrun_available = true
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
player.ap.play("idle")
|
||||||
|
|
||||||
|
if player.transitionfall():
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
|
elif player.transitionrun():
|
||||||
|
Transitioned.emit(self, "PlayerRun")
|
||||||
|
elif player.transitioncrouch():
|
||||||
|
Transitioned.emit(self, "PlayerCrouch")
|
||||||
|
elif player.transitionjump():
|
||||||
|
Transitioned.emit(self, "PlayerJump")
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
player.gravity()
|
||||||
1
sidescroller/scripts/playeridle.gd.uid
Normal file
1
sidescroller/scripts/playeridle.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://d34ia87aolokd
|
||||||
25
sidescroller/scripts/playerjump.gd
Normal file
25
sidescroller/scripts/playerjump.gd
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerJump
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.ap.play("jump")
|
||||||
|
player.velocity.y = -player.jump_force
|
||||||
|
func exit():
|
||||||
|
pass
|
||||||
|
func update(delta):
|
||||||
|
|
||||||
|
if player.transitionledgegrab():
|
||||||
|
Transitioned.emit(self, "PlayerLedgeGrab")
|
||||||
|
elif player.transitionfall():
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
|
elif !player.is_on_floor() and Input.is_action_just_pressed("jump") and (player.air_jumps_done < player.max_air_jumps):
|
||||||
|
Transitioned.emit(self, "PlayerDoubleJump")
|
||||||
|
elif player.is_on_floor() && player.velocity.x != 0:
|
||||||
|
Transitioned.emit(self, "PlayerRun")
|
||||||
|
elif player.is_on_floor():
|
||||||
|
Transitioned.emit(self, "PlayerIdle")
|
||||||
|
func physics_update(delta):
|
||||||
|
pass
|
||||||
1
sidescroller/scripts/playerjump.gd.uid
Normal file
1
sidescroller/scripts/playerjump.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://d0cc7xgq16onu
|
||||||
38
sidescroller/scripts/playerledgegrab.gd
Normal file
38
sidescroller/scripts/playerledgegrab.gd
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerLedgeGrab
|
||||||
|
|
||||||
|
var ledge_cshape = preload("res://resources/player ledge cshape.tres")
|
||||||
|
var standing_cshape = preload("res://resources/player standing cshape.tres")
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
if player.wallcheckright.is_colliding() and player.facing_direction == -1:
|
||||||
|
player.set_facing_direction(1)
|
||||||
|
elif player.wallcheckleft.is_colliding() and player.facing_direction == 1:
|
||||||
|
player.set_facing_direction(-1)
|
||||||
|
|
||||||
|
player.ap.play("ledge hang")
|
||||||
|
player.sprite.position.x = player.facing_direction * 11
|
||||||
|
player.sprite.position.y = -54
|
||||||
|
|
||||||
|
player.cshape.shape = ledge_cshape
|
||||||
|
player.cshape.position.y = -55
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
player.cshape.shape = standing_cshape
|
||||||
|
player.cshape.position.y = -43
|
||||||
|
|
||||||
|
player.sprite.position.x = 0
|
||||||
|
player.sprite.position.y = -48
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
|
||||||
|
if Input.is_action_just_pressed("jump"):
|
||||||
|
Transitioned.emit(self, "PlayerClimbUp")
|
||||||
|
elif player.floorcheck.is_colliding() or (!player.wallcheckright.is_colliding() and !player.wallcheckleft.is_colliding()) or Input.is_action_pressed("crouch"):
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
pass
|
||||||
1
sidescroller/scripts/playerledgegrab.gd.uid
Normal file
1
sidescroller/scripts/playerledgegrab.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://c46i4062efgw1
|
||||||
28
sidescroller/scripts/playerrun.gd
Normal file
28
sidescroller/scripts/playerrun.gd
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerRun
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.air_jumps_done = 0
|
||||||
|
player.wallrun_available = true
|
||||||
|
player.v_mult = 1
|
||||||
|
func exit():
|
||||||
|
pass
|
||||||
|
func update(delta):
|
||||||
|
player.ap.play("run")
|
||||||
|
|
||||||
|
if player.transitionidle():
|
||||||
|
Transitioned.emit(self, "PlayerIdle")
|
||||||
|
elif player.transitioncrouch():
|
||||||
|
Transitioned.emit(self, "PlayerCrouchwalk")
|
||||||
|
elif player.transitionwallrun():
|
||||||
|
Transitioned.emit(self, "PlayerWallrun")
|
||||||
|
elif player.transitionjump():
|
||||||
|
Transitioned.emit(self, "PlayerJump")
|
||||||
|
elif player.transitionfall():
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
pass
|
||||||
1
sidescroller/scripts/playerrun.gd.uid
Normal file
1
sidescroller/scripts/playerrun.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://dyee6xwb8js1s
|
||||||
31
sidescroller/scripts/playerwallrun.gd
Normal file
31
sidescroller/scripts/playerwallrun.gd
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerWallrun
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.wallrun_available = false
|
||||||
|
|
||||||
|
player.velocity.x = 2000 * player.facing_direction # An Wand haften
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
player.wallrun_timer = 0.0
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
pass
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
player.wallrun_timer += delta
|
||||||
|
player.velocity.y = player.wallrun_speed # Bewegt nach oben
|
||||||
|
|
||||||
|
if player.facing_direction > 0 && !player.wallrun_raycast_right2.is_colliding():
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
|
if player.facing_direction < 1 && !player.wallrun_raycast_left2.is_colliding():
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
|
elif player.wallrun_timer >= player.wallrun_time:
|
||||||
|
Transitioned.emit(self, "PlayerWallrunPushoff")
|
||||||
|
|
||||||
|
func transitionwallrunpushoff() -> bool:
|
||||||
|
var result = player.wallrun_timer >= player.wallrun_time
|
||||||
|
return result
|
||||||
1
sidescroller/scripts/playerwallrun.gd.uid
Normal file
1
sidescroller/scripts/playerwallrun.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://bcnm70o0yo87k
|
||||||
27
sidescroller/scripts/playerwallrunpushoff.gd
Normal file
27
sidescroller/scripts/playerwallrunpushoff.gd
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
extends State
|
||||||
|
class_name PlayerWallrunPushoff
|
||||||
|
|
||||||
|
func get_state_name():
|
||||||
|
return str(self).split(":")[0]
|
||||||
|
|
||||||
|
func enter():
|
||||||
|
player.v_mult = player.wallpushoff_mult
|
||||||
|
player.v_push = -player.facing_direction * player.wallpushoff_force
|
||||||
|
print("pushoff entered")
|
||||||
|
|
||||||
|
func exit():
|
||||||
|
player.wallpushoff_timer = 0.0
|
||||||
|
player.v_mult = 1
|
||||||
|
player.v_push = 0
|
||||||
|
player.set_facing_direction(-player.facing_direction)
|
||||||
|
|
||||||
|
func update(delta):
|
||||||
|
pass
|
||||||
|
|
||||||
|
func physics_update(delta):
|
||||||
|
player.movement()
|
||||||
|
|
||||||
|
player.wallpushoff_timer += delta
|
||||||
|
|
||||||
|
if player.wallpushoff_timer >= player.wallpushoff_time:
|
||||||
|
Transitioned.emit(self, "PlayerFall")
|
||||||
1
sidescroller/scripts/playerwallrunpushoff.gd.uid
Normal file
1
sidescroller/scripts/playerwallrunpushoff.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://bxkdsl12qa7jy
|
||||||
Reference in New Issue
Block a user