Author SHA1 Message Date
qwsdcvghyu89 562d0da079 Added more grassy tile variants
Release / Export Game (push) Successful in 1m43s
2026-06-15 07:51:19 +10:00
qwsdcvghyu89 6b9bb6da5a Audio additions: jump.ogg - comitting to continue development in another environment.
Release / Export Game (push) Successful in 2m0s
2026-06-15 00:07:56 +10:00
qwsdcvghyu89 e252a94f46 Added grassy tiles
Release / Export Game (push) Successful in 2m12s
2026-06-14 23:21:39 +10:00
qwsdcvghyu89 3254d821c1 Added normal and specular maps; added point lights to demo scene...
Release / Export Game (push) Successful in 3m53s
...to demonstrate dynamic lighting.
2026-06-14 20:08:32 +10:00
21 changed files with 2971 additions and 10 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2023 The Godot Engine community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,10 @@
[configuration]
entry_symbol = "git_plugin_init"
compatibility_minimum = "4.2.0"
[libraries]
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
windows.editor.x86_64 = "windows/libgit_plugin.windows.editor.x86_64.dll"
@@ -0,0 +1 @@
uid://cunr88y1kycok
+42
View File
@@ -0,0 +1,42 @@
[gd_scene format=3 uid="uid://xanv3qbl1n2u"]
[sub_resource type="Gradient" id="Gradient_nxkc6"]
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_kfvst"]
gradient = SubResource("Gradient_nxkc6")
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(0.725, 0)
[node name="Light" type="Node2D" unique_id=658403720]
scale = Vector2(3.105, 3.105)
[node name="BackgroundLight" type="PointLight2D" parent="." unique_id=1870867099]
scale = Vector2(3, 3)
color = Color(1, 0.73333335, 0, 1)
energy = 1.5
shadow_enabled = true
shadow_filter = 1
texture = SubResource("GradientTexture2D_kfvst")
height = 15.0
[node name="ForegroundLight" type="PointLight2D" parent="." unique_id=574997062]
scale = Vector2(5, 5)
color = Color(0.93, 0.837, 0, 0.8)
energy = 0.7
shadow_enabled = true
shadow_filter = 1
shadow_item_cull_mask = 2
texture = SubResource("GradientTexture2D_kfvst")
height = 15.0
[node name="ForegroundNOCLight" type="PointLight2D" parent="." unique_id=2045804818]
scale = Vector2(5, 5)
color = Color(0.93, 0.837, 0, 0.8)
energy = 0.7
range_item_cull_mask = 4
shadow_filter = 1
shadow_item_cull_mask = 4
texture = SubResource("GradientTexture2D_kfvst")
height = 15.0
File diff suppressed because one or more lines are too long
+6
View File
@@ -19,6 +19,11 @@ config/icon="res://icon.svg"
project/assembly_name="WrplatGodot" project/assembly_name="WrplatGodot"
[editor]
version_control/plugin_name="GitPlugin"
version_control/autoload_on_startup=true
[input] [input]
move_right={ move_right={
@@ -102,6 +107,7 @@ turn_back={
2d_render/layer_1="Backgrounds" 2d_render/layer_1="Backgrounds"
2d_render/layer_2="Foregrounds" 2d_render/layer_2="Foregrounds"
2d_render/layer_3="Foregrounds NOC"
[physics] [physics]
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://dkx1v6c7vv0iq"
path="res://.godot/imported/jump.ogg-d217a70c8ca2fe077e37d9f442c771d3.oggvorbisstr"
[deps]
source_file="res://sounds/sfx/jump.ogg"
dest_files=["res://.godot/imported/jump.ogg-d217a70c8ca2fe077e37d9f442c771d3.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 42 KiB

File diff suppressed because it is too large Load Diff
+289 -2
View File
@@ -1,6 +1,7 @@
[gd_resource type="TileSet" format=3 uid="uid://cb1bigfqp1l7t"] [gd_resource type="TileSet" format=3 uid="uid://cb1bigfqp1l7t"]
[ext_resource type="Texture2D" uid="uid://b78uwnnyovqci" path="res://materials/tilesets/pool.tres" id="1_l670f"] [ext_resource type="Texture2D" uid="uid://n6b4udvjt2pt" path="res://sprites/atlas/diffuse/pool.diffuse.png" id="1_by4n8"]
[ext_resource type="Texture2D" uid="uid://cs2jr54egxwey" path="res://sprites/atlas/normal/pool.normal.png" id="2_1bmlt"]
[sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_l670f"] [sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_l670f"]
polygon = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) polygon = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
@@ -83,8 +84,13 @@ polygon = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
[sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_yfu7p"] [sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_yfu7p"]
polygon = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) polygon = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
[sub_resource type="CanvasTexture" id="CanvasTexture_by4n8"]
diffuse_texture = ExtResource("1_by4n8")
normal_texture = ExtResource("2_1bmlt")
specular_shininess = 0.35
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_blkrv"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_blkrv"]
texture = ExtResource("1_l670f") texture = SubResource("CanvasTexture_by4n8")
texture_region_size = Vector2i(32, 32) texture_region_size = Vector2i(32, 32)
0:0/0 = 0 0:0/0 = 0
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, 16, 16, 16, -16, -16, -16) 0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, 16, 16, 16, -16, -16, -16)
@@ -116,8 +122,24 @@ texture_region_size = Vector2i(32, 32)
7:1/0 = 0 7:1/0 = 0
8:1/0 = 0 8:1/0 = 0
9:1/0 = 0 9:1/0 = 0
9:1/0/terrain_set = 0
9:1/0/terrain = 2
9:1/0/terrains_peering_bit/right_side = 2
9:1/0/terrains_peering_bit/bottom_right_corner = 1
9:1/0/terrains_peering_bit/bottom_side = 2
10:1/next_alternative_id = 2
10:1/0 = 0 10:1/0 = 0
10:1/0/terrain_set = 0
10:1/0/terrain = 2
10:1/0/terrains_peering_bit/right_side = 2
10:1/0/terrains_peering_bit/bottom_side = 1
10:1/0/terrains_peering_bit/left_side = 2
11:1/0 = 0 11:1/0 = 0
11:1/0/terrain_set = 0
11:1/0/terrain = 2
11:1/0/terrains_peering_bit/right_side = 2
11:1/0/terrains_peering_bit/bottom_side = 1
11:1/0/terrains_peering_bit/left_side = 2
0:2/0 = 0 0:2/0 = 0
1:2/0 = 0 1:2/0 = 0
1:2/0/terrain_set = 0 1:2/0/terrain_set = 0
@@ -189,9 +211,29 @@ texture_region_size = Vector2i(32, 32)
8:2/0 = 0 8:2/0 = 0
8:2/0/occlusion_layer_0/polygon_0/polygon = SubResource("OccluderPolygon2D_yfu7p") 8:2/0/occlusion_layer_0/polygon_0/polygon = SubResource("OccluderPolygon2D_yfu7p")
8:2/0/occlusion_layer_1/polygon_0/polygon = SubResource("OccluderPolygon2D_xwwfl") 8:2/0/occlusion_layer_1/polygon_0/polygon = SubResource("OccluderPolygon2D_xwwfl")
9:2/next_alternative_id = 2
9:2/0 = 0 9:2/0 = 0
9:2/0/terrain_set = 0
9:2/0/terrain = 2
9:2/0/terrains_peering_bit/right_side = 1
9:2/0/terrains_peering_bit/bottom_side = 2
9:2/0/terrains_peering_bit/top_side = 2
10:2/next_alternative_id = 2
10:2/0 = 0 10:2/0 = 0
10:2/0/terrain_set = 0
10:2/0/terrain = 1
10:2/0/terrains_peering_bit/right_side = 1
10:2/0/terrains_peering_bit/bottom_right_corner = 1
10:2/0/terrains_peering_bit/bottom_side = 1
11:2/next_alternative_id = 11
11:2/0 = 0 11:2/0 = 0
11:2/0/terrain_set = 0
11:2/0/terrain = 1
11:2/0/terrains_peering_bit/right_side = 1
11:2/0/terrains_peering_bit/bottom_right_corner = 1
11:2/0/terrains_peering_bit/bottom_side = 1
11:2/0/terrains_peering_bit/bottom_left_corner = 1
11:2/0/terrains_peering_bit/left_side = 1
0:3/0 = 0 0:3/0 = 0
1:3/next_alternative_id = 2 1:3/next_alternative_id = 2
1:3/0 = 0 1:3/0 = 0
@@ -353,8 +395,31 @@ texture_region_size = Vector2i(32, 32)
7:3/0/terrains_peering_bit/top_right_corner = 0 7:3/0/terrains_peering_bit/top_right_corner = 0
8:3/0 = 0 8:3/0 = 0
9:3/0 = 0 9:3/0 = 0
9:3/0/terrain_set = 0
9:3/0/terrain = 2
9:3/0/terrains_peering_bit/right_side = 1
9:3/0/terrains_peering_bit/bottom_side = 2
9:3/0/terrains_peering_bit/top_side = 2
10:3/next_alternative_id = 10
10:3/0 = 0 10:3/0 = 0
10:3/0/terrain_set = 0
10:3/0/terrain = 1
10:3/0/terrains_peering_bit/right_side = 1
10:3/0/terrains_peering_bit/bottom_right_corner = 1
10:3/0/terrains_peering_bit/bottom_side = 1
10:3/0/terrains_peering_bit/top_side = 1
10:3/0/terrains_peering_bit/top_right_corner = 1
11:3/0 = 0 11:3/0 = 0
11:3/0/terrain_set = 0
11:3/0/terrain = 1
11:3/0/terrains_peering_bit/right_side = 1
11:3/0/terrains_peering_bit/bottom_right_corner = 1
11:3/0/terrains_peering_bit/bottom_side = 1
11:3/0/terrains_peering_bit/bottom_left_corner = 1
11:3/0/terrains_peering_bit/left_side = 1
11:3/0/terrains_peering_bit/top_left_corner = 1
11:3/0/terrains_peering_bit/top_side = 1
11:3/0/terrains_peering_bit/top_right_corner = 1
0:4/0 = 0 0:4/0 = 0
1:4/0 = 0 1:4/0 = 0
1:4/0/terrain_set = 0 1:4/0/terrain_set = 0
@@ -434,6 +499,220 @@ texture_region_size = Vector2i(32, 32)
5:4/0/occlusion_layer_0/polygon_0/polygon = SubResource("OccluderPolygon2D_njrqr") 5:4/0/occlusion_layer_0/polygon_0/polygon = SubResource("OccluderPolygon2D_njrqr")
5:4/0/occlusion_layer_1/polygon_0/polygon = SubResource("OccluderPolygon2D_o2foe") 5:4/0/occlusion_layer_1/polygon_0/polygon = SubResource("OccluderPolygon2D_o2foe")
5:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -16, 16, 16, 16, 16, -16) 5:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -16, 16, 16, 16, 16, -16)
8:4/0 = 0
9:4/next_alternative_id = 2
9:4/0 = 0
9:4/0/terrain_set = 0
9:4/0/terrain = 2
9:4/0/terrains_peering_bit/right_side = 1
9:4/0/terrains_peering_bit/bottom_side = 2
9:4/0/terrains_peering_bit/top_side = 2
10:4/next_alternative_id = 2
10:4/0 = 0
10:4/0/terrain_set = 0
10:4/0/terrain = 1
10:4/0/terrains_peering_bit/right_side = 1
10:4/0/terrains_peering_bit/top_side = 1
10:4/0/terrains_peering_bit/top_right_corner = 1
12:1/next_alternative_id = 2
12:1/0 = 0
12:1/0/terrain_set = 0
12:1/0/terrain = 2
12:1/0/terrains_peering_bit/right_side = 2
12:1/0/terrains_peering_bit/bottom_side = 1
12:1/0/terrains_peering_bit/left_side = 2
13:1/0 = 0
13:1/0/terrain_set = 0
13:1/0/terrain = 2
13:1/0/terrains_peering_bit/bottom_side = 2
13:1/0/terrains_peering_bit/bottom_left_corner = 1
13:1/0/terrains_peering_bit/left_side = 2
12:2/next_alternative_id = 2
12:2/0 = 0
12:2/0/terrain_set = 0
12:2/0/terrain = 1
12:2/0/terrains_peering_bit/bottom_side = 1
12:2/0/terrains_peering_bit/bottom_left_corner = 1
12:2/0/terrains_peering_bit/left_side = 1
13:2/next_alternative_id = 2
13:2/0 = 0
13:2/0/terrain_set = 0
13:2/0/terrain = 2
13:2/0/terrains_peering_bit/bottom_side = 2
13:2/0/terrains_peering_bit/left_side = 1
13:2/0/terrains_peering_bit/top_side = 2
12:3/next_alternative_id = 10
12:3/0 = 0
12:3/0/terrain_set = 0
12:3/0/terrain = 1
12:3/0/terrains_peering_bit/bottom_side = 1
12:3/0/terrains_peering_bit/bottom_left_corner = 1
12:3/0/terrains_peering_bit/left_side = 1
12:3/0/terrains_peering_bit/top_left_corner = 1
12:3/0/terrains_peering_bit/top_side = 1
13:3/0 = 0
13:3/0/terrain_set = 0
13:3/0/terrain = 2
13:3/0/terrains_peering_bit/bottom_side = 2
13:3/0/terrains_peering_bit/left_side = 1
13:3/0/terrains_peering_bit/top_side = 2
11:4/next_alternative_id = 10
11:4/0 = 0
11:4/0/terrain_set = 0
11:4/0/terrain = 1
11:4/0/terrains_peering_bit/right_side = 1
11:4/0/terrains_peering_bit/left_side = 1
11:4/0/terrains_peering_bit/top_left_corner = 1
11:4/0/terrains_peering_bit/top_side = 1
11:4/0/terrains_peering_bit/top_right_corner = 1
12:4/next_alternative_id = 2
12:4/0 = 0
12:4/0/terrain_set = 0
12:4/0/terrain = 1
12:4/0/terrains_peering_bit/left_side = 1
12:4/0/terrains_peering_bit/top_left_corner = 1
12:4/0/terrains_peering_bit/top_side = 1
13:4/next_alternative_id = 2
13:4/0 = 0
13:4/0/terrain_set = 0
13:4/0/terrain = 2
13:4/0/terrains_peering_bit/bottom_side = 2
13:4/0/terrains_peering_bit/left_side = 1
13:4/0/terrains_peering_bit/top_side = 2
10:5/next_alternative_id = 2
10:5/0 = 0
10:5/0/terrain_set = 0
10:5/0/terrain = 2
10:5/0/terrains_peering_bit/right_side = 2
10:5/0/terrains_peering_bit/left_side = 2
10:5/0/terrains_peering_bit/top_side = 1
11:5/0 = 0
11:5/0/terrain_set = 0
11:5/0/terrain = 2
11:5/0/terrains_peering_bit/right_side = 2
11:5/0/terrains_peering_bit/left_side = 2
11:5/0/terrains_peering_bit/top_side = 1
12:5/next_alternative_id = 2
12:5/0 = 0
12:5/0/terrain_set = 0
12:5/0/terrain = 2
12:5/0/terrains_peering_bit/right_side = 2
12:5/0/terrains_peering_bit/left_side = 2
12:5/0/terrains_peering_bit/top_side = 1
13:5/0 = 0
13:5/0/terrain_set = 0
13:5/0/terrain = 2
13:5/0/terrains_peering_bit/left_side = 2
13:5/0/terrains_peering_bit/top_left_corner = 1
13:5/0/terrains_peering_bit/top_side = 2
9:5/0 = 0
9:5/0/terrain_set = 0
9:5/0/terrain = 2
9:5/0/terrains_peering_bit/right_side = 2
9:5/0/terrains_peering_bit/bottom_left_corner = 1
9:5/0/terrains_peering_bit/top_side = 2
8:5/0 = 0
8:5/0/terrain_set = 0
8:5/0/terrain = 2
8:5/0/terrains_peering_bit/bottom_right_corner = 1
8:5/0/terrains_peering_bit/left_side = 2
8:5/0/terrains_peering_bit/top_side = 2
8:6/0 = 0
8:6/0/terrain_set = 0
8:6/0/terrain = 2
8:6/0/terrains_peering_bit/bottom_side = 2
8:6/0/terrains_peering_bit/left_side = 2
8:6/0/terrains_peering_bit/top_right_corner = 1
9:6/0 = 0
9:6/0/terrain_set = 0
9:6/0/terrain = 2
9:6/0/terrains_peering_bit/right_side = 2
9:6/0/terrains_peering_bit/bottom_side = 2
9:6/0/terrains_peering_bit/top_left_corner = 1
10:6/0 = 0
10:6/0/terrain_set = 0
10:6/0/terrain = 1
10:6/0/terrains_peering_bit/right_side = 1
10:6/0/terrains_peering_bit/bottom_side = 1
10:6/0/terrains_peering_bit/bottom_left_corner = 1
10:6/0/terrains_peering_bit/left_side = 1
10:6/0/terrains_peering_bit/top_left_corner = 1
10:6/0/terrains_peering_bit/top_side = 1
10:6/0/terrains_peering_bit/top_right_corner = 1
10:7/0 = 0
10:7/0/terrain_set = 0
10:7/0/terrain = 1
10:7/0/terrains_peering_bit/right_side = 1
10:7/0/terrains_peering_bit/bottom_right_corner = 1
10:7/0/terrains_peering_bit/bottom_side = 1
10:7/0/terrains_peering_bit/bottom_left_corner = 1
10:7/0/terrains_peering_bit/left_side = 1
10:7/0/terrains_peering_bit/top_left_corner = 1
10:7/0/terrains_peering_bit/top_side = 1
11:7/0 = 0
11:7/0/terrain_set = 0
11:7/0/terrain = 1
11:7/0/terrains_peering_bit/right_side = 1
11:7/0/terrains_peering_bit/bottom_right_corner = 1
11:7/0/terrains_peering_bit/bottom_side = 1
11:7/0/terrains_peering_bit/bottom_left_corner = 1
11:7/0/terrains_peering_bit/left_side = 1
11:7/0/terrains_peering_bit/top_side = 1
11:7/0/terrains_peering_bit/top_right_corner = 1
12:7/0 = 0
12:7/0/terrain_set = 0
12:6/0 = 0
12:6/0/terrain_set = 0
11:6/0 = 0
11:6/0/terrain_set = 0
11:6/0/terrain = 1
11:6/0/terrains_peering_bit/right_side = 1
11:6/0/terrains_peering_bit/bottom_right_corner = 1
11:6/0/terrains_peering_bit/bottom_side = 1
11:6/0/terrains_peering_bit/left_side = 1
11:6/0/terrains_peering_bit/top_left_corner = 1
11:6/0/terrains_peering_bit/top_side = 1
11:6/0/terrains_peering_bit/top_right_corner = 1
13:6/0 = 0
13:6/0/terrain_set = 0
14:6/0 = 0
14:6/0/terrain_set = 0
14:7/0 = 0
14:7/0/terrain_set = 0
13:7/0 = 0
13:7/0/terrain_set = 0
15:6/0 = 0
15:6/0/terrain_set = 0
15:7/0 = 0
15:7/0/terrain_set = 0
14:5/0 = 0
14:5/0/terrain_set = 0
14:5/0/terrain = 2
14:5/0/terrains_peering_bit/right_side = 2
14:5/0/terrains_peering_bit/top_side = 2
14:5/0/terrains_peering_bit/top_right_corner = 1
14:4/0 = 0
14:4/0/terrain_set = 0
14:3/0 = 0
14:3/0/terrain_set = 0
14:2/0 = 0
14:2/0/terrain_set = 0
14:1/0 = 0
14:1/0/terrain_set = 0
14:0/0 = 0
15:1/0 = 0
15:1/0/terrain_set = 0
15:2/0 = 0
15:2/0/terrain_set = 0
15:3/0 = 0
15:3/0/terrain_set = 0
15:4/0 = 0
15:4/0/terrain_set = 0
15:5/0 = 0
15:5/0/terrain_set = 0
15:0/0 = 0
13:0/0 = 0
12:0/0 = 0
[resource] [resource]
tile_size = Vector2i(32, 32) tile_size = Vector2i(32, 32)
@@ -443,4 +722,12 @@ physics_layer_0/collision_layer = 1
terrain_set_0/mode = 0 terrain_set_0/mode = 0
terrain_set_0/terrain_0/name = "Brick" terrain_set_0/terrain_0/name = "Brick"
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1) terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
terrain_set_0/terrain_1/name = "Forested"
terrain_set_0/terrain_1/color = Color(0.48, 0.2712, 0.062399995, 1)
terrain_set_0/terrain_2/name = "Grass"
terrain_set_0/terrain_2/color = Color(0.5769167, 0.86, 0.18059999, 1)
terrain_set_0/terrain_3/name = "Forested-Grass Junction"
terrain_set_0/terrain_3/color = Color(0.255, 0.51, 0.39525005, 1)
terrain_set_0/terrain_4/name = "Terminato Junction"
terrain_set_0/terrain_4/color = Color(0.25, 0.3416667, 0.5, 1)
sources/0 = SubResource("TileSetAtlasSource_blkrv") sources/0 = SubResource("TileSetAtlasSource_blkrv")
+14 -1
View File
@@ -4,6 +4,12 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
public enum JumpKind {
Ground,
Turnback,
Midair
}
public partial class PlayerPhysicsController : CharacterBody2D { public partial class PlayerPhysicsController : CharacterBody2D {
// [Export] // [Export]
// public float RunMultiplier { get; set; } = 1.84f; // public float RunMultiplier { get; set; } = 1.84f;
@@ -11,6 +17,10 @@ public partial class PlayerPhysicsController : CharacterBody2D {
[Signal] [Signal]
public delegate void OnTurnbackJumpEventHandler(bool onJumpPoint, bool isOnWall); public delegate void OnTurnbackJumpEventHandler(bool onJumpPoint, bool isOnWall);
[Signal]
public delegate void OnJumpEventHandler(JumpKind kind, bool isOnGround, bool isOnWall);
[ExportCategory("Accelerations and Impulses")] [ExportCategory("Accelerations and Impulses")]
[Export] [Export]
public float WalkAcceleration { get; set; } = 3f; public float WalkAcceleration { get; set; } = 3f;
@@ -134,6 +144,7 @@ public partial class PlayerPhysicsController : CharacterBody2D {
else _timeOffGround += (float)delta; else _timeOffGround += (float)delta;
if (Input.IsActionJustPressed("jump")) { if (Input.IsActionJustPressed("jump")) {
EmitSignal(SignalName.OnJump, (int)JumpKind.Ground, this.IsOnFloor(), this.IsOnWall());
vely = -_lv; vely = -_lv;
} }
@@ -149,10 +160,11 @@ public partial class PlayerPhysicsController : CharacterBody2D {
vely *= 1/4f; vely *= 1/4f;
} }
if (Input.IsActionJustPressed("turn_back") && vely > 0) { if (Input.IsActionJustPressed("turn_back") && vely > 0 && velx != 0) {
var side = velx > 0 ? PredictiveCollisions.Location.BottomRight : PredictiveCollisions.Location.BottomLeft; var side = velx > 0 ? PredictiveCollisions.Location.BottomRight : PredictiveCollisions.Location.BottomLeft;
if (Predictor.AnyHit(side) && !this.IsOnWall()) { if (Predictor.AnyHit(side) && !this.IsOnWall()) {
EmitSignal(SignalName.OnTurnbackJump, true, this.IsOnWall()); EmitSignal(SignalName.OnTurnbackJump, true, this.IsOnWall());
EmitSignal(SignalName.OnJump, (int)JumpKind.Turnback, this.IsOnFloor(), this.IsOnWall());
var hits = Predictor.GetLastCastHits(side); var hits = Predictor.GetLastCastHits(side);
_ = hits.First(x => { _ = hits.First(x => {
if (x.Obj is null) return false; if (x.Obj is null) return false;
@@ -194,6 +206,7 @@ public partial class PlayerPhysicsController : CharacterBody2D {
} }
if (Input.IsActionJustPressed("jump") && Mathf.Abs(vely) < 2) { if (Input.IsActionJustPressed("jump") && Mathf.Abs(vely) < 2) {
EmitSignal(SignalName.OnJump, (int)JumpKind.Midair, this.IsOnFloor(), this.IsOnWall());
vely = -_lv; vely = -_lv;
} }
+26
View File
@@ -0,0 +1,26 @@
extends AudioStreamPlayer
@export var ground_jump: Array[AudioStream];
@export var midair_jump: Array[AudioStream];
@export var turnback_jump: Array[AudioStream];
enum JumpKind {
Ground = 0,
Turnback = 1,
Midair = 2
}
func _on_character_body_2d_on_jump(kind: JumpKind, isOnGround: bool, isOnWall: bool):
match kind:
JumpKind.Ground:
playSfx(ground_jump)
JumpKind.Turnback:
playSfx(turnback_jump)
JumpKind.Midair:
playSfx(midair_jump)
pass # Replace with function body.
func playSfx(sfx: Array[AudioStream]):
stream = sfx[randi_range(0, sfx.size() - 1)]
play()
+1
View File
@@ -0,0 +1 @@
uid://bwgqvwybyrsmq