newest Version as of right now
This commit is contained in:
17
.gitignore
vendored
17
.gitignore
vendored
@ -1,17 +0,0 @@
|
||||
# ---> Godot
|
||||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
|
||||
# Godot-specific ignores
|
||||
.import/
|
||||
export.cfg
|
||||
export_presets.cfg
|
||||
|
||||
# Imported translations (automatically generated from CSV files)
|
||||
*.translation
|
||||
|
||||
# Mono-specific ignores
|
||||
.mono/
|
||||
data_*/
|
||||
mono_crash.*.json
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
BIN
sidescroller/assets/textures/Player Roll 144x144.png
Normal file
BIN
sidescroller/assets/textures/Player Roll 144x144.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@ -2,16 +2,16 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c2vs4ssjqtd2i"
|
||||
path="res://.godot/imported/360x360 idle 4.png-6f340b4285f1ced246665e4a52a5b3e6.ctex"
|
||||
uid="uid://bnmsf8vhuo0d5"
|
||||
path="res://.godot/imported/Player Roll 144x144.png-5553df63b4cd5f1e98261ab104a261b2.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/360x360 idle 4.png"
|
||||
dest_files=["res://.godot/imported/360x360 idle 4.png-6f340b4285f1ced246665e4a52a5b3e6.ctex"]
|
||||
source_file="res://assets/textures/Player Roll 144x144.png"
|
||||
dest_files=["res://.godot/imported/Player Roll 144x144.png-5553df63b4cd5f1e98261ab104a261b2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
BIN
sidescroller/assets/textures/player reverse vault 144x144.png
Normal file
BIN
sidescroller/assets/textures/player reverse vault 144x144.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://nf8iaga2ce0g"
|
||||
path="res://.godot/imported/player reverse vault 144x144.png-d77bd7af609c4edb1f8a58c2d65c4e7f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/player reverse vault 144x144.png"
|
||||
dest_files=["res://.godot/imported/player reverse vault 144x144.png-d77bd7af609c4edb1f8a58c2d65c4e7f.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
|
||||
BIN
sidescroller/assets/textures/player wallrun 144x144.png
Normal file
BIN
sidescroller/assets/textures/player wallrun 144x144.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://qat50ripqu32"
|
||||
path="res://.godot/imported/player wallrun 144x144.png-95291f2b882699223dcb597652983c1b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/player wallrun 144x144.png"
|
||||
dest_files=["res://.godot/imported/player wallrun 144x144.png-95291f2b882699223dcb597652983c1b.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
|
||||
@ -23,10 +23,6 @@ window/size/window_width_override=1280
|
||||
window/size/window_height_override=720
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="Sidescroller"
|
||||
|
||||
[input]
|
||||
|
||||
jump={
|
||||
@ -49,6 +45,18 @@ crouch={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
sprint={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_render/layer_1="world"
|
||||
2d_render/layer_2="interactions"
|
||||
2d_physics/layer_1="world"
|
||||
2d_physics/layer_2="interactions"
|
||||
|
||||
[rendering]
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=38 format=3 uid="uid://c3w3n7ysd02bd"]
|
||||
[gd_scene load_steps=48 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://crkx6pt8e4cmc" path="res://assets/textures/player new jump 144x144.png" id="2_qu4a1"]
|
||||
@ -9,11 +9,14 @@
|
||||
[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="Texture2D" uid="uid://bnmsf8vhuo0d5" path="res://assets/textures/Player Roll 144x144.png" id="10_6e537"]
|
||||
[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="Texture2D" uid="uid://qat50ripqu32" path="res://assets/textures/player wallrun 144x144.png" id="11_p07f3"]
|
||||
[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="Texture2D" uid="uid://nf8iaga2ce0g" path="res://assets/textures/player reverse vault 144x144.png" id="12_viqgg"]
|
||||
[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"]
|
||||
@ -21,6 +24,10 @@
|
||||
[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"]
|
||||
[ext_resource type="Script" uid="uid://clru46wbu1bi1" path="res://scripts/playerroll.gd" id="22_b8lor"]
|
||||
[ext_resource type="Script" uid="uid://dq3g3qck2e0wv" path="res://scripts/playervault.gd" id="26_fgkxt"]
|
||||
[ext_resource type="Script" uid="uid://qf4kjhw6b8ip" path="res://scripts/playerdash.gd" id="27_xsi7p"]
|
||||
[ext_resource type="Script" uid="uid://bjln8dh5ajphf" path="res://scripts/playerfallroll.gd" id="28_1jpwa"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_khinc"]
|
||||
script/source = "extends CharacterBody2D
|
||||
@ -91,11 +98,35 @@ tracks/4/keys = {
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("../Sprite2D:position")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(11, -60)]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("../RootMotion:position")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(11, -60)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_6e537"]
|
||||
resource_name = "climb up"
|
||||
length = 0.5
|
||||
step = 0.03
|
||||
step = 0.01
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
@ -139,11 +170,23 @@ 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),
|
||||
"times": PackedFloat32Array(0, 0.08, 0.16, 0.27, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 1, 2, 3, 4]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("../RootMotion:position")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0, 0.08, 0.16, 0.27, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [Vector2(0, -60), Vector2(11, -75), Vector2(11, -93), Vector2(32, -111), Vector2(60, -111)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_cw2d6"]
|
||||
resource_name = "crouch idle"
|
||||
@ -409,6 +452,18 @@ tracks/3/keys = {
|
||||
"update": 1,
|
||||
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("../Sprite2D:position")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -48)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_d3wef"]
|
||||
resource_name = "jump"
|
||||
@ -526,6 +581,136 @@ tracks/4/keys = {
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_fgkxt"]
|
||||
resource_name = "reverse vault"
|
||||
length = 0.75
|
||||
step = 0.025
|
||||
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("12_viqgg")]
|
||||
}
|
||||
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": [11]
|
||||
}
|
||||
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.075, 0.15, 0.225, 0.3, 0.375, 0.45, 0.525, 0.6, 0.675),
|
||||
"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]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("../RootMotion:position")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0, 0.075, 0.225, 0.6, 0.675),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -70), Vector2(0, -70), Vector2(0, -100), Vector2(0, -94), Vector2(0, -70)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_p07f3"]
|
||||
resource_name = "roll"
|
||||
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("10_6e537")]
|
||||
}
|
||||
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": [7]
|
||||
}
|
||||
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]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("../Sprite2D:position")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -48)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_lkdrv"]
|
||||
resource_name = "run"
|
||||
length = 0.81
|
||||
@ -580,6 +765,59 @@ tracks/3/keys = {
|
||||
"values": [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_viqgg"]
|
||||
resource_name = "wallrun"
|
||||
length = 0.8
|
||||
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("11_p07f3")]
|
||||
}
|
||||
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": [16]
|
||||
}
|
||||
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.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0rnld"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_6eyey"),
|
||||
@ -591,7 +829,10 @@ _data = {
|
||||
&"idle": SubResource("Animation_bruh7"),
|
||||
&"jump": SubResource("Animation_d3wef"),
|
||||
&"ledge hang": SubResource("Animation_gv3ic"),
|
||||
&"run": SubResource("Animation_lkdrv")
|
||||
&"reverse vault": SubResource("Animation_fgkxt"),
|
||||
&"roll": SubResource("Animation_p07f3"),
|
||||
&"run": SubResource("Animation_lkdrv"),
|
||||
&"wallrun": SubResource("Animation_viqgg")
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bruh7"]
|
||||
@ -600,11 +841,13 @@ _data = {
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6eyey"]
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
[node name="Player" type="CharacterBody2D" groups=["player"]]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
script = SubResource("GDScript_khinc")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -48)
|
||||
position = Vector2(11, -60)
|
||||
texture = ExtResource("1_p0vlq")
|
||||
hframes = 10
|
||||
frame = 1
|
||||
@ -615,8 +858,17 @@ shape = SubResource("RectangleShape2D_gv3ic")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(0, -90)
|
||||
zoom = Vector2(0.6, 0.6)
|
||||
position_smoothing_enabled = true
|
||||
position_smoothing_speed = 10.0
|
||||
drag_vertical_offset = 1.0
|
||||
drag_left_margin = 0.1
|
||||
drag_top_margin = 0.1
|
||||
drag_right_margin = 0.1
|
||||
drag_bottom_margin = 0.1
|
||||
|
||||
[node name="RootMotion" type="Node" parent="."]
|
||||
[node name="RootMotion" type="Node2D" parent="."]
|
||||
position = Vector2(11, -60)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
root_node = NodePath("../Camera2D")
|
||||
@ -635,19 +887,19 @@ target_position = Vector2(0, -37)
|
||||
|
||||
[node name="wallrunrcright1" type="RayCast2D" parent="."]
|
||||
position = Vector2(0, -22)
|
||||
target_position = Vector2(120, 0)
|
||||
target_position = Vector2(100, 0)
|
||||
|
||||
[node name="wallrunrcright2" type="RayCast2D" parent="."]
|
||||
position = Vector2(0, -97)
|
||||
target_position = Vector2(120, 0)
|
||||
target_position = Vector2(100, 0)
|
||||
|
||||
[node name="wallrunrcleft1" type="RayCast2D" parent="."]
|
||||
position = Vector2(0, -22)
|
||||
target_position = Vector2(-120, 0)
|
||||
target_position = Vector2(-100, 0)
|
||||
|
||||
[node name="wallrunrcleft2" type="RayCast2D" parent="."]
|
||||
position = Vector2(0, -97)
|
||||
target_position = Vector2(-120, 0)
|
||||
target_position = Vector2(-100, 0)
|
||||
|
||||
[node name="wallcheckleft" type="ShapeCast2D" parent="."]
|
||||
position = Vector2(-28, -60)
|
||||
@ -724,3 +976,19 @@ metadata/_custom_type_script = "uid://c46i4062efgw1"
|
||||
[node name="PlayerClimbUp" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("21_gv3ic")
|
||||
metadata/_custom_type_script = "uid://boe7p8pcolkln"
|
||||
|
||||
[node name="PlayerRoll" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("22_b8lor")
|
||||
metadata/_custom_type_script = "uid://clru46wbu1bi1"
|
||||
|
||||
[node name="PlayerVault" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("26_fgkxt")
|
||||
metadata/_custom_type_script = "uid://dq3g3qck2e0wv"
|
||||
|
||||
[node name="PlayerDash" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("27_xsi7p")
|
||||
metadata/_custom_type_script = "uid://qf4kjhw6b8ip"
|
||||
|
||||
[node name="PlayerFallRoll" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("28_1jpwa")
|
||||
metadata/_custom_type_script = "uid://bjln8dh5ajphf"
|
||||
|
||||
@ -3,16 +3,16 @@
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_on5l8"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_on5l8"]
|
||||
size = Vector2(144, 231)
|
||||
size = Vector2(144, 230)
|
||||
|
||||
[node name="Box" type="StaticBody2D"]
|
||||
|
||||
[node name="MeshInstance2D" type="MeshInstance2D" parent="."]
|
||||
modulate = Color(0.72817, 0.433509, 0.493915, 1)
|
||||
position = Vector2(96, 39.125)
|
||||
scale = Vector2(143.5, 232.25)
|
||||
position = Vector2(96, 40.125)
|
||||
scale = Vector2(143.5, 230.25)
|
||||
mesh = SubResource("QuadMesh_on5l8")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(96, 39.5)
|
||||
position = Vector2(96, 40)
|
||||
shape = SubResource("RectangleShape2D_on5l8")
|
||||
|
||||
17
sidescroller/scenes/large_box.tscn
Normal file
17
sidescroller/scenes/large_box.tscn
Normal file
@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b8jkjejwkvr6w"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_4wyf3"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_k0juu"]
|
||||
size = Vector2(146, 368)
|
||||
|
||||
[node name="large box" type="StaticBody2D"]
|
||||
|
||||
[node name="MeshInstance2D" type="MeshInstance2D" parent="."]
|
||||
position = Vector2(3509, 93)
|
||||
scale = Vector2(146, 368)
|
||||
mesh = SubResource("QuadMesh_4wyf3")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(3509, 93)
|
||||
shape = SubResource("RectangleShape2D_k0juu")
|
||||
42
sidescroller/scenes/obstacle.tscn
Normal file
42
sidescroller/scenes/obstacle.tscn
Normal file
@ -0,0 +1,42 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://ctw5n2m0kj374"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b8ewx8kbbdns1" path="res://scripts/obstacle.gd" id="1_7ukg5"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_71j4m"]
|
||||
size = Vector2(76, 72)
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_71j4m"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7ukg5"]
|
||||
size = Vector2(71, 20)
|
||||
|
||||
[node name="Obstacle" type="StaticBody2D"]
|
||||
script = ExtResource("1_7ukg5")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -36)
|
||||
shape = SubResource("RectangleShape2D_71j4m")
|
||||
|
||||
[node name="MeshInstance2D" type="MeshInstance2D" parent="."]
|
||||
modulate = Color(0.204699, 0.452404, 0.537435, 1)
|
||||
position = Vector2(0, -36.543)
|
||||
scale = Vector2(-76.1197, 73.0578)
|
||||
mesh = SubResource("QuadMesh_71j4m")
|
||||
|
||||
[node name="triggerzone_left" type="Area2D" parent="."]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="triggerzone_left_cs" type="CollisionShape2D" parent="triggerzone_left"]
|
||||
position = Vector2(-190, -10)
|
||||
scale = Vector2(0.5, 1)
|
||||
shape = SubResource("RectangleShape2D_7ukg5")
|
||||
|
||||
[node name="triggerzone_right" type="Area2D" parent="."]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="triggerzone_right_cs" type="CollisionShape2D" parent="triggerzone_right"]
|
||||
position = Vector2(190, -10)
|
||||
scale = Vector2(0.5, 1)
|
||||
shape = SubResource("RectangleShape2D_7ukg5")
|
||||
17
sidescroller/scenes/platform.tscn
Normal file
17
sidescroller/scenes/platform.tscn
Normal file
@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bwakdn8hnjoq4"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_go701"]
|
||||
size = Vector2(1000, 100)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_go701"]
|
||||
size = Vector2(1001, 98)
|
||||
|
||||
[node name="Platform" type="StaticBody2D"]
|
||||
|
||||
[node name="MeshInstance2D" type="MeshInstance2D" parent="."]
|
||||
position = Vector2(-35, 194)
|
||||
mesh = SubResource("QuadMesh_go701")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-35.5, 194)
|
||||
shape = SubResource("RectangleShape2D_go701")
|
||||
@ -1,66 +1,77 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://21dnwl0rfjcd"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://21dnwl0rfjcd"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c3w3n7ysd02bd" path="res://scenes/Player.tscn" id="1_go701"]
|
||||
[ext_resource type="Script" uid="uid://d2jx8gdq5o5d7" path="res://scripts/player.gd" id="2_5a7ea"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnaknh1h8isk0" path="res://scenes/box.tscn" id="3_4wyf3"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_go701"]
|
||||
size = Vector2(1000, 100)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_go701"]
|
||||
size = Vector2(1001, 98)
|
||||
[ext_resource type="PackedScene" uid="uid://bwakdn8hnjoq4" path="res://scenes/platform.tscn" id="3_71j4m"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8jkjejwkvr6w" path="res://scenes/large_box.tscn" id="5_qfnet"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctw5n2m0kj374" path="res://scenes/obstacle.tscn" id="6_qfnet"]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
position = Vector2(589, 149)
|
||||
script = ExtResource("2_5a7ea")
|
||||
speed = 350
|
||||
speed = 400
|
||||
grav = 40
|
||||
fallgrav = 60
|
||||
jump_force = 800
|
||||
fallvelocity_cap = 1000
|
||||
fallvelocity_cap = 1500
|
||||
max_air_jumps = 1
|
||||
sprint_mult = 1.5
|
||||
crouch_mult = 0.4
|
||||
roll_mult = 1.5
|
||||
jump_mult = 1.3
|
||||
|
||||
[node name="Platform" type="StaticBody2D" parent="."]
|
||||
position = Vector2(604, 135)
|
||||
[node name="Platform" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(597, 130)
|
||||
|
||||
[node name="MeshInstance2D" type="MeshInstance2D" parent="Platform"]
|
||||
position = Vector2(-35, 194)
|
||||
mesh = SubResource("QuadMesh_go701")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Platform"]
|
||||
position = Vector2(-35.5, 194)
|
||||
shape = SubResource("RectangleShape2D_go701")
|
||||
|
||||
[node name="Platform2" type="StaticBody2D" parent="."]
|
||||
position = Vector2(2118, 133)
|
||||
|
||||
[node name="MeshInstance2D" type="MeshInstance2D" parent="Platform2"]
|
||||
position = Vector2(-35, 194)
|
||||
mesh = SubResource("QuadMesh_go701")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Platform2"]
|
||||
position = Vector2(-35.5, 194)
|
||||
shape = SubResource("RectangleShape2D_go701")
|
||||
|
||||
[node name="Platform3" type="StaticBody2D" parent="."]
|
||||
position = Vector2(1385, 233)
|
||||
|
||||
[node name="MeshInstance2D" type="MeshInstance2D" parent="Platform3"]
|
||||
position = Vector2(-35, 194)
|
||||
mesh = SubResource("QuadMesh_go701")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Platform3"]
|
||||
position = Vector2(-35.5, 194)
|
||||
shape = SubResource("RectangleShape2D_go701")
|
||||
[node name="Platform2" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(1402, 228)
|
||||
|
||||
[node name="Box" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(1808, 48)
|
||||
|
||||
[node name="Box2" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(2500, 121)
|
||||
position = Vector2(2498, 122)
|
||||
|
||||
[node name="Box3" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(2500, -108)
|
||||
position = Vector2(-1738, -53)
|
||||
|
||||
[node name="large box" parent="." instance=ExtResource("5_qfnet")]
|
||||
|
||||
[node name="Platform3" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(2117, 130)
|
||||
|
||||
[node name="Platform4" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(3117, 130)
|
||||
|
||||
[node name="Platform5" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(4111, 130)
|
||||
|
||||
[node name="Platform6" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(5099, 130)
|
||||
|
||||
[node name="Obstacle" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(4493, 274)
|
||||
|
||||
[node name="Obstacle2" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1124, 274)
|
||||
|
||||
[node name="Obstacle3" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1675, 274)
|
||||
|
||||
[node name="Platform7" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-913, 130)
|
||||
|
||||
[node name="Platform8" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-1916, 130)
|
||||
|
||||
[node name="Platform9" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-107, 1004)
|
||||
|
||||
[node name="Box4" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-665, 994)
|
||||
|
||||
[node name="Box5" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-2443, 123)
|
||||
|
||||
74
sidescroller/scenes/world.tscn29144192732.tmp
Normal file
74
sidescroller/scenes/world.tscn29144192732.tmp
Normal file
@ -0,0 +1,74 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://21dnwl0rfjcd"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c3w3n7ysd02bd" path="res://scenes/Player.tscn" id="1_go701"]
|
||||
[ext_resource type="Script" uid="uid://d2jx8gdq5o5d7" path="res://scripts/player.gd" id="2_5a7ea"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnaknh1h8isk0" path="res://scenes/box.tscn" id="3_4wyf3"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwakdn8hnjoq4" path="res://scenes/platform.tscn" id="3_71j4m"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8jkjejwkvr6w" path="res://scenes/large_box.tscn" id="5_qfnet"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctw5n2m0kj374" path="res://scenes/obstacle.tscn" id="6_qfnet"]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
position = Vector2(589, 149)
|
||||
script = ExtResource("2_5a7ea")
|
||||
speed = 400
|
||||
grav = 40
|
||||
fallgrav = 60
|
||||
jump_force = 800
|
||||
fallvelocity_cap = 1500
|
||||
max_air_jumps = 1
|
||||
sprint_mult = 1.5
|
||||
crouch_mult = 0.4
|
||||
roll_mult = 1.5
|
||||
jump_mult = 1.3
|
||||
|
||||
[node name="Platform" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(597, 130)
|
||||
|
||||
[node name="Platform2" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(1402, 228)
|
||||
|
||||
[node name="Box" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(1808, 48)
|
||||
|
||||
[node name="Box2" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(2498, 122)
|
||||
|
||||
[node name="Box3" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-1770, -23)
|
||||
|
||||
[node name="large box" parent="." instance=ExtResource("5_qfnet")]
|
||||
|
||||
[node name="Platform3" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(2117, 130)
|
||||
|
||||
[node name="Platform4" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(3117, 130)
|
||||
|
||||
[node name="Platform5" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(4111, 130)
|
||||
|
||||
[node name="Platform6" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(5099, 130)
|
||||
|
||||
[node name="Obstacle" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(4493, 274)
|
||||
|
||||
[node name="Obstacle2" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1124, 274)
|
||||
|
||||
[node name="Obstacle3" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1675, 274)
|
||||
|
||||
[node name="Platform7" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-913, 130)
|
||||
|
||||
[node name="Platform8" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-1912, 130)
|
||||
|
||||
[node name="Platform9" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-107, 1004)
|
||||
|
||||
[node name="Box4" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-665, 994)
|
||||
74
sidescroller/scenes/world.tscn29150253813.tmp
Normal file
74
sidescroller/scenes/world.tscn29150253813.tmp
Normal file
@ -0,0 +1,74 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://21dnwl0rfjcd"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c3w3n7ysd02bd" path="res://scenes/Player.tscn" id="1_go701"]
|
||||
[ext_resource type="Script" uid="uid://d2jx8gdq5o5d7" path="res://scripts/player.gd" id="2_5a7ea"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnaknh1h8isk0" path="res://scenes/box.tscn" id="3_4wyf3"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwakdn8hnjoq4" path="res://scenes/platform.tscn" id="3_71j4m"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8jkjejwkvr6w" path="res://scenes/large_box.tscn" id="5_qfnet"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctw5n2m0kj374" path="res://scenes/obstacle.tscn" id="6_qfnet"]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
position = Vector2(589, 149)
|
||||
script = ExtResource("2_5a7ea")
|
||||
speed = 400
|
||||
grav = 40
|
||||
fallgrav = 60
|
||||
jump_force = 800
|
||||
fallvelocity_cap = 1500
|
||||
max_air_jumps = 1
|
||||
sprint_mult = 1.5
|
||||
crouch_mult = 0.4
|
||||
roll_mult = 1.5
|
||||
jump_mult = 1.3
|
||||
|
||||
[node name="Platform" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(597, 130)
|
||||
|
||||
[node name="Platform2" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(1402, 228)
|
||||
|
||||
[node name="Box" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(1808, 48)
|
||||
|
||||
[node name="Box2" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(2498, 122)
|
||||
|
||||
[node name="Box3" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-1770, -23)
|
||||
|
||||
[node name="large box" parent="." instance=ExtResource("5_qfnet")]
|
||||
|
||||
[node name="Platform3" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(2117, 130)
|
||||
|
||||
[node name="Platform4" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(3117, 130)
|
||||
|
||||
[node name="Platform5" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(4111, 130)
|
||||
|
||||
[node name="Platform6" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(5099, 130)
|
||||
|
||||
[node name="Obstacle" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(4493, 274)
|
||||
|
||||
[node name="Obstacle2" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1124, 274)
|
||||
|
||||
[node name="Obstacle3" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1675, 274)
|
||||
|
||||
[node name="Platform7" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-913, 130)
|
||||
|
||||
[node name="Platform8" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-1912, 130)
|
||||
|
||||
[node name="Platform9" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-107, 1004)
|
||||
|
||||
[node name="Box4" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-665, 994)
|
||||
74
sidescroller/scenes/world.tscn3795407388.tmp
Normal file
74
sidescroller/scenes/world.tscn3795407388.tmp
Normal file
@ -0,0 +1,74 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://21dnwl0rfjcd"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c3w3n7ysd02bd" path="res://scenes/Player.tscn" id="1_go701"]
|
||||
[ext_resource type="Script" uid="uid://d2jx8gdq5o5d7" path="res://scripts/player.gd" id="2_5a7ea"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnaknh1h8isk0" path="res://scenes/box.tscn" id="3_4wyf3"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwakdn8hnjoq4" path="res://scenes/platform.tscn" id="3_71j4m"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8jkjejwkvr6w" path="res://scenes/large_box.tscn" id="5_qfnet"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctw5n2m0kj374" path="res://scenes/obstacle.tscn" id="6_qfnet"]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
position = Vector2(589, 149)
|
||||
script = ExtResource("2_5a7ea")
|
||||
speed = 400
|
||||
grav = 40
|
||||
fallgrav = 60
|
||||
jump_force = 800
|
||||
fallvelocity_cap = 1500
|
||||
max_air_jumps = 1
|
||||
sprint_mult = 1.5
|
||||
crouch_mult = 0.4
|
||||
roll_mult = 1.5
|
||||
jump_mult = 1.3
|
||||
|
||||
[node name="Platform" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(597, 130)
|
||||
|
||||
[node name="Platform2" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(1402, 228)
|
||||
|
||||
[node name="Box" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(1808, 48)
|
||||
|
||||
[node name="Box2" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(2498, 122)
|
||||
|
||||
[node name="Box3" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-1771, -25)
|
||||
|
||||
[node name="large box" parent="." instance=ExtResource("5_qfnet")]
|
||||
|
||||
[node name="Platform3" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(2117, 130)
|
||||
|
||||
[node name="Platform4" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(3117, 130)
|
||||
|
||||
[node name="Platform5" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(4111, 130)
|
||||
|
||||
[node name="Platform6" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(5099, 130)
|
||||
|
||||
[node name="Obstacle" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(4493, 274)
|
||||
|
||||
[node name="Obstacle2" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1124, 274)
|
||||
|
||||
[node name="Obstacle3" parent="." instance=ExtResource("6_qfnet")]
|
||||
position = Vector2(-1675, 274)
|
||||
|
||||
[node name="Platform7" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-913, 130)
|
||||
|
||||
[node name="Platform8" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-1912, 130)
|
||||
|
||||
[node name="Platform9" parent="." instance=ExtResource("3_71j4m")]
|
||||
position = Vector2(-107, 1004)
|
||||
|
||||
[node name="Box4" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(-665, 994)
|
||||
19
sidescroller/scripts/obstacle.gd
Normal file
19
sidescroller/scripts/obstacle.gd
Normal file
@ -0,0 +1,19 @@
|
||||
extends StaticBody2D
|
||||
|
||||
func _ready():
|
||||
var player = get_tree().get_first_node_in_group("player")
|
||||
|
||||
$triggerzone_left.connect("body_entered", Callable(self, "_on_trigger_entered").bind("triggerzone_left", player))
|
||||
$triggerzone_left.connect("body_exited", Callable(self, "_on_trigger_exited").bind("triggerzone_left", player))
|
||||
|
||||
$triggerzone_right.connect("body_entered", Callable(self, "_on_trigger_entered").bind("triggerzone_right", player))
|
||||
$triggerzone_right.connect("body_exited", Callable(self, "_on_trigger_exited").bind("triggerzone_right", player))
|
||||
|
||||
|
||||
func _on_trigger_entered(body: Node, trigger_name: String, player: Node):
|
||||
if body.is_in_group("player"):
|
||||
player._on_vault_trigger_entered(trigger_name)
|
||||
|
||||
func _on_trigger_exited(body: Node, trigger_name: String, player: Node):
|
||||
if body.is_in_group("player"):
|
||||
player._on_vault_trigger_exited(trigger_name)
|
||||
1
sidescroller/scripts/obstacle.gd.uid
Normal file
1
sidescroller/scripts/obstacle.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b8ewx8kbbdns1
|
||||
@ -1,17 +1,34 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
@export var speed = 350
|
||||
#Rootmotion
|
||||
var rootmotion_prev := Vector2.ZERO
|
||||
@onready var RootMotion := $RootMotion
|
||||
@onready var mainbody := $mainbody
|
||||
|
||||
@export var speed = 400 #350 init
|
||||
@export var grav = 40
|
||||
@export var fallgrav = 60 #gravity only applied when falling
|
||||
@export var jump_force = 800
|
||||
@export var fallvelocity_cap = 1000 # How fast the player can get when falling
|
||||
@export var fallvelocity_cap = 1500 # How fast the player can get when falling
|
||||
@export var max_air_jumps = 1 # Number of total jumps allowed (1 = normal, 2 = double jump)
|
||||
|
||||
var jumps_done = 0
|
||||
var air_jumps_done = 0
|
||||
|
||||
var coyote_timer = 0.0
|
||||
var coyote_time = 0.2
|
||||
var jump_buffered := false
|
||||
var jump_buffer_timer = 0.0
|
||||
var jump_buffer_time = 0.2
|
||||
|
||||
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
|
||||
@export var roll_mult = 1.5
|
||||
@export var jump_mult = 1.3
|
||||
|
||||
@onready var ap = $AnimationPlayer
|
||||
@onready var sprite = $Sprite2D
|
||||
@ -33,46 +50,72 @@ 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 stuck_under_object = false
|
||||
|
||||
#wallrun and pushoff
|
||||
var wallrun_available := true
|
||||
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_speed := -250.0 # Geschwindigkeit nach oben (negativ wegen y-Achse)
|
||||
var wallrun_time := 0.7 # Dauer des Wallruns in Sekunden
|
||||
var wallrun_speed := -400.0 # Geschwindigkeit nach oben (negativ wegen y-Achse)
|
||||
|
||||
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_time := 0.5 # dauer des pushoffs
|
||||
|
||||
var climbup_pos1 = Vector2(0, 0)
|
||||
var climbup_pos2 = Vector2(0, 0)
|
||||
var climbup_pos1_reached = false
|
||||
#dash
|
||||
var dash_available := false
|
||||
var dash_timer := 0.0
|
||||
var dash_time := 0.2
|
||||
var dash_mult := 2
|
||||
|
||||
#climbup
|
||||
var climbup_speed_y = 100
|
||||
var climbup_speed_x = 500
|
||||
|
||||
#obstacle vault
|
||||
var can_vault := false
|
||||
var vault_direction := Vector2.ZERO
|
||||
var vault_mult := 1.3
|
||||
|
||||
#fallroll
|
||||
var fallroll_timer := 0.0
|
||||
var fallroll_input_timer := 0.0
|
||||
var fallroll_time := 0.5 #time till you need to fallroll
|
||||
var fallroll_input_time := 0.5 #timewindow in which the fallroll works
|
||||
var fallrolling := false
|
||||
var can_fallroll := true
|
||||
var fallroll_mult := 0.8 #velocity mult of fallroll differs from roll
|
||||
var land_delay_timer := 0.0
|
||||
var land_delay_time := 0.1 #time in which player will stay in falling state after hitting the ground
|
||||
|
||||
func _process(delta):
|
||||
#turnmovement()
|
||||
pass
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
|
||||
#print("jump buffered: ", jump_buffered)
|
||||
|
||||
#move_and_collide()
|
||||
move_and_slide()
|
||||
input_direction = Input.get_axis("move_left", "move_right")
|
||||
if !direction_locked:
|
||||
input_direction = Input.get_axis("move_left", "move_right")
|
||||
else:
|
||||
input_direction = facing_direction
|
||||
|
||||
#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 ["PlayerClimbUp", "PlayerVault", "PlayerDash"]:
|
||||
gravity(delta)
|
||||
|
||||
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")
|
||||
$ledgecollision.disabled = statemachine.current_state.get_state_name() in ["PlayerIdle", "PlayerRun", "PlayerCrouch", "PlayerCrouchWalk", "PlayerJump", "PlayerWallrun", "PlayerClimbUp", "PlayerRoll", "PlayerVault"] 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")
|
||||
$mainbody.disabled = statemachine.current_state.get_state_name() in ["PlayerClimbUp"]
|
||||
|
||||
func movement():
|
||||
velocity.x = speed * input_direction * v_mult + v_push
|
||||
@ -96,13 +139,7 @@ func set_facing_direction(dir: int): #manual flip
|
||||
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():
|
||||
func gravity(delta):
|
||||
velocity.y += grav
|
||||
if velocity.y > fallvelocity_cap:
|
||||
velocity.y = fallvelocity_cap
|
||||
@ -118,6 +155,42 @@ func wall_detected_left() -> bool:
|
||||
func wall_detected_right() -> bool:
|
||||
var result = wallrun_raycast_right1.is_colliding() && wallrun_raycast_right2.is_colliding()
|
||||
return result
|
||||
|
||||
func _on_vault_trigger_entered(trigger_name: String) -> void:
|
||||
print("vault trigger entered:", trigger_name)
|
||||
can_vault = true
|
||||
if trigger_name == "triggerzone_left":
|
||||
vault_direction = Vector2.RIGHT
|
||||
elif trigger_name == "triggerzone_right":
|
||||
vault_direction = Vector2.LEFT
|
||||
else:
|
||||
vault_direction = Vector2.ZERO
|
||||
|
||||
func _on_vault_trigger_exited(trigger_name: String) -> void:
|
||||
print("vault trigger exited:", trigger_name)
|
||||
can_vault = false
|
||||
vault_direction = Vector2.ZERO
|
||||
|
||||
func is_facing_vault_direction() -> bool:
|
||||
var input_dir := Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
|
||||
|
||||
# only allow vault if input matches vault_direction
|
||||
if vault_direction == Vector2.RIGHT and input_dir > 0:
|
||||
return true
|
||||
elif vault_direction == Vector2.LEFT and input_dir < 0:
|
||||
return true
|
||||
return false
|
||||
|
||||
func jumpbuffer(delta):
|
||||
|
||||
if Input.is_action_just_pressed("jump"):
|
||||
jump_buffered = true
|
||||
jump_buffer_timer = 0.0
|
||||
|
||||
if jump_buffered:
|
||||
jump_buffer_timer += delta
|
||||
if jump_buffer_timer >= jump_buffer_time:
|
||||
jump_buffered = false
|
||||
|
||||
# transition functions
|
||||
|
||||
@ -128,9 +201,13 @@ func transitionidle() -> bool:
|
||||
func transitionrun() -> bool:
|
||||
var result = Input.get_axis("move_left", "move_right") != 0 && is_on_floor()
|
||||
return result
|
||||
|
||||
|
||||
func transitioncoyotejump() -> bool:
|
||||
var result = coyote_time >= coyote_timer and Input.is_action_just_pressed("jump") and (jumps_done == 0)
|
||||
return result
|
||||
|
||||
func transitionjump() -> bool:
|
||||
var result = Input.is_action_just_pressed("jump") && is_on_floor()
|
||||
var result = (Input.is_action_just_pressed("jump") or jump_buffered) and is_on_floor()
|
||||
return result
|
||||
|
||||
func transitiondoublejump() -> bool:
|
||||
@ -157,3 +234,13 @@ func transitionwallrun() -> bool:
|
||||
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
|
||||
return result
|
||||
|
||||
func transitionroll() -> bool:
|
||||
var result = Input.is_action_just_pressed("sprint") and is_on_floor()
|
||||
return result
|
||||
|
||||
#func transitionfallroll() -> bool:
|
||||
#func transitionhardlanding() -> bool:
|
||||
|
||||
func transitiondash() -> bool:
|
||||
var result = Input.is_action_just_pressed("sprint") and !is_on_floor() and dash_available and fallroll_timer < fallroll_time
|
||||
return result
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
extends State
|
||||
class_name AccelDecel
|
||||
|
||||
@export var acceleration = 2000
|
||||
@export var deceleration = 1500
|
||||
|
||||
func movement(velocity_x, speed, input_direction, v_mult, v_push, delta):
|
||||
var target_speed = speed * input_direction * v_mult + v_push
|
||||
if input_direction != 0:
|
||||
return move_toward(velocity_x, target_speed, acceleration * delta)
|
||||
return move_toward(velocity_x, 0, deceleration * delta)
|
||||
|
||||
func turnmovement(velocity_x, speed, input_direction, v_mult, v_push, delta, direction_locked, facing_direction):
|
||||
var vx = movement(velocity_x, speed, input_direction, v_mult, v_push, delta)
|
||||
var fd = facing_direction
|
||||
if not direction_locked and input_direction != 0 and sign(input_direction) != facing_direction:
|
||||
fd = sign(input_direction)
|
||||
return [vx, fd]
|
||||
@ -1 +0,0 @@
|
||||
uid://cst40h14xfhjk
|
||||
@ -9,38 +9,57 @@ 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.ap.playback_process_mode = AnimationPlayer.ANIMATION_PROCESS_MANUAL #rootmotion
|
||||
var root_node := player.get_node("RootMotion") #rootmotion
|
||||
|
||||
player.rootmotion_prev = root_node.position #rootmotion
|
||||
|
||||
player.sprite.position.x = player.facing_direction * 11
|
||||
player.sprite.position.y = -60
|
||||
|
||||
player.cshape.shape = ledge_cshape
|
||||
player.cshape.position.y = -69
|
||||
|
||||
player.z_index = 10
|
||||
|
||||
func exit():
|
||||
player.cshape.shape = standing_cshape
|
||||
player.cshape.position.y = -43
|
||||
player.ap.playback_process_mode = AnimationPlayer.ANIMATION_PROCESS_IDLE #rootmotion
|
||||
player.RootMotion.position = Vector2(11, -60) #rootmotion
|
||||
player.rootmotion_prev = Vector2(11, -60) #rootmotion
|
||||
|
||||
player.sprite.position.x = 0
|
||||
player.sprite.position.y = -48
|
||||
|
||||
player.climbup_pos1_reached = false
|
||||
player.cshape.shape = standing_cshape
|
||||
player.cshape.position.y = -43
|
||||
|
||||
player.z_index = 0
|
||||
|
||||
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")
|
||||
player.jumpbuffer(delta)
|
||||
|
||||
player.ap.advance(delta)
|
||||
|
||||
var current_root_pos = player.RootMotion.position #rootmotion
|
||||
var root_delta = current_root_pos - player.rootmotion_prev #rootmotion
|
||||
|
||||
player.position += Vector2(root_delta.x * player.facing_direction, root_delta.y)
|
||||
player.rootmotion_prev = current_root_pos #rootmotion
|
||||
|
||||
if not player.ap.is_playing():
|
||||
Transitioned.emit(self, "PlayerFall")
|
||||
|
||||
#ursprüngliches manuelles bewegen des players während dem Climb up:
|
||||
#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")
|
||||
|
||||
@ -13,7 +13,7 @@ func enter():
|
||||
|
||||
func exit():
|
||||
player.cshape.shape = standing_cshape
|
||||
player.cshape.position.y = -44
|
||||
player.cshape.position.y = -43
|
||||
|
||||
func update(delta):
|
||||
|
||||
|
||||
25
sidescroller/scripts/playerdash.gd
Normal file
25
sidescroller/scripts/playerdash.gd
Normal file
@ -0,0 +1,25 @@
|
||||
extends State
|
||||
class_name PlayerDash
|
||||
|
||||
func get_state_name():
|
||||
return str(self).split(":")[0]
|
||||
|
||||
func enter():
|
||||
player.dash_available = false
|
||||
player.direction_locked = true
|
||||
player.v_mult = player.dash_mult
|
||||
player.velocity.y = 0
|
||||
|
||||
func exit():
|
||||
player.direction_locked = false
|
||||
player.v_mult = 1
|
||||
player.dash_timer = 0
|
||||
|
||||
func update(delta):
|
||||
pass
|
||||
|
||||
func physics_update(delta):
|
||||
player.dash_timer += delta
|
||||
|
||||
if player.dash_timer >= player.dash_time:
|
||||
Transitioned.emit(self, "PlayerFall")
|
||||
1
sidescroller/scripts/playerdash.gd.uid
Normal file
1
sidescroller/scripts/playerdash.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://qf4kjhw6b8ip
|
||||
@ -19,6 +19,8 @@ func update(delta):
|
||||
Transitioned.emit(self, "PlayerDoubleJump")
|
||||
elif player.is_on_floor() && player.velocity.x != 0:
|
||||
Transitioned.emit(self, "PlayerRun")
|
||||
elif player.transitiondash():
|
||||
Transitioned.emit(self, "PlayerDash")
|
||||
elif player.is_on_floor():
|
||||
Transitioned.emit(self, "PlayerIdle")
|
||||
|
||||
|
||||
@ -1,30 +1,65 @@
|
||||
extends State
|
||||
class_name PlayerFall
|
||||
|
||||
var initgrav = 0
|
||||
|
||||
func get_state_name():
|
||||
return str(self).split(":")[0]
|
||||
|
||||
func enter():
|
||||
pass
|
||||
initgrav = player.grav
|
||||
player.grav = player.fallgrav
|
||||
|
||||
func exit():
|
||||
pass
|
||||
player.grav = initgrav
|
||||
player.fallroll_timer = 0.0
|
||||
player.fallroll_input_timer = 0.0
|
||||
player.land_delay_timer = 0.0
|
||||
player.can_fallroll = true
|
||||
player.fallrolling = false
|
||||
player.jump_buffered = false
|
||||
|
||||
func update(delta):
|
||||
player.ap.play("fall")
|
||||
|
||||
player.coyote_timer += delta
|
||||
|
||||
fallrollcheck(delta)
|
||||
|
||||
player.jumpbuffer(delta)
|
||||
|
||||
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()
|
||||
|
||||
if player.fallroll_timer <= player.fallroll_time or player.land_delay_timer >= player.land_delay_time:
|
||||
if player.transitioncoyotejump() or player.transitionjump():
|
||||
Transitioned.emit(self, "PlayerJump")
|
||||
elif player.transitiondoublejump():
|
||||
Transitioned.emit(self, "PlayerDoubleJump")
|
||||
elif player.is_on_floor() and player.fallroll_timer >= player.fallroll_time and player.fallrolling:
|
||||
print("fallroll")
|
||||
Transitioned.emit(self, "PlayerFallRoll") #ersetzen durch state: PlayerFallRoll
|
||||
elif player.transitionidle():
|
||||
Transitioned.emit(self, "PlayerIdle")
|
||||
elif player.transitionrun():
|
||||
Transitioned.emit(self, "PlayerRun")
|
||||
#elif player.transitiondash():
|
||||
#Transitioned.emit(self, "PlayerDash")
|
||||
|
||||
func physics_update(delta):
|
||||
pass
|
||||
#player.turnmovement()
|
||||
|
||||
func fallrollcheck(delta):
|
||||
player.fallroll_timer += delta
|
||||
|
||||
if Input.is_action_just_pressed("sprint") and player.can_fallroll:
|
||||
player.fallrolling = true
|
||||
player.can_fallroll = false
|
||||
|
||||
if player.fallrolling == true:
|
||||
player.fallroll_input_timer += delta
|
||||
if player.fallroll_input_timer >= player.fallroll_input_time:
|
||||
player.fallrolling = false
|
||||
|
||||
if player.is_on_floor():
|
||||
player.land_delay_timer += delta
|
||||
|
||||
29
sidescroller/scripts/playerfallroll.gd
Normal file
29
sidescroller/scripts/playerfallroll.gd
Normal file
@ -0,0 +1,29 @@
|
||||
extends State
|
||||
class_name PlayerFallRoll
|
||||
|
||||
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.ap.play("roll")
|
||||
player.direction_locked = true
|
||||
|
||||
player.cshape.shape = crouching_cshape
|
||||
player.cshape.position.y = -31
|
||||
player.v_mult = player.fallroll_mult
|
||||
|
||||
func exit():
|
||||
player.cshape.shape = standing_cshape
|
||||
player.cshape.position.y = -44
|
||||
player.v_mult = 1
|
||||
player.direction_locked = false
|
||||
|
||||
func update(delta):
|
||||
pass
|
||||
|
||||
func physics_update(delta):
|
||||
if not player.ap.is_playing():
|
||||
Transitioned.emit(self, "PlayerCrouch")
|
||||
1
sidescroller/scripts/playerfallroll.gd.uid
Normal file
1
sidescroller/scripts/playerfallroll.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bjln8dh5ajphf
|
||||
@ -6,7 +6,10 @@ func get_state_name():
|
||||
|
||||
func enter():
|
||||
player.air_jumps_done = 0
|
||||
player.jumps_done = 0
|
||||
player.coyote_timer = 0.0
|
||||
player.wallrun_available = true
|
||||
player.dash_available = true
|
||||
|
||||
func exit():
|
||||
pass
|
||||
@ -24,4 +27,4 @@ func update(delta):
|
||||
Transitioned.emit(self, "PlayerJump")
|
||||
|
||||
func physics_update(delta):
|
||||
player.gravity()
|
||||
player.gravity(delta)
|
||||
|
||||
@ -7,12 +7,20 @@ func get_state_name():
|
||||
func enter():
|
||||
player.ap.play("jump")
|
||||
player.velocity.y = -player.jump_force
|
||||
player.jumps_done += 1
|
||||
player.v_mult = player.jump_mult
|
||||
|
||||
func exit():
|
||||
pass
|
||||
player.v_mult = 1
|
||||
|
||||
func update(delta):
|
||||
|
||||
player.jumpbuffer(delta)
|
||||
|
||||
if player.transitionledgegrab():
|
||||
Transitioned.emit(self, "PlayerLedgeGrab")
|
||||
elif player.transitiondash():
|
||||
Transitioned.emit(self, "PlayerDash")
|
||||
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):
|
||||
|
||||
29
sidescroller/scripts/playerroll.gd
Normal file
29
sidescroller/scripts/playerroll.gd
Normal file
@ -0,0 +1,29 @@
|
||||
extends State
|
||||
class_name PlayerRoll
|
||||
|
||||
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.ap.play("roll")
|
||||
player.direction_locked = true
|
||||
|
||||
player.cshape.shape = crouching_cshape
|
||||
player.cshape.position.y = -31
|
||||
player.v_mult = player.roll_mult
|
||||
|
||||
func exit():
|
||||
player.cshape.shape = standing_cshape
|
||||
player.cshape.position.y = -44
|
||||
player.v_mult = 1
|
||||
player.direction_locked = false
|
||||
|
||||
func update(delta):
|
||||
pass
|
||||
|
||||
func physics_update(delta):
|
||||
if not player.ap.is_playing():
|
||||
Transitioned.emit(self, "PlayerCrouch")
|
||||
1
sidescroller/scripts/playerroll.gd.uid
Normal file
1
sidescroller/scripts/playerroll.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://clru46wbu1bi1
|
||||
@ -6,7 +6,10 @@ func get_state_name():
|
||||
|
||||
func enter():
|
||||
player.air_jumps_done = 0
|
||||
player.jumps_done = 0
|
||||
player.coyote_timer = 0.0
|
||||
player.wallrun_available = true
|
||||
player.dash_available = true
|
||||
player.v_mult = 1
|
||||
func exit():
|
||||
pass
|
||||
@ -15,10 +18,15 @@ func update(delta):
|
||||
|
||||
if player.transitionidle():
|
||||
Transitioned.emit(self, "PlayerIdle")
|
||||
elif player.transitionroll():
|
||||
Transitioned.emit(self, "PlayerRoll")
|
||||
elif player.transitioncrouch():
|
||||
Transitioned.emit(self, "PlayerCrouchwalk")
|
||||
elif player.transitionwallrun():
|
||||
Transitioned.emit(self, "PlayerWallrun")
|
||||
elif Input.is_action_just_pressed("jump") and player.can_vault and player.is_facing_vault_direction():
|
||||
Transitioned.emit(self, "PlayerVault")
|
||||
Transitioned.emit(self, "PlayerVault")
|
||||
elif player.transitionjump():
|
||||
Transitioned.emit(self, "PlayerJump")
|
||||
elif player.transitionfall():
|
||||
|
||||
58
sidescroller/scripts/playervault.gd
Normal file
58
sidescroller/scripts/playervault.gd
Normal file
@ -0,0 +1,58 @@
|
||||
extends State
|
||||
class_name PlayerVault
|
||||
|
||||
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.direction_locked = true
|
||||
#player.cshape.shape = crouching_cshape
|
||||
#player.cshape.position.y = -74
|
||||
|
||||
player.ap.play("reverse vault")
|
||||
|
||||
player.v_mult = player.vault_mult
|
||||
|
||||
player.ap.playback_process_mode = AnimationPlayer.ANIMATION_PROCESS_MANUAL #rootmotion
|
||||
var root_node := player.get_node("RootMotion") #rootmotion
|
||||
|
||||
player.rootmotion_prev = root_node.position #rootmotion
|
||||
|
||||
#player.z_index = 10
|
||||
func exit():
|
||||
player.direction_locked = false
|
||||
player.cshape.shape = standing_cshape
|
||||
player.cshape.position.y = -43
|
||||
player.sprite.position.y = -48
|
||||
|
||||
player.v_mult = 1
|
||||
|
||||
player.ap.playback_process_mode = AnimationPlayer.ANIMATION_PROCESS_IDLE #rootmotion
|
||||
player.RootMotion.position = Vector2(11, -60) #rootmotion
|
||||
player.rootmotion_prev = Vector2(11, -60) #rootmotion
|
||||
|
||||
#player.z_index = 0
|
||||
func update(delta):
|
||||
|
||||
if player.wallcheckleft.is_colliding() or player.wallcheckright.is_colliding():
|
||||
player.cshape.shape = crouching_cshape
|
||||
player.cshape.position.y = -66
|
||||
player.sprite.position.y = -42
|
||||
else:
|
||||
player.cshape.shape = standing_cshape
|
||||
player.cshape.position.y = -30
|
||||
player.sprite.position.y = -44
|
||||
|
||||
player.ap.advance(delta)
|
||||
|
||||
var current_root_pos = player.RootMotion.position #rootmotion
|
||||
var root_delta = current_root_pos - player.rootmotion_prev #rootmotion
|
||||
|
||||
player.position += Vector2(root_delta.x * player.facing_direction, root_delta.y)
|
||||
player.rootmotion_prev = current_root_pos #rootmotion
|
||||
func physics_update(delta):
|
||||
if not player.ap.is_playing():
|
||||
Transitioned.emit(self, "PlayerFall")
|
||||
1
sidescroller/scripts/playervault.gd.uid
Normal file
1
sidescroller/scripts/playervault.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://dq3g3qck2e0wv
|
||||
@ -9,8 +9,13 @@ func enter():
|
||||
|
||||
player.velocity.x = 2000 * player.facing_direction # An Wand haften
|
||||
|
||||
player.ap.play("wallrun")
|
||||
player.sprite.position.x = player.facing_direction * -10
|
||||
|
||||
func exit():
|
||||
player.wallrun_timer = 0.0
|
||||
player.sprite.position.x = 0
|
||||
player.velocity.y = 0
|
||||
|
||||
func update(delta):
|
||||
pass
|
||||
@ -21,7 +26,7 @@ func physics_update(delta):
|
||||
|
||||
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():
|
||||
elif 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")
|
||||
|
||||
Reference in New Issue
Block a user