Compare commits
16
Commits
v0.1.0
..
744c750638
| Author | SHA1 | Date | |
|---|---|---|---|
| 744c750638 | |||
| d549edbf15 | |||
| a4d73f8697 | |||
| a0a288eee2 | |||
| 6ee79020ef | |||
| 3ccf193a7c | |||
| be6cad911c | |||
| 77bc341f9b | |||
| b18283ed9d | |||
| eca85aa2d0 | |||
| b55d2d87c8 | |||
| 77d850f95e | |||
| ba2ce768e4 | |||
| fb29fead0d | |||
| 82ce008b05 | |||
| 08d75b55f0 |
@@ -1,9 +1,9 @@
|
||||
name: Nightly Release
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
branches: ['**'] # every commit on any branch -> nightly
|
||||
tags: ['**'] # any tag push -> versioned draft
|
||||
workflow_dispatch:
|
||||
|
||||
# The default token is read-only; release/tag operations need write.
|
||||
@@ -33,14 +33,25 @@ jobs:
|
||||
godot_export_templates_download_url: https://godot-releases.nbg1.your-objectstorage.com/4.6.3-stable/Godot_v4.6.3-stable_mono_export_templates.tpz
|
||||
relative_project_path: ./
|
||||
archive_output: true
|
||||
- name: create release
|
||||
# cache: true # doesn't work on gitea
|
||||
|
||||
# --- not tagged: rolling nightly, updates the existing release ---
|
||||
- name: create nightly release
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# generateReleaseNotes: true
|
||||
# tag: ${{ github.ref_name }}
|
||||
files: ${{ steps.export.outputs.archive_directory }}/*
|
||||
# commit: ${{ gitea.sha }}
|
||||
# allowUpdates: true
|
||||
tag_name: nightly
|
||||
target_commitish: ${{ github.sha }}
|
||||
name: Latest Nightly Build
|
||||
prerelease: true
|
||||
files: ${{ steps.export.outputs.archive_directory }}/*
|
||||
|
||||
# --- tagged with a version: versioned draft release ---
|
||||
- name: create versioned release draft
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: ${{ github.ref_name }}
|
||||
draft: true
|
||||
files: ${{ steps.export.outputs.archive_directory }}/*
|
||||
+2
-2
@@ -27,7 +27,7 @@ script_export_mode=2
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=false
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
shader_baker/enabled=true
|
||||
@@ -365,7 +365,7 @@ script_export_mode=2
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=false
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
shader_baker/enabled=false
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
[gd_resource type="SpriteFrames" format=3 uid="uid://trcnb1ubmx5e"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://wli5w6t8y6se" path="res://sprites/atlas/jump_point_radiates.png" id="1_3yoq3"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_aokl3"]
|
||||
atlas = ExtResource("1_3yoq3")
|
||||
region = Rect2(0, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xd81c"]
|
||||
atlas = ExtResource("1_3yoq3")
|
||||
region = Rect2(0, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u618n"]
|
||||
atlas = ExtResource("1_3yoq3")
|
||||
region = Rect2(0, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_twrqh"]
|
||||
atlas = ExtResource("1_3yoq3")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vrk17"]
|
||||
atlas = ExtResource("1_3yoq3")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[resource]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_aokl3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xd81c")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_u618n")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_twrqh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vrk17")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 16.0
|
||||
}]
|
||||
@@ -1,6 +1,25 @@
|
||||
[gd_resource type="SpriteFrames" format=3 uid="uid://doxc4pl5hvs6k"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bv4gsgya7wp4d" path="res://sprites/atlas/demoman_walking.png" id="1_1t22f"]
|
||||
[ext_resource type="Texture2D" uid="uid://dy7fh0eg6qulr" path="res://sprites/atlas/demoman_idles.png" id="1_c2ath"]
|
||||
[ext_resource type="Texture2D" uid="uid://cl3uy4d6lgspe" path="res://sprites/man_falls.png" id="1_kdeld"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr5bdv3hgmd4q" path="res://sprites/man_jumps.png" id="3_a1t44"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_w1sc6"]
|
||||
atlas = ExtResource("1_c2ath")
|
||||
region = Rect2(0, 0, 32, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mcxxx"]
|
||||
atlas = ExtResource("1_c2ath")
|
||||
region = Rect2(0, 64, 32, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nf227"]
|
||||
atlas = ExtResource("1_c2ath")
|
||||
region = Rect2(32, 0, 32, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sbabb"]
|
||||
atlas = ExtResource("1_c2ath")
|
||||
region = Rect2(32, 64, 32, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c2ath"]
|
||||
atlas = ExtResource("1_1t22f")
|
||||
@@ -24,12 +43,35 @@ region = Rect2(64, 0, 32, 64)
|
||||
|
||||
[resource]
|
||||
animations = [{
|
||||
"frames": [],
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_kdeld")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fall",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_w1sc6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mcxxx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nf227")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sbabb")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [],
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_a1t44")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"jump",
|
||||
"speed": 5.0
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
[gd_resource type="CircleShape2D" format=3 uid="uid://duhxyfwoh6ndb"]
|
||||
|
||||
[resource]
|
||||
radius = 3.0
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://b4epp5w0awoov"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://dwgy05x43arpb" path="res://src/shaders/dimming_shader.tres" id="1_jm73v"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_jm73v")
|
||||
+256
-13
File diff suppressed because one or more lines are too long
+49
-2
@@ -25,29 +25,76 @@ 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":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, 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)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":true,"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":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, 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)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":13,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
jump={
|
||||
"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":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
}
|
||||
look_up={
|
||||
"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":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, 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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":11,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
look_down={
|
||||
"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":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":12,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
run={
|
||||
"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)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
skip_music={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":78,"key_label":0,"unicode":78,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
toggle_debug={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":75,"key_label":0,"unicode":75,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_up={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":11,"pressure":0.0,"pressed":true,"script":null)
|
||||
, 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":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, 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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_down={
|
||||
"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":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, 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":82,"key_label":0,"unicode":114,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":12,"pressure":0.0,"pressed":true,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
turn_back={
|
||||
"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":86,"key_label":0,"unicode":118,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://fhfma3rrxyfi"
|
||||
path="res://.godot/imported/Asphodel.wav-f87ecbeaa99b324bd8f5df8f9b0d72e4.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sounds/ost/Asphodel.wav"
|
||||
dest_files=["res://.godot/imported/Asphodel.wav-f87ecbeaa99b324bd8f5df8f9b0d72e4.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://5gnpemu56ac0"
|
||||
path="res://.godot/imported/Azalea.wav-cbe1be7340fbe8dc3e31528edc546255.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sounds/ost/Azalea.wav"
|
||||
dest_files=["res://.godot/imported/Azalea.wav-cbe1be7340fbe8dc3e31528edc546255.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://0tturucf5gxf"
|
||||
path="res://.godot/imported/Datura.wav-78725853df39d0ef155db6eea1881728.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sounds/ost/Datura.wav"
|
||||
dest_files=["res://.godot/imported/Datura.wav-78725853df39d0ef155db6eea1881728.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://b5cvbx3ypbbho"
|
||||
path="res://.godot/imported/Hyacinth.wav-32c97df5a6b61df7f68aa21d2c6edfae.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sounds/ost/Hyacinth.wav"
|
||||
dest_files=["res://.godot/imported/Hyacinth.wav-32c97df5a6b61df7f68aa21d2c6edfae.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dy7fh0eg6qulr"
|
||||
path="res://.godot/imported/demoman_idles.png-a329588d12d5e8eda94ae9b9fc61068e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/atlas/demoman_idles.png"
|
||||
dest_files=["res://.godot/imported/demoman_idles.png-a329588d12d5e8eda94ae9b9fc61068e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://wli5w6t8y6se"
|
||||
path="res://.godot/imported/jump_point_radiates.png-1a97dab1296f185bfc3d06015e15ec05.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/atlas/jump_point_radiates.png"
|
||||
dest_files=["res://.godot/imported/jump_point_radiates.png-1a97dab1296f185bfc3d06015e15ec05.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cl3uy4d6lgspe"
|
||||
path="res://.godot/imported/man_falls.png-61beb99173ba0b99454c416e7ba44020.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/man_falls.png"
|
||||
dest_files=["res://.godot/imported/man_falls.png-61beb99173ba0b99454c416e7ba44020.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cr5bdv3hgmd4q"
|
||||
path="res://.godot/imported/man_jumps.png-70ad3c36f80f10d1a96a8706ccbc76b6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/man_jumps.png"
|
||||
dest_files=["res://.godot/imported/man_jumps.png-70ad3c36f80f10d1a96a8706ccbc76b6.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
@@ -59,6 +59,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
2:2/1/flip_h = true
|
||||
2:2/1/terrain_set = 0
|
||||
2:2/1/terrain = 0
|
||||
2:2/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -16, 16, 16, 16, 16, -16, -16, -16)
|
||||
2:2/1/terrains_peering_bit/right_side = 0
|
||||
2:2/1/terrains_peering_bit/bottom_right_corner = 0
|
||||
2:2/1/terrains_peering_bit/bottom_side = 0
|
||||
@@ -107,6 +108,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
1:3/1/flip_v = true
|
||||
1:3/1/terrain_set = 0
|
||||
1:3/1/terrain = 0
|
||||
1:3/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
1:3/1/terrains_peering_bit/right_side = 0
|
||||
1:3/1/terrains_peering_bit/bottom_right_corner = 0
|
||||
1:3/1/terrains_peering_bit/bottom_side = 0
|
||||
@@ -129,6 +131,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
2:3/1/flip_h = true
|
||||
2:3/1/terrain_set = 0
|
||||
2:3/1/terrain = 0
|
||||
2:3/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:3/1/terrains_peering_bit/right_side = 0
|
||||
2:3/1/terrains_peering_bit/bottom_right_corner = 0
|
||||
2:3/1/terrains_peering_bit/bottom_side = 0
|
||||
@@ -141,6 +144,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
2:3/2/flip_v = true
|
||||
2:3/2/terrain_set = 0
|
||||
2:3/2/terrain = 0
|
||||
2:3/2/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:3/2/terrains_peering_bit/right_side = 0
|
||||
2:3/2/terrains_peering_bit/bottom_right_corner = 0
|
||||
2:3/2/terrains_peering_bit/bottom_side = 0
|
||||
@@ -153,6 +157,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
2:3/4/transpose = true
|
||||
2:3/4/terrain_set = 0
|
||||
2:3/4/terrain = 0
|
||||
2:3/4/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:3/4/terrains_peering_bit/right_side = 0
|
||||
2:3/4/terrains_peering_bit/bottom_right_corner = 0
|
||||
2:3/4/terrains_peering_bit/bottom_side = 0
|
||||
@@ -166,6 +171,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
2:3/5/transpose = true
|
||||
2:3/5/terrain_set = 0
|
||||
2:3/5/terrain = 0
|
||||
2:3/5/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:3/5/terrains_peering_bit/right_side = 0
|
||||
2:3/5/terrains_peering_bit/bottom_right_corner = 0
|
||||
2:3/5/terrains_peering_bit/bottom_side = 0
|
||||
@@ -188,6 +194,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
3:3/1/flip_v = true
|
||||
3:3/1/terrain_set = 0
|
||||
3:3/1/terrain = 0
|
||||
3:3/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
3:3/1/terrains_peering_bit/bottom_side = 0
|
||||
3:3/1/terrains_peering_bit/bottom_left_corner = 0
|
||||
3:3/1/terrains_peering_bit/left_side = 0
|
||||
@@ -247,6 +254,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
2:4/1/flip_h = true
|
||||
2:4/1/terrain_set = 0
|
||||
2:4/1/terrain = 0
|
||||
2:4/1/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:4/1/terrains_peering_bit/right_side = 0
|
||||
2:4/1/terrains_peering_bit/left_side = 0
|
||||
2:4/1/terrains_peering_bit/top_left_corner = 0
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
extends CanvasItem
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("toggle_debug"):
|
||||
visible = !visible;
|
||||
@@ -0,0 +1 @@
|
||||
uid://1mjqnyofaeo8
|
||||
@@ -0,0 +1,18 @@
|
||||
extends AudioStreamPlayer
|
||||
|
||||
@export var music : Array[AudioStream];
|
||||
|
||||
func skip_music():
|
||||
var piece = music[randi_range(0, music.size() - 1)];
|
||||
stream = piece;
|
||||
play()
|
||||
|
||||
func _ready() -> void:
|
||||
skip_music()
|
||||
|
||||
func _on_finished() -> void:
|
||||
skip_music()
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed(("skip_music")):
|
||||
skip_music()
|
||||
@@ -0,0 +1 @@
|
||||
uid://b3unn3dqhg2vl
|
||||
@@ -1,24 +1,42 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
public partial class PlayerPhysicsController : CharacterBody2D {
|
||||
// [Export]
|
||||
// public float RunMultiplier { get; set; } = 1.84f;
|
||||
|
||||
[Signal]
|
||||
public delegate void OnTurnbackJumpEventHandler(bool onJumpPoint, bool isOnWall);
|
||||
|
||||
[ExportCategory("Accelerations and Impulses")]
|
||||
[Export]
|
||||
public float FloatingMovePenalty { get; set; } = 0.1f;
|
||||
public float WalkAcceleration { get; set; } = 3f;
|
||||
[Export]
|
||||
public float FloatingJumpPenalty { get; set; } = 0.1f;
|
||||
public float StoppingDeceleration { get; set; } = 8f;
|
||||
[Export]
|
||||
public float JumpStrengthDecay { get; set; } = 2;
|
||||
public float CancellationAcceleration { get; set; } = 4f;
|
||||
[Export]
|
||||
public float MovementDecay { get; set; } = 2;
|
||||
[Export]
|
||||
public float MovementScale { get; set; } = 10;
|
||||
[Export]
|
||||
public float JumpScale { get; set; } = 12;
|
||||
public float AirAcceleration { get; set; } = 0.5f;
|
||||
|
||||
[Export]
|
||||
public float FrictionCoefficent { get; set; } = 0.1f;
|
||||
public float JumpHeight { get; set; } = 5.5f;
|
||||
|
||||
[ExportCategory("Max Speeds")]
|
||||
[Export]
|
||||
private float MaxFallSpeed { get; set; } = 8f;
|
||||
|
||||
[Export]
|
||||
private float MaxRiseSpeed { get; set; } = 16f;
|
||||
|
||||
[Export]
|
||||
private float MaxRunSpeed { get; set; } = 16f;
|
||||
[Export]
|
||||
private float MaxWalkSpeed { get; set; } = 8f;
|
||||
|
||||
[ExportCategory("Objects")]
|
||||
[Export]
|
||||
public Label DebugTextLabel { get; set; }
|
||||
|
||||
@@ -26,60 +44,188 @@ public partial class PlayerPhysicsController : CharacterBody2D {
|
||||
public AnimatedSprite2D Sprite { get; set; }
|
||||
|
||||
[Export]
|
||||
public float Gravity { get; set; } = 980f;
|
||||
public PredictiveCollisions Predictor { get; set; }
|
||||
|
||||
private float _timeInFlight = 0;
|
||||
[ExportCategory("Physics Tweaks")]
|
||||
[Export]
|
||||
public float Gravity { get; set; } = 30.625f;
|
||||
|
||||
private float TilesToMeters => 9.81f / Gravity;
|
||||
|
||||
private float PxToMeters => (1 / UnitToPx) * TilesToMeters;
|
||||
|
||||
[Export]
|
||||
public float UnitToPx { get; set; } = 32;
|
||||
|
||||
private float _timeOffGround = 0.0f;
|
||||
|
||||
[Export]
|
||||
public float CoyoteTiming { get; set; } = 0.1f;
|
||||
|
||||
[Export]
|
||||
public float Deadzone { get; set; } = 0.1f;
|
||||
|
||||
|
||||
|
||||
|
||||
private float _lv = 0.0f;
|
||||
|
||||
private void RecalculateLv() {
|
||||
_lv = Mathf.Sqrt(Mathf.Pow(Gravity * 0.1f / 2, 2) + 2 * Gravity * JumpHeight);
|
||||
}
|
||||
|
||||
public override void _Ready() {
|
||||
RecalculateLv();
|
||||
base._Ready();
|
||||
}
|
||||
|
||||
private float epsilon = 10e-5f;
|
||||
|
||||
public override void _Process(double delta) {
|
||||
var grounded = this.IsOnFloor();
|
||||
var absvel = new Vector2(Mathf.Abs(Velocity.X), Mathf.Abs(Velocity.Y));
|
||||
Sprite.FlipH = Velocity.X < 0;
|
||||
if (grounded && absvel.X > 0) {
|
||||
Sprite.Play("walk", absvel.X switch {
|
||||
var xAxis = Input.GetAxis("move_left", "move_right");
|
||||
Sprite.FlipH = xAxis < 0;
|
||||
if (grounded && absvel.X > 0.1) {
|
||||
Sprite.Animation = "walk";
|
||||
Sprite.SpeedScale = absvel.X switch {
|
||||
< 10 => 1,
|
||||
< 150 => 2,
|
||||
< 300 => 4,
|
||||
_ => 1
|
||||
});
|
||||
} else if (grounded && absvel.X < epsilon && absvel.Y < epsilon) {
|
||||
Sprite.Play("idle");
|
||||
< 600 => 4,
|
||||
_ => 4
|
||||
};
|
||||
if (!Sprite.IsPlaying())
|
||||
Sprite.Play();
|
||||
} else {
|
||||
Sprite.SpeedScale = 1;
|
||||
}
|
||||
|
||||
if (grounded && absvel.X < 0.1) {
|
||||
Sprite.Animation = "idle";
|
||||
if (!Sprite.IsPlaying())
|
||||
Sprite.Play();
|
||||
}
|
||||
|
||||
if (!grounded && Velocity.Y > 0.1) {
|
||||
Sprite.Animation = "fall";
|
||||
}
|
||||
|
||||
if (!grounded && Velocity.Y < 0.1) {
|
||||
Sprite.Animation = "jump";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void _PhysicsProcess(double delta) {
|
||||
var xAxis = Input.GetAxis("move_left", "move_right") * MovementScale;
|
||||
var yAxis = Input.GetAxis("look_up", "look_down");
|
||||
var jumpStrength = -Input.GetActionStrength("jump") * JumpScale;
|
||||
var xAxis = Input.GetAxis("move_left", "move_right");
|
||||
var yAxis = Input.GetAxis("move_up", "move_down");
|
||||
var lookAxis = Input.GetAxis("look_up", "look_down");
|
||||
// var jumpStrength = -Input.GetActionStrength("jump");
|
||||
|
||||
RecalculateLv();
|
||||
|
||||
float velx = (Velocity.X / UnitToPx);
|
||||
float vely = (Velocity.Y / UnitToPx) + Gravity * (float)delta;
|
||||
|
||||
if (Mathf.Abs(velx) < 0.1) velx = 0;
|
||||
|
||||
var grounded = this.IsOnFloor();
|
||||
if (!grounded) {
|
||||
xAxis *= FloatingMovePenalty;
|
||||
jumpStrength *= FloatingJumpPenalty;
|
||||
var coyoteGrounded = _timeOffGround < CoyoteTiming;
|
||||
if (grounded || coyoteGrounded) {
|
||||
if (grounded) _timeOffGround = 0;
|
||||
else _timeOffGround += (float)delta;
|
||||
|
||||
if (Input.IsActionJustPressed("jump")) {
|
||||
vely = -_lv;
|
||||
}
|
||||
|
||||
if (!grounded && coyoteGrounded && Input.IsActionJustReleased("jump") && vely < 0) {
|
||||
vely *= 1/4f;
|
||||
}
|
||||
|
||||
var accel = WalkAcceleration;
|
||||
if (xAxis * Velocity.X < 0) accel = StoppingDeceleration;
|
||||
velx += xAxis * accel * (float)delta;
|
||||
} else {
|
||||
if (Input.IsActionJustReleased("jump") && vely < 0) {
|
||||
vely *= 1/4f;
|
||||
}
|
||||
|
||||
if (Input.IsActionJustPressed("turn_back") && vely > 0) {
|
||||
var side = velx > 0 ? PredictiveCollisions.Location.BottomRight : PredictiveCollisions.Location.BottomLeft;
|
||||
if (Predictor.AnyHit(side) && !this.IsOnWall()) {
|
||||
EmitSignal(SignalName.OnTurnbackJump, true, this.IsOnWall());
|
||||
var hits = Predictor.GetLastCastHits(side);
|
||||
_ = hits.First(x => {
|
||||
if (x.Obj is null) return false;
|
||||
var collider = x.AsGodotDictionary()["collider"].AsGodotObject();
|
||||
if (collider.HasMeta("JumpPointAnimatable")) {
|
||||
var animPath = collider.GetMeta("JumpPointAnimatable").AsNodePath();
|
||||
var anim = collider.Call(MethodName.GetNode, animPath).As<AnimatedSprite2D>();
|
||||
var frame = anim.Frame;
|
||||
void anf() {
|
||||
anim.Stop();
|
||||
anim.Frame = frame;
|
||||
anim.AnimationLooped -= anf;
|
||||
};
|
||||
anim.AnimationLooped += anf;
|
||||
anim.Play();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
// has jump point
|
||||
float theta = Mathf.Atan2(-yAxis, Mathf.Abs(xAxis));
|
||||
float margin = 20 * (Mathf.Pi / 180f);
|
||||
if (theta < margin) theta = margin;
|
||||
if (theta > Mathf.Pi / 2 - margin) theta = Mathf.Pi/2 - margin;
|
||||
Vector2 turnjump = new Vector2(-Mathf.Sign(velx) * Mathf.Cos(theta), -Mathf.Sin(theta) - 0.2f) * _lv;
|
||||
GD.Print($"Theta: {theta * (180 / Mathf.Pi)}, turnjump: {turnjump}");
|
||||
velx = turnjump.X;
|
||||
vely = turnjump.Y;
|
||||
} else {
|
||||
// does not have jump point
|
||||
// float theta = Mathf.Atan2(-yAxis, Mathf.Abs(xAxis));
|
||||
// float margin = 20 * (Mathf.Pi / 180f);
|
||||
// if (theta < margin) theta = margin;
|
||||
// if (theta > Mathf.Pi / 2 - margin) theta = Mathf.Pi/2 - margin;
|
||||
// Vector2 turnjump = new Vector2(-Mathf.Sign(Velocity.X) * Mathf.Cos(theta), -Mathf.Sin(theta) - 0.2f) * _lv;
|
||||
// GD.Print($"Theta: {theta * (180 / Mathf.Pi)}, turnjump: {turnjump}");
|
||||
// velx = turnjump.X;
|
||||
// vely = turnjump.Y;
|
||||
}
|
||||
}
|
||||
|
||||
if (Input.IsActionJustPressed("jump") && Mathf.Abs(vely) < 2) {
|
||||
vely = -_lv;
|
||||
}
|
||||
|
||||
velx += xAxis * AirAcceleration * (float)delta;
|
||||
}
|
||||
|
||||
if (grounded && jumpStrength < 0)
|
||||
_timeInFlight = 0;
|
||||
if (grounded && Mathf.Abs(xAxis) < Deadzone) {
|
||||
var autostop = -Mathf.Sign(velx) * StoppingDeceleration * (float)delta;
|
||||
if (Mathf.Abs(autostop) > Mathf.Abs(velx)) velx = 0f;
|
||||
else velx += autostop;
|
||||
}
|
||||
|
||||
jumpStrength *= Mathf.Exp(-JumpStrengthDecay * _timeInFlight);
|
||||
var maxXSpeed = Input.IsActionPressed("run") ? MaxRunSpeed : MaxWalkSpeed;
|
||||
var maxYSpeed = vely > 0 ? MaxFallSpeed : MaxRiseSpeed;
|
||||
var (absvelx, absvely) = (Mathf.Abs(velx), Mathf.Abs(vely));
|
||||
float xcancel = 0, ycancel = 0;
|
||||
if (absvelx > maxXSpeed) xcancel = -Math.Sign(velx) * CancellationAcceleration * (float)delta;
|
||||
if (absvely > maxYSpeed) ycancel = -Math.Sign(vely) * CancellationAcceleration * (float)delta;
|
||||
if (Mathf.Abs(xcancel) + 0.1 > absvelx) velx = 0;
|
||||
else velx += xcancel;
|
||||
if (Mathf.Abs(ycancel) + 0.1 > absvely) vely = 0;
|
||||
else vely += ycancel;
|
||||
|
||||
// autorun
|
||||
var friction = Mathf.Abs(Velocity.X) > 125 ? FrictionCoefficent * 1/8f : FrictionCoefficent;
|
||||
// var decay = Mathf.Abs(Velocity.X) > 125 ? MovementDecay * 1/4f : MovementDecay;
|
||||
xAxis *= Mathf.Exp(-MovementDecay * Mathf.Abs(Velocity.X));
|
||||
xAxis -= Velocity.X * friction;
|
||||
|
||||
var moveVector = new Vector2((float)(delta * xAxis), (float)( delta * (Gravity + jumpStrength)));
|
||||
DebugTextLabel.Text = $"grounded: {grounded}\nmv: {moveVector}\n vel: {Velocity}\n jumpStrength: {jumpStrength}\ntimeInFlight: {_timeInFlight}";
|
||||
Velocity += moveVector;
|
||||
DebugTextLabel.Text =
|
||||
$"grounded: {grounded}\n" +
|
||||
$"vely: {vely}\n" +
|
||||
$"velx: {velx}\n" +
|
||||
$"lv : {_lv:F2} or {_lv/(float)delta:F2}\n" +
|
||||
$"lcrc : {Predictor.AnyHit(PredictiveCollisions.Location.BottomLeft)}/{Predictor.AnyHit(PredictiveCollisions.Location.BottomRight)}";
|
||||
// Force = new Vector2(0, forcey);
|
||||
Velocity = new Vector2(velx, vely);
|
||||
Velocity *= UnitToPx;
|
||||
MoveAndSlide();
|
||||
|
||||
if (!grounded)
|
||||
_timeInFlight += (float)delta;
|
||||
base._PhysicsProcess(delta);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class PredictiveCollisions : Node {
|
||||
[Export]
|
||||
public ShapeCast2D BottomLeft { get; set; }
|
||||
[Export]
|
||||
public ShapeCast2D BottomRight { get; set; }
|
||||
[Export]
|
||||
public ShapeCast2D TopLeft { get; set; }
|
||||
[Export]
|
||||
public ShapeCast2D TopRight { get; set; }
|
||||
|
||||
[Flags]
|
||||
public enum Location {
|
||||
BottomRight = 0b01,
|
||||
TopRight = 0b11,
|
||||
TopLeft = 0b10,
|
||||
BottomLeft = 0b00
|
||||
}
|
||||
|
||||
|
||||
public Godot.Collections.Array Cast(Location location) {
|
||||
GetShapeCast(location).ForceShapecastUpdate();
|
||||
return GetShapeCast(location).CollisionResult;
|
||||
}
|
||||
|
||||
public bool AnyHit(Location location)
|
||||
=> (Cast(location)?.Count ?? -1) > 0;
|
||||
|
||||
public Godot.Collections.Array GetLastCastHits(Location location) {
|
||||
return GetShapeCast(location).CollisionResult;
|
||||
}
|
||||
|
||||
public ShapeCast2D GetShapeCast(Location location) => location switch {
|
||||
Location.BottomLeft => BottomLeft,
|
||||
Location.BottomRight => BottomRight,
|
||||
Location.TopLeft => TopLeft,
|
||||
Location.TopRight => TopRight,
|
||||
_ => throw new Exception("Invalid location")
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://de3b068om3gsq
|
||||
@@ -0,0 +1,21 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class ResetPlayer : Area2D {
|
||||
[Export]
|
||||
public Node2D Player { get; set; }
|
||||
|
||||
[Export]
|
||||
public Vector2 ResetPosition { get; set; }
|
||||
|
||||
public override void _Ready() {
|
||||
this.BodyShapeEntered += OnBodyShapeEntered;
|
||||
base._Ready();
|
||||
}
|
||||
|
||||
private void OnBodyShapeEntered(Rid bodyRid, Node2D body, long bodyShapeIndex, long localShapeIndex) {
|
||||
if (Player == body) {
|
||||
Player.Position = ResetPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://d0qoxtv6ld1ef
|
||||
@@ -0,0 +1,33 @@
|
||||
[gd_resource type="VisualShader" format=3 uid="uid://dwgy05x43arpb"]
|
||||
|
||||
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_46mxo"]
|
||||
input_name = "color"
|
||||
|
||||
[sub_resource type="VisualShaderNodeFloatParameter" id="VisualShaderNodeFloatParameter_paeta"]
|
||||
parameter_name = "FloatParameter"
|
||||
qualifier = 2
|
||||
hint = 1
|
||||
default_value_enabled = true
|
||||
default_value = 0.5
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorCompose" id="VisualShaderNodeVectorCompose_282el"]
|
||||
default_input_values = [0, 0.0, 1, 0.0, 2, 0.0, 3, 0.0]
|
||||
op_type = 2
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_ivc0m"]
|
||||
default_input_values = [0, Quaternion(0, 0, 0, 0), 1, Quaternion(0, 0, 0, 0)]
|
||||
op_type = 2
|
||||
operator = 2
|
||||
|
||||
[resource]
|
||||
mode = 1
|
||||
flags/light_only = false
|
||||
nodes/vertex/3/node = SubResource("VisualShaderNodeInput_46mxo")
|
||||
nodes/vertex/3/position = Vector2(-280, 160)
|
||||
nodes/vertex/7/node = SubResource("VisualShaderNodeFloatParameter_paeta")
|
||||
nodes/vertex/7/position = Vector2(-460, 340)
|
||||
nodes/vertex/8/node = SubResource("VisualShaderNodeVectorCompose_282el")
|
||||
nodes/vertex/8/position = Vector2(-140, 300)
|
||||
nodes/vertex/9/node = SubResource("VisualShaderNodeVectorOp_ivc0m")
|
||||
nodes/vertex/9/position = Vector2(80, 160)
|
||||
nodes/vertex/connections = PackedInt32Array(3, 0, 9, 0, 8, 0, 9, 1, 7, 0, 8, 0, 7, 0, 8, 1, 7, 0, 8, 2, 7, 0, 8, 3, 9, 0, 0, 2)
|
||||
Reference in New Issue
Block a user