Compare commits

...

17 Commits

Author SHA1 Message Date
Kenney f51aa62615 Progress 2024-07-04 19:00:22 +07:00
Kenney 7981d9f283 Merge branch 'main' of https://github.com/KenneyNL/Starter-Kit-3D-Platformer 2024-07-04 18:47:41 +07:00
Kenney d30cfe55d7 Progress 2024-07-04 18:47:32 +07:00
Kenney bbdb2c8e15
Merge pull request #16 from Joseph-DiGiovanni/main
Player movement improvements
2024-07-04 18:44:05 +07:00
Kenney fbbbdd0f06
Merge pull request #13 from tomdevelops/feature/release-4.2
Updates for Release 4.2
2024-07-04 18:33:27 +07:00
Kenney 6bc869e1f8 Update project.godot 2024-07-04 18:31:34 +07:00
Joseph DiGiovanni a5f8ceb985 Improve handling analog movement 2023-12-19 10:25:48 +07:00
Joseph DiGiovanni 91a2c4a89f Simplify jump function 2023-12-16 23:52:28 +07:00
tomdevelops 98961bc881
removed not needed _subresources object in dust.glb.import 2023-10-31 23:29:14 +07:00
tomdevelops 682cd3f93e
fixed cloud scene node ref
removes the warning logs during runtime
2023-10-31 23:05:33 +07:00
tomdevelops 72f82e8d26
added missing antenna node to player scene 2023-10-31 23:05:04 +07:00
tomdevelops 4cbf4a11cd
migrated coin scene format 2023-10-31 23:04:49 +07:00
tomdevelops 1a719c22f8
fixed platforms by integrating the CollisionShape3D into the StaticBody3D 2023-10-31 23:04:19 +07:00
tomdevelops 1a5c4f91a1
moved character nodes to according scene and removed them from player scene 2023-10-31 23:04:03 +07:00
tomdevelops d5d81481d6
*.glb.import files update 2023-10-31 23:03:40 +07:00
tomdevelops 78cf30ac99
updated dust.res asset to new format 2023-10-31 23:02:57 +07:00
tomdevelops e2f140820b
updated project file to v4.2 2023-10-31 23:02:30 +07:00
25 changed files with 278 additions and 81 deletions

@ -2,7 +2,7 @@
# Starter Kit 3D Platformer
This package includes a basic template for a 3D platformer game in Godot 4.1.1.stable.official. Includes features like;
This package includes a basic template for a 3D platformer game in Godot 4.2.2.stable.official. Includes features like;
- Character controller (with double jump)
- Collectable coins and falling platforms
@ -19,7 +19,7 @@ This package includes a basic template for a 3D platformer game in Godot 4.1.1.s
MIT License
Copyright (c) 2023 Kenney
Copyright (c) 2024 Kenney
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:

Binary file not shown.

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,24 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={
"meshes": {
"cloud_cloud": {
"generate/lightmap_uv": 0,
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"save_to_file/enabled": true,
"save_to_file/make_streamable": "",
"save_to_file/path": "res://prefabs/cloud.res"
}
}
}
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -22,6 +22,7 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
@ -29,4 +30,5 @@ animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1

@ -3,3 +3,24 @@
[ext_resource type="PackedScene" uid="uid://xy8rvnjp22n5" path="res://models/character.glb" id="1_vn7w5"]
[node name="character" instance=ExtResource("1_vn7w5")]
[node name="leg-left" parent="character/root" index="0"]
transform = Transform3D(0.965926, 0, 0.258819, 0, 1, 0, -0.258819, 0, 0.965926, 0.125, 0.17625, -0.02375)
[node name="leg-right" parent="character/root" index="1"]
transform = Transform3D(0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -0.125, 0.17625, -0.02375)
[node name="torso" parent="character/root" index="2"]
transform = Transform3D(1, 0, 0, 0, 0.996194, 0.0871557, 0, -0.0871557, 0.996194, -1.80478e-15, 0.17625, -0.02375)
[node name="arm-left" parent="character/root/torso" index="0"]
transform = Transform3D(0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 0.3, 0.175, 0)
[node name="arm-right" parent="character/root/torso" index="1"]
transform = Transform3D(0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0, 0, 1, -0.3, 0.1195, 0)
[node name="antenna" parent="character/root/torso" index="2"]
transform = Transform3D(1, 0, 0, 0, 0.999999, 0, 0, 0, 0.999999, 0, 0.6, 0)
[node name="AnimationPlayer" parent="." index="1"]
deterministic = true

@ -1,17 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://dy017k58p20sk"]
[gd_scene load_steps=3 format=3 uid="uid://dy017k58p20sk"]
[ext_resource type="PackedScene" uid="uid://bsrmqj84lksd7" path="res://models/cloud.glb" id="1_pjiy0"]
[ext_resource type="Script" path="res://objects/cloud.gd" id="2_hugjq"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8nets"]
transparency = 1
distance_fade_mode = 1
distance_fade_min_distance = 2.0
distance_fade_max_distance = 3.0
[node name="cube" instance=ExtResource("1_pjiy0")]
script = ExtResource("2_hugjq")
[node name="cube2" parent="." index="0"]
visibility_range_fade_mode = 1
surface_material_override/0 = SubResource("StandardMaterial3D_8nets")

File diff suppressed because one or more lines are too long

@ -7,7 +7,7 @@ data = PackedVector3Array(-0.9, 0, -0.72, -1, 0.2, -0.8, -1, 0.2, 0.8, -1, 0.2,
[node name="platform" instance=ExtResource("1_xagml")]
[node name="StaticBody3D" type="StaticBody3D" parent="platform2" index="0"]
[node name="platform2#StaticBody3D" type="StaticBody3D" parent="." index="0"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="platform2/StaticBody3D" index="0"]
[node name="platform2_StaticBody3D#CollisionShape3D" type="CollisionShape3D" parent="platform2#StaticBody3D" index="0"]
shape = SubResource("ConcavePolygonShape3D_hyw7p")

File diff suppressed because one or more lines are too long

@ -9,16 +9,16 @@ data = PackedVector3Array(-0.9567, 0.2, 2.3097, 0, 0.2, 2.5, 0, 0, 2.25, 0, 0, 2
[node name="platform-grass-large-round" instance=ExtResource("1_k36fp")]
[node name="grass-small" parent="platform-grass-large-round2" index="0" instance=ExtResource("2_dmbou")]
[node name="platform-grass-large-round2#grass-small" parent="." index="0" instance=ExtResource("2_dmbou")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.2632, 0.490424, 1.54658)
[node name="grass" parent="platform-grass-large-round2" index="1" instance=ExtResource("3_uynxe")]
[node name="platform-grass-large-round2#grass" parent="." index="1" instance=ExtResource("3_uynxe")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.38911, 0.443581, 1.45133)
[node name="grass2" parent="platform-grass-large-round2" index="2" instance=ExtResource("3_uynxe")]
[node name="platform-grass-large-round2#grass2" parent="." index="2" instance=ExtResource("3_uynxe")]
transform = Transform3D(-0.403434, 0, 0.915009, 0, 1, 0, -0.915009, 0, -0.403434, 0.907642, 0.443581, -1.67143)
[node name="StaticBody3D" type="StaticBody3D" parent="platform-grass-large-round2" index="3"]
[node name="platform-grass-large-round2#StaticBody3D" type="StaticBody3D" parent="." index="3"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="platform-grass-large-round2/StaticBody3D" index="0"]
[node name="platform-grass-large-round2_StaticBody3D#CollisionShape3D" type="CollisionShape3D" parent="platform-grass-large-round2#StaticBody3D" index="0"]
shape = SubResource("ConcavePolygonShape3D_xh0ma")

@ -7,7 +7,7 @@ data = PackedVector3Array(1.5, 0.2, 1.3, 1.4, 0, 1.22, 1.355, 0, 1.355, 1.355, 0
[node name="platform-medium" instance=ExtResource("1_ihbp6")]
[node name="StaticBody3D" type="StaticBody3D" parent="platform-medium2" index="0"]
[node name="platform-medium2#StaticBody3D" type="StaticBody3D" parent="." index="0"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="platform-medium2/StaticBody3D" index="0"]
[node name="platform-medium2_StaticBody3D#CollisionShape3D" type="CollisionShape3D" parent="platform-medium2#StaticBody3D" index="0"]
shape = SubResource("ConcavePolygonShape3D_gwolp")

@ -33,20 +33,17 @@ shape = SubResource("CapsuleShape3D_gdq8c")
[node name="Character" parent="." instance=ExtResource("2_nero3")]
[node name="leg-left" parent="Character/character2/root" index="0"]
transform = Transform3D(0.965926, 0, 0.258819, 0, 1, 0, -0.258819, 0, 0.965926, 0.125, 0.17625, -0.02375)
[node name="torso" parent="Character/character/root" index="2"]
transform = Transform3D(1, 0, 0, 0, 0.996194, 0.0871557, 0, -0.0871557, 0.996194, -1.80478e-15, 0.17625, -0.02375)
[node name="leg-right" parent="Character/character2/root" index="1"]
transform = Transform3D(0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -0.125, 0.17625, -0.02375)
[node name="arm-left" parent="Character/character/root/torso" index="0"]
transform = Transform3D(0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 0.3, 0.175, 0)
[node name="torso" parent="Character/character2/root" index="2"]
transform = Transform3D(1, 0, 0, 0, 0.996195, 0.0871557, 0, -0.0871557, 0.996195, -1.80478e-15, 0.17625, -0.02375)
[node name="arm-right" parent="Character/character/root/torso" index="1"]
transform = Transform3D(0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0, 0, 1, -0.3, 0.1195, 0)
[node name="arm-left" parent="Character/character2/root/torso" index="0"]
transform = Transform3D(0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 0.3, 0.2, 0)
[node name="arm-right" parent="Character/character2/root/torso" index="1"]
transform = Transform3D(0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0, 0, 1, -0.3, 0.1445, 0)
[node name="antenna" parent="Character/character/root/torso" index="2"]
transform = Transform3D(1, 0, 0, 0, 0.999999, 0, 0, 0, 0.999999, 0, 0.6, 0)
[node name="Shadow" type="Decal" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.9, 0)

@ -13,7 +13,7 @@ config_version=5
config/name="Starter Kit 3D Platformer"
config/tags=PackedStringArray("starterkit")
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.1", "Forward Plus")
config/features=PackedStringArray("4.2", "Forward Plus")
boot_splash/bg_color=Color(0.92549, 0.92549, 0.960784, 1)
boot_splash/image="res://splash-screen.png"
config/icon="res://icon.png"
@ -31,6 +31,10 @@ window/size/viewport_height=720
movie_writer/movie_file="C:/Users/Kenney/Desktop/video-footage.avi"
[filesystem]
import/blender/enabled=false
[input]
move_right={

@ -0,0 +1,165 @@
[gd_scene load_steps=15 format=3 uid="uid://bqqgyqafm7xwp"]
[ext_resource type="Environment" uid="uid://bqnqgflivjvue" path="res://scenes/main-environment.tres" id="1_ahusb"]
[ext_resource type="PackedScene" uid="uid://dl2ed4gkybggf" path="res://objects/player.tscn" id="2_onms2"]
[ext_resource type="Script" path="res://scripts/view.gd" id="5_bg0fr"]
[ext_resource type="PackedScene" uid="uid://cnymdajj1vsqm" path="res://objects/platform.tscn" id="6_sdmev"]
[ext_resource type="PackedScene" uid="uid://rjh4ifidqrfp" path="res://objects/platform_medium.tscn" id="7_ixpj3"]
[ext_resource type="PackedScene" uid="uid://uqr4hswv6d2g" path="res://objects/platform_grass_large_round.tscn" id="8_4oh1e"]
[ext_resource type="PackedScene" uid="uid://c8up71en5djgm" path="res://objects/platform_falling.tscn" id="9_2fnpo"]
[ext_resource type="PackedScene" uid="uid://dtjvjdjl8cs6e" path="res://models/flag.glb" id="9_fw1f5"]
[ext_resource type="PackedScene" uid="uid://dfpisimsgf5ce" path="res://objects/coin.tscn" id="10_fwhys"]
[ext_resource type="Script" path="res://scripts/hud.gd" id="11_apvpm"]
[ext_resource type="PackedScene" uid="uid://dy017k58p20sk" path="res://objects/cloud.tscn" id="13_drtpy"]
[ext_resource type="Texture2D" uid="uid://cd7oyc56ehkx1" path="res://sprites/coin.png" id="13_jfda3"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="17_tk810"]
[sub_resource type="LabelSettings" id="LabelSettings_38ys3"]
font = ExtResource("17_tk810")
font_size = 48
shadow_color = Color(0, 0, 0, 0.376471)
shadow_offset = Vector2(2, 2)
[node name="Main" type="Node3D"]
[node name="Environment" type="WorldEnvironment" parent="."]
environment = ExtResource("1_ahusb")
[node name="Player" parent="." node_paths=PackedStringArray("view") instance=ExtResource("2_onms2")]
view = NodePath("../View")
[node name="View" type="Node3D" parent="." node_paths=PackedStringArray("target")]
transform = Transform3D(0.707107, -0.298836, 0.640856, 0, 0.906308, 0.422618, -0.707107, -0.298836, 0.640856, 0, 0, 0)
script = ExtResource("5_bg0fr")
target = NodePath("../Player")
[node name="Camera" type="Camera3D" parent="View"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
current = true
fov = 40.0
[node name="World" type="Node3D" parent="."]
[node name="platform" parent="World" instance=ExtResource("6_sdmev")]
transform = Transform3D(0.993085, 0, -0.117399, 0, 1, 0, 0.117399, 0, 0.993085, 0, 0, 0)
[node name="platform4" parent="World" instance=ExtResource("6_sdmev")]
transform = Transform3D(0.993085, 0, -0.117399, 0, 1, 0, 0.117399, 0, 0.993085, -15, 0, 4)
[node name="platform2" parent="World" instance=ExtResource("6_sdmev")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 2, -3)
[node name="platform3" parent="World" instance=ExtResource("6_sdmev")]
transform = Transform3D(0.966237, 0, -0.257656, 0, 1, 0, 0.257656, 0, 0.966237, -3, 3, -5)
[node name="platform-medium" parent="World" instance=ExtResource("7_ixpj3")]
transform = Transform3D(0.996134, 0, 0.0878512, 0, 1, 0, -0.0878512, 0, 0.996134, -3, 0, 0)
[node name="platform-medium2" parent="World" instance=ExtResource("7_ixpj3")]
transform = Transform3D(0.995121, 0, 0.0986598, 0, 1, 0, -0.0986598, 0, 0.995121, -5, 0, 4)
[node name="platform-medium4" parent="World" instance=ExtResource("7_ixpj3")]
transform = Transform3D(0.929796, 0, -0.368076, 0, 1, 0, 0.368076, 0, 0.929796, -14.9422, 0.991941, 0.128304)
[node name="platform-medium3" parent="World" instance=ExtResource("7_ixpj3")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -6)
[node name="platform-falling" parent="World" instance=ExtResource("9_2fnpo")]
transform = Transform3D(0.984808, 0, 0.173648, 0, 1, 0, -0.173648, 0, 0.984808, -9, 0.419294, 4)
[node name="platform-falling2" parent="World" instance=ExtResource("9_2fnpo")]
transform = Transform3D(0.994522, 0, -0.104528, 0, 1, 0, 0.104528, 0, 0.994522, -12, -0.315063, 4)
[node name="platform-falling3" parent="World" instance=ExtResource("9_2fnpo")]
transform = Transform3D(0.939693, 0, 0.34202, 0, 1, 0, -0.34202, 0, 0.939693, -11.7527, 1.8303, -2.30579)
[node name="platform-grass-large-round" parent="World" instance=ExtResource("8_4oh1e")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, 1, -2)
[node name="flag" parent="World" instance=ExtResource("9_fw1f5")]
transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 0, 3.48077, -6)
[node name="coin" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0.635, 0)
[node name="coin10" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 0.635, 4)
[node name="coin2" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.0437, 1.97005, -0.33003)
[node name="coin3" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.0437, 1.97005, -1.33003)
[node name="coin5" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.7731, 2.54941, -2.28223)
[node name="coin6" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.8111, 1.6888, 0.328574)
[node name="coin7" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.8111, 2.6888, 0.328574)
[node name="coin8" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.9647, 0.801836, 3.99354)
[node name="coin9" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, -6)
[node name="coin4" parent="World" instance=ExtResource("10_fwhys")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.0437, 1.97005, -2.33003)
[node name="cube8" parent="World" instance=ExtResource("13_drtpy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5495, 1.10741, -2.666)
[node name="cube9" parent="World" instance=ExtResource("13_drtpy")]
transform = Transform3D(1.27593, -0.401864, 0.422933, 0.471408, 1.30937, -0.178025, -0.343721, 0.304009, 1.32582, 3.33538, 1.37146, -4.1932)
[node name="cube10" parent="World" instance=ExtResource("13_drtpy")]
transform = Transform3D(1.32811, 0.370441, 0.259369, -0.293866, 1.3186, -0.37854, -0.34372, 0.30401, 1.32582, -10.5752, 2.03819, -7.93707)
[node name="cube11" parent="World" instance=ExtResource("13_drtpy")]
transform = Transform3D(0.476646, 0.924607, 0.941422, -0.929853, 0.945559, -0.457882, -0.93624, -0.468385, 0.934042, -11.1815, 2.03819, 9.2812)
[node name="cube12" parent="World" instance=ExtResource("13_drtpy")]
transform = Transform3D(-1.02876, -0.695523, 0.652886, -0.929853, 0.945557, -0.457881, -0.213027, -0.768461, -1.15432, -10.9158, 2.79508, 11.515)
[node name="cube13" parent="World" instance=ExtResource("13_drtpy")]
transform = Transform3D(1.56209, -1.37982, 1.71508, 1.97375, 1.80907, -0.342241, -0.974547, 1.4522, 2.05595, -14.3045, 2.03819, -8.24191)
[node name="cube14" parent="World" instance=ExtResource("13_drtpy")]
transform = Transform3D(1.56209, -1.37982, 1.71508, 1.97375, 1.80907, -0.342241, -0.974547, 1.4522, 2.05595, -15.866, 2.03819, 7.83702)
[node name="Sun" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
shadow_enabled = true
shadow_opacity = 0.75
[node name="HUD" type="CanvasLayer" parent="."]
script = ExtResource("11_apvpm")
[node name="Icon" type="TextureRect" parent="HUD"]
offset_left = 57.0
offset_top = 67.0
offset_right = 313.0
offset_bottom = 323.0
scale = Vector2(0.2, 0.2)
texture = ExtResource("13_jfda3")
[node name="x" type="Label" parent="HUD"]
offset_left = 112.0
offset_top = 64.0
offset_right = 144.0
offset_bottom = 123.0
text = "×"
label_settings = SubResource("LabelSettings_38ys3")
[node name="Coins" type="Label" parent="HUD"]
offset_left = 144.0
offset_top = 64.0
offset_right = 368.0
offset_bottom = 123.0
text = "0"
label_settings = SubResource("LabelSettings_38ys3")
[connection signal="coin_collected" from="Player" to="HUD" method="_on_coin_collected"]

@ -34,7 +34,7 @@ func _physics_process(delta):
handle_controls(delta)
handle_gravity(delta)
handle_effects()
handle_effects(delta)
# Movement
@ -72,20 +72,28 @@ func _physics_process(delta):
# Handle animation(s)
func handle_effects():
func handle_effects(delta):
particles_trail.emitting = false
sound_footsteps.stream_paused = true
if is_on_floor():
if abs(velocity.x) > 1 or abs(velocity.z) > 1:
animation.play("walk", 0.5)
particles_trail.emitting = true
sound_footsteps.stream_paused = false
var horizontal_velocity = Vector2(velocity.x, velocity.z)
var speed_factor = horizontal_velocity.length() / movement_speed / delta
if speed_factor > 0.05:
animation.play("walk", 0, speed_factor)
if speed_factor > 0.3:
sound_footsteps.stream_paused = false
sound_footsteps.pitch_scale = speed_factor
if speed_factor > 0.75:
particles_trail.emitting = true
else:
animation.play("idle", 0.5)
animation.play("idle", 0)
else:
animation.play("jump", 0.5)
animation.play("jump", 0)
# Handle movement input
@ -98,8 +106,11 @@ func handle_controls(delta):
input.x = Input.get_axis("move_left", "move_right")
input.z = Input.get_axis("move_forward", "move_back")
input = input.rotated(Vector3.UP, view.rotation.y).normalized()
input = input.rotated(Vector3.UP, view.rotation.y)
if input.length() > 1:
input = input.normalized()
movement_velocity = input * movement_speed * delta
# Jumping
@ -107,16 +118,7 @@ func handle_controls(delta):
if Input.is_action_just_pressed("jump"):
if jump_single or jump_double:
Audio.play("res://sounds/jump.ogg")
if jump_double:
gravity = -jump_strength
jump_double = false
model.scale = Vector3(0.5, 1.5, 0.5)
if(jump_single): jump()
jump()
# Handle gravity
@ -133,12 +135,17 @@ func handle_gravity(delta):
func jump():
Audio.play("res://sounds/jump.ogg")
gravity = -jump_strength
model.scale = Vector3(0.5, 1.5, 0.5)
jump_single = false;
jump_double = true;
if jump_single:
jump_single = false;
jump_double = true;
else:
jump_double = false;
# Collecting coins