Basic Projektdateien
4
sidescroller/.editorconfig
Normal file
@ -0,0 +1,4 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
2
sidescroller/.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
3
sidescroller/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
/android/
|
||||
BIN
sidescroller/assets/textures/360x360 idle 4.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
34
sidescroller/assets/textures/360x360 idle 4.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c2vs4ssjqtd2i"
|
||||
path="res://.godot/imported/360x360 idle 4.png-6f340b4285f1ced246665e4a52a5b3e6.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"]
|
||||
|
||||
[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 Crouch-Idle 144x144.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://co5l6328i3y76"
|
||||
path="res://.godot/imported/Player Crouch-Idle 144x144.png-8bb58e8325f4327962c29b68b7d698ef.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/Player Crouch-Idle 144x144.png"
|
||||
dest_files=["res://.godot/imported/Player Crouch-Idle 144x144.png-8bb58e8325f4327962c29b68b7d698ef.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 Idle 144x144.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
34
sidescroller/assets/textures/Player Idle 144x144.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c1my4xbvhsdq8"
|
||||
path="res://.godot/imported/Player Idle 144x144.png-3347334270aeebf54a15245eeec485a5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/Player Idle 144x144.png"
|
||||
dest_files=["res://.godot/imported/Player Idle 144x144.png-3347334270aeebf54a15245eeec485a5.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 air spin 144x144.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dletf8p3wr4n4"
|
||||
path="res://.godot/imported/player air spin 144x144.png-154eb3e2272f4705408bc408cfbdc00c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/player air spin 144x144.png"
|
||||
dest_files=["res://.godot/imported/player air spin 144x144.png-154eb3e2272f4705408bc408cfbdc00c.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 crouch-walk 144x144.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cox74najv0828"
|
||||
path="res://.godot/imported/player crouch-walk 144x144.png-b3233c7c993219b2d16a671bf8f882a8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/player crouch-walk 144x144.png"
|
||||
dest_files=["res://.godot/imported/player crouch-walk 144x144.png-b3233c7c993219b2d16a671bf8f882a8.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 fall 144x144.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
34
sidescroller/assets/textures/player fall 144x144.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dvy7cws4egkmh"
|
||||
path="res://.godot/imported/player fall 144x144.png-f693c452f4368db049be18c7616d7863.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/player fall 144x144.png"
|
||||
dest_files=["res://.godot/imported/player fall 144x144.png-f693c452f4368db049be18c7616d7863.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 new jump 144x144.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://crkx6pt8e4cmc"
|
||||
path="res://.godot/imported/player new jump 144x144.png-fc8c1e8ae2efcaf0c0c9a0de9b7b7199.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/player new jump 144x144.png"
|
||||
dest_files=["res://.godot/imported/player new jump 144x144.png-fc8c1e8ae2efcaf0c0c9a0de9b7b7199.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 run 144x144.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
34
sidescroller/assets/textures/player run 144x144.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d11goqqiewsdg"
|
||||
path="res://.godot/imported/player run 144x144.png-fc5c22f92bafdf1438f84397fd2bc8a2.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/player run 144x144.png"
|
||||
dest_files=["res://.godot/imported/player run 144x144.png-fc5c22f92bafdf1438f84397fd2bc8a2.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
|
||||
1
sidescroller/icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||
|
After Width: | Height: | Size: 994 B |
37
sidescroller/icon.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://nfa8op27ovg1"
|
||||
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.svg"
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
52
sidescroller/project.godot
Normal file
@ -0,0 +1,52 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Sidescroller"
|
||||
run/main_scene="uid://21dnwl0rfjcd"
|
||||
config/features=PackedStringArray("4.4", "Mobile")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=640
|
||||
window/size/viewport_height=360
|
||||
window/size/window_width_override=1280
|
||||
window/size/window_height_override=720
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[input]
|
||||
|
||||
jump={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_left={
|
||||
"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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_right={
|
||||
"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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
crouch={
|
||||
"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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
renderer/rendering_method="mobile"
|
||||
BIN
sidescroller/resources/360x360 idle 4.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
34
sidescroller/resources/360x360 idle 4.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dee2owliuw21p"
|
||||
path="res://.godot/imported/360x360 idle 4.png-117ef8683eb12d17036155a97c6705d5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/360x360 idle 4.png"
|
||||
dest_files=["res://.godot/imported/360x360 idle 4.png-117ef8683eb12d17036155a97c6705d5.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
|
||||
4
sidescroller/resources/player crouching cshape.tres
Normal file
@ -0,0 +1,4 @@
|
||||
[gd_resource type="RectangleShape2D" format=3 uid="uid://xplr3bgjsfor"]
|
||||
|
||||
[resource]
|
||||
size = Vector2(58, 62)
|
||||
4
sidescroller/resources/player standing cshape.tres
Normal file
@ -0,0 +1,4 @@
|
||||
[gd_resource type="RectangleShape2D" format=3 uid="uid://bsdsjlbi8h6cf"]
|
||||
|
||||
[resource]
|
||||
size = Vector2(58, 86.5)
|
||||
513
sidescroller/scenes/Player.tscn
Normal file
@ -0,0 +1,513 @@
|
||||
[gd_scene load_steps=21 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"]
|
||||
|
||||
[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")
|
||||
18
sidescroller/scenes/box.tscn
Normal file
@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bnaknh1h8isk0"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_on5l8"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_on5l8"]
|
||||
size = Vector2(144, 231)
|
||||
|
||||
[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)
|
||||
mesh = SubResource("QuadMesh_on5l8")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(96, 39.5)
|
||||
shape = SubResource("RectangleShape2D_on5l8")
|
||||
19
sidescroller/scenes/character.tscn
Normal file
@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://delsecj4na672"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://nfa8op27ovg1" path="res://icon.svg" id="1_lkv7d"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ushfy"]
|
||||
size = Vector2(63, 125)
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0.5, -66.5)
|
||||
shape = SubResource("RectangleShape2D_ushfy")
|
||||
|
||||
[node name="Icon" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -66)
|
||||
scale = Vector2(0.515625, 1)
|
||||
texture = ExtResource("1_lkv7d")
|
||||
66
sidescroller/scenes/world.tscn
Normal file
@ -0,0 +1,66 @@
|
||||
[gd_scene load_steps=6 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)
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
position = Vector2(601, 137)
|
||||
script = ExtResource("2_5a7ea")
|
||||
speed = 350
|
||||
gravity = 40
|
||||
jump_force = 800
|
||||
fallvelocity_cap = 1000
|
||||
max_air_jumps = 1
|
||||
crouch_mult = 1
|
||||
sprint_mult = 1
|
||||
|
||||
[node name="Platform" type="StaticBody2D" parent="."]
|
||||
position = Vector2(604, 135)
|
||||
|
||||
[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="Box" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(1808, 48)
|
||||
|
||||
[node name="Box2" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(2500, 121)
|
||||
|
||||
[node name="Box3" parent="." instance=ExtResource("3_4wyf3")]
|
||||
position = Vector2(2500, -108)
|
||||
11
sidescroller/scenes/world.tscn1658547053.tmp
Normal file
@ -0,0 +1,11 @@
|
||||
[gd_scene load_steps=3 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"]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
script = ExtResource("2_5a7ea")
|
||||
speed = null
|
||||
gravity = null
|
||||
9
sidescroller/scenes/world.tscn1742165030.tmp
Normal file
@ -0,0 +1,9 @@
|
||||
[gd_scene load_steps=3 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"]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
script = ExtResource("2_5a7ea")
|
||||
32
sidescroller/scenes/world.tscn5787324462.tmp
Normal file
@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=5 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"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_go701"]
|
||||
size = Vector2(1000, 100)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_go701"]
|
||||
size = Vector2(1001, 98)
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
position = Vector2(601, 137)
|
||||
script = ExtResource("2_5a7ea")
|
||||
speed = null
|
||||
gravity = null
|
||||
jump_force = null
|
||||
fallvelocity_cap = null
|
||||
max_air_jumps = null
|
||||
|
||||
[node name="Platform" type="StaticBody2D" parent="."]
|
||||
position = Vector2(604, 135)
|
||||
|
||||
[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")
|
||||
27
sidescroller/scenes/world.tscn5829515682.tmp
Normal file
@ -0,0 +1,27 @@
|
||||
[gd_scene load_steps=5 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"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_go701"]
|
||||
size = Vector2(1000, 100)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_go701"]
|
||||
size = Vector2(1001, 98)
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_go701")]
|
||||
position = Vector2(601, 137)
|
||||
script = ExtResource("2_5a7ea")
|
||||
|
||||
[node name="Platform" type="StaticBody2D" parent="."]
|
||||
position = Vector2(604, 135)
|
||||
|
||||
[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")
|
||||
183
sidescroller/scripts/player.gd
Normal file
@ -0,0 +1,183 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
@export var speed = 350
|
||||
@export var gravity = 40
|
||||
@export var jump_force = 800
|
||||
@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 crouch_mult = 1
|
||||
@export var sprint_mult = 1
|
||||
|
||||
@onready var ap = $AnimationPlayer
|
||||
@onready var sprite = $Sprite2D
|
||||
@onready var cshape = $mainbody
|
||||
@onready var crouch_raycast1 = $crouchrc1
|
||||
@onready var crouch_raycast2 = $crouchrc2
|
||||
@onready var wallrun_raycast_left1 = $wallrunrcleft1
|
||||
@onready var wallrun_raycast_left2 = $wallrunrcleft2
|
||||
@onready var wallrun_raycast_right1 = $wallrunrcright1
|
||||
@onready var wallrun_raycast_right2 = $wallrunrcright2
|
||||
@onready var wallcheck = $wallcheck
|
||||
@onready var floorcheck = $floorcheck
|
||||
|
||||
var air_jumps_done = 0
|
||||
var is_crouching = false
|
||||
var stuck_under_object = false
|
||||
|
||||
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 wallpushoff_force := 450 # Stärke des Abstoßens
|
||||
var wallpushoff_timer := 0.0
|
||||
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 crouching_cshape = preload("res://resources/player crouching cshape.tres")
|
||||
|
||||
func _process(delta):
|
||||
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:
|
||||
var result = !crouch_raycast1.is_colliding() && !crouch_raycast2.is_colliding()
|
||||
return result
|
||||
|
||||
func wall_detected_left() -> bool:
|
||||
var result = wallrun_raycast_left1.is_colliding() && wallrun_raycast_left2.is_colliding()
|
||||
return result
|
||||
|
||||
func wall_detected_right() -> bool:
|
||||
var result = wallrun_raycast_right1.is_colliding() && wallrun_raycast_right2.is_colliding()
|
||||
return result
|
||||
|
||||
func start_wallrun(direction: int):
|
||||
wallrunning = true
|
||||
wallrun_available = false
|
||||
wallrun_direction = direction
|
||||
velocity.x = 1000 * wallrun_direction # An Wand haften
|
||||
print("start wallrun called")
|
||||
|
||||
func wallpushoff():
|
||||
wallrunning = false
|
||||
pushingoffwall = true
|
||||
wallpushoff_timer = 0.0
|
||||
wallrun_timer = 0.0
|
||||
print("stop wallrun called")
|
||||
|
||||
func ledgedetected():
|
||||
wallrunning = false
|
||||
wallrun_timer = 0.0
|
||||
|
||||
func checkledgegrab() -> bool:
|
||||
var result = wallcheck.is_colliding() && !floorcheck.is_colliding() && velocity.y == 0
|
||||
return result
|
||||
|
||||
func update_animation(horizontal_direction):
|
||||
if is_on_floor():
|
||||
if horizontal_direction == 0:
|
||||
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():
|
||||
if is_crouching == false:
|
||||
return
|
||||
is_crouching = false
|
||||
crouch_mult = 1
|
||||
cshape.shape = standing_cshape
|
||||
cshape.position.y = -44
|
||||
|
||||
func switchdirection(horizontal_direction):
|
||||
sprite.flip_h = (horizontal_direction == -1)
|
||||
sprite.position.x = horizontal_direction * 4
|
||||
|
||||
1
sidescroller/scripts/player.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://d2jx8gdq5o5d7
|
||||