Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MudkipWorld committed Jan 16, 2024
1 parent dafba7a commit 304ce78
Show file tree
Hide file tree
Showing 161 changed files with 8,603 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/
10 changes: 10 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Destruction Addon
Upstream-Contact: Jummit <[email protected]>
Source: https://github.com/Jummit/godot-destruction-plugin

# Sample paragraph, commented out:
#
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ 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.
SOFTWARE.
47 changes: 47 additions & 0 deletions MainGame/Boxes/Crate/Crate.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[gd_scene load_steps=8 format=3 uid="uid://b14gltuupxexw"]

[ext_resource type="PackedScene" uid="uid://du042mywjnwvm" path="res://MainGame/Boxes/Crate/CrateMesh.glb" id="1_hl02m"]
[ext_resource type="Script" path="res://addons/destruction/destruction.gd" id="3_a7ndj"]
[ext_resource type="PackedScene" uid="uid://drwmv1yi2qbee" path="res://MainGame/Boxes/Crate/Cratebroken.tscn" id="4_orl4x"]

[sub_resource type="BoxShape3D" id="BoxShape3D_1nlou"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0x4ar"]
albedo_color = Color(0.564706, 0.478431, 0.462745, 1)
uv1_scale = Vector3(0.5, 0.5, 0.5)
uv1_triplanar = true
uv1_triplanar_sharpness = 0.210224

[sub_resource type="BoxMesh" id="BoxMesh_dwytp"]
lightmap_size_hint = Vector2i(14, 21)
material = SubResource("StandardMaterial3D_0x4ar")

[sub_resource type="BoxShape3D" id="BoxShape3D_qxq1c"]

[node name="Crate" type="RigidBody3D"]
mass = 10.0

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1.74925, 0, 0, 0, 1.74925, 0, 0, 0, 1.74925, 0, 0, 0)
shape = SubResource("BoxShape3D_1nlou")

[node name="CrateMesh" parent="." instance=ExtResource("1_hl02m")]
transform = Transform3D(1.94856, 0, 0, 0, 1.94856, 0, 0, 0, 1.94856, 0, 0, 0)

[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1.74925, 0, 0, 0, 1.74925, 0, 0, 0, 1.74925, 0, 0, 0)
visible = false
mesh = SubResource("BoxMesh_dwytp")

[node name="ObjColl" type="Area3D" parent="."]
transform = Transform3D(1.74925, 0, 0, 0, 1.74925, 0, 0, 0, 1.74925, 0, 0, 0)

[node name="CollisionShape3D" type="CollisionShape3D" parent="ObjColl"]
shape = SubResource("BoxShape3D_qxq1c")

[node name="Destruction" type="Node" parent="." node_paths=PackedStringArray("shard_container")]
script = ExtResource("3_a7ndj")
fragmented = ExtResource("4_orl4x")
shard_container = NodePath("../..")
collision_layer = 2
collision_mask = 3
Binary file added MainGame/Boxes/Crate/CrateMesh.glb
Binary file not shown.
34 changes: 34 additions & 0 deletions MainGame/Boxes/Crate/CrateMesh.glb.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="scene"
importer_version=1
type="PackedScene"
uid="uid://du042mywjnwvm"
path="res://.godot/imported/CrateMesh.glb-90bef794a69498ec2103534411b8f592.scn"

[deps]

source_file="res://MainGame/Boxes/Crate/CrateMesh.glb"
dest_files=["res://.godot/imported/CrateMesh.glb-90bef794a69498ec2103534411b8f592.scn"]

[params]

nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
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={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Binary file added MainGame/Boxes/Crate/CrateMesh_Cube2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions MainGame/Boxes/Crate/CrateMesh_Cube2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bqjg102megbcs"
path.s3tc="res://.godot/imported/CrateMesh_Cube2.png-4ec474cddb37cff3506b24703f183bef.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}

[deps]

source_file="res://MainGame/Boxes/Crate/CrateMesh_Cube2.png"
dest_files=["res://.godot/imported/CrateMesh_Cube2.png-4ec474cddb37cff3506b24703f183bef.s3tc.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0
Binary file added MainGame/Boxes/Crate/CrateTexture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions MainGame/Boxes/Crate/CrateTexture.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://drvbhg6jx15i1"
path.s3tc="res://.godot/imported/CrateTexture.png-a4a2cfee50772501ce1082c813bcb7d8.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}

[deps]

source_file="res://MainGame/Boxes/Crate/CrateTexture.png"
dest_files=["res://.godot/imported/CrateTexture.png-a4a2cfee50772501ce1082c813bcb7d8.s3tc.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0
1,010 changes: 1,010 additions & 0 deletions MainGame/Boxes/Crate/Cratebroken.tscn

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions MainGame/Characters/Enemies/EnemyRes/EnemyResources.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends Resource

@export var hearts : int = 5
@export var health : int = clamp(hearts, 0,100)
@export var atk_damage : int = 1

8 changes: 8 additions & 0 deletions MainGame/Characters/Enemies/EnemyRes/EnemyResources.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://46g00hgr34ce"]

[ext_resource type="Script" path="res://MainGame/Characters/Enemies/EnemyRes/EnemyResources.gd" id="1_vnjy4"]

[resource]
script = ExtResource("1_vnjy4")
health = 5
atk_damage = 1
53 changes: 53 additions & 0 deletions MainGame/Characters/Enemies/TestEnemy/test_turtle.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
extends CharacterBody3D


const SPEED = 4.0
var target_pos : Vector3
var accel = 10
@onready var nav = $NavigationAgent3D
@onready var ray = $TurtlePlaceholder/RayCast3D



# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")

func _ready() -> void:
target_pos = Vector3(randf_range(position.x -5, position.x +5), position.y,randf_range(position.z -5, position.z +5) )
nav.target_position = target_pos


func _physics_process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
velocity.y -= gravity * delta


if not ray.is_colliding():
target_pos = Vector3(randf_range(position.x -5, position.x +5), position.y,randf_range(position.z -5, position.z +5) )
nav.target_position = target_pos

elif is_on_wall():
target_pos = Vector3(randf_range(position.x -5, position.x +5), position.y,randf_range(position.z -5, position.z +5) )
nav.target_position = target_pos

if is_on_floor():
var move_dire = Vector3()
move_dire = nav.get_next_path_position() - nav.target_position
move_dire = move_dire.normalized()



velocity = velocity.lerp(move_dire * SPEED, accel * delta)
if move_dire:
var dir = Vector2(velocity.z, velocity.x)
$TurtlePlaceholder.rotation.y = dir.angle()


move_and_slide()


func _on_navigation_agent_3d_target_reached() -> void:
target_pos = Vector3(randf_range(position.x -5, position.x +5), position.y,randf_range(position.z -5, position.z +5) )
nav.target_position = target_pos

99 changes: 99 additions & 0 deletions MainGame/Characters/Enemies/TestEnemy/test_turtle.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[gd_scene load_steps=9 format=3 uid="uid://bixphfhf6n33p"]

[ext_resource type="Script" path="res://MainGame/Characters/Enemies/TestEnemy/test_turtle.gd" id="1_y2p5a"]
[ext_resource type="Resource" uid="uid://46g00hgr34ce" path="res://MainGame/Characters/Enemies/EnemyRes/EnemyResources.tres" id="2_6udgb"]

[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ania8"]
radius = 0.9
height = 2.6

[sub_resource type="CapsuleMesh" id="CapsuleMesh_fm1xj"]
radius = 1.0

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_3dw4m"]
albedo_color = Color(0.427451, 0.32549, 0.54902, 1)

[sub_resource type="CapsuleMesh" id="CapsuleMesh_4n35i"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pujtx"]
albedo_color = Color(0.556863, 0.717647, 0.341176, 1)

[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_463rv"]
radius = 1.0
height = 2.5

[node name="TestTurtle" type="CharacterBody3D"]
collision_layer = 6
script = ExtResource("1_y2p5a")
metadata/EnemyInfo = ExtResource("2_6udgb")

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.187738, 0.197757)
shape = SubResource("CapsuleShape3D_ania8")

[node name="TurtlePlaceholder" type="MeshInstance3D" parent="."]
transform = Transform3D(0.886122, 0, 0, 0, -4.37114e-08, -0.619613, 0, 1, -2.70841e-08, 0, 0, 0)
mesh = SubResource("CapsuleMesh_fm1xj")
surface_material_override/0 = SubResource("StandardMaterial3D_3dw4m")

[node name="MeshInstance3D4" type="MeshInstance3D" parent="TurtlePlaceholder"]
transform = Transform3D(0.441291, 0, 0, 0, -1.70928e-08, 0.391038, 0, -0.631101, -2.75863e-08, -0.576369, -0.542631, 0.582854)
mesh = SubResource("CapsuleMesh_4n35i")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_pujtx")

[node name="MeshInstance3D6" type="MeshInstance3D" parent="TurtlePlaceholder"]
transform = Transform3D(0.717111, 0, 0, 0, 0.149105, 0.552934, 0, -0.613234, 0.134443, 0.0434555, 0.917973, -0.417808)
mesh = SubResource("CapsuleMesh_4n35i")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_pujtx")

[node name="MeshInstance3D7" type="MeshInstance3D" parent="TurtlePlaceholder"]
transform = Transform3D(0.717111, 0, 0, 0, 0.492299, -0.1305, 0, 0.0610574, 1.05221, 0.0434555, 1.21948, -1.26105)
mesh = SubResource("CapsuleMesh_4n35i")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_pujtx")

[node name="MeshInstance3D3" type="MeshInstance3D" parent="TurtlePlaceholder"]
transform = Transform3D(0.441291, 0, 0, 0, -1.70928e-08, 0.391038, 0, -0.631101, -2.75863e-08, 0.624465, 0.444598, 0.582854)
mesh = SubResource("CapsuleMesh_4n35i")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_pujtx")

[node name="MeshInstance3D5" type="MeshInstance3D" parent="TurtlePlaceholder"]
transform = Transform3D(0.441291, 0, 0, 0, -1.70928e-08, 0.391038, 0, -0.631101, -2.75863e-08, -0.576369, 0.444598, 0.582854)
mesh = SubResource("CapsuleMesh_4n35i")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_pujtx")

[node name="MeshInstance3D2" type="MeshInstance3D" parent="TurtlePlaceholder"]
transform = Transform3D(0.441291, 0, 0, 0, -1.70928e-08, 0.391038, 0, -0.631101, -2.75863e-08, 0.624465, -0.542631, 0.582854)
mesh = SubResource("CapsuleMesh_4n35i")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_pujtx")

[node name="RayCast3D" type="RayCast3D" parent="TurtlePlaceholder"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 1.05472, 0.430387)
target_position = Vector3(0, -2.5, 0)

[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
navigation_layers = 7
avoidance_enabled = true
height = 3.16
radius = 5.54
neighbor_distance = 121.94
use_3d_avoidance = true
avoidance_layers = 7
avoidance_mask = 7
debug_enabled = true
debug_use_custom = true
debug_path_custom_color = Color(1, 0, 0, 1)

[node name="EnemyColl" type="Area3D" parent="."]
collision_layer = 7

[node name="EnemyAreaColl" type="CollisionShape3D" parent="EnemyColl"]
transform = Transform3D(1.22854, 0, 0, 0, -4.96075e-08, -1.27272, 0, 1.13489, -5.56323e-08, 0, 0.224619, 0.117018)
shape = SubResource("CapsuleShape3D_463rv")

[connection signal="target_reached" from="NavigationAgent3D" to="." method="_on_navigation_agent_3d_target_reached"]
5 changes: 5 additions & 0 deletions MainGame/Characters/Players/PlayerRes/PlayerResources.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends Resource

@export var hearts : int = 5
@export var health : int
@export var lives : int = 3
9 changes: 9 additions & 0 deletions MainGame/Characters/Players/PlayerRes/PlayerResources.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bretvu3orawxs"]

[ext_resource type="Script" path="res://MainGame/Characters/Players/PlayerRes/PlayerResources.gd" id="1_tbit7"]

[resource]
script = ExtResource("1_tbit7")
hearts = 5
health = 5
lives = 5
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 304ce78

Please sign in to comment.