Compare commits
No commits in common. "a8465d996234ef5eef9d74d31e4497220197a4ff" and "f6931cf64ff324727145f967e5e93332ac2f648e" have entirely different histories.
a8465d9962
...
f6931cf64f
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cdm267rtmop75"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://dd64j7xcfl6io"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://7utef1nnena8" path="res://player.tscn" id="1_jbc4n"]
|
||||
[ext_resource type="PackedScene" uid="uid://dl4g083w17qh1" path="res://villager.tscn" id="2_i3gws"]
|
||||
[ext_resource type="PackedScene" uid="uid://e0s4phx2jiit" path="res://cultist.tscn" id="3_renxb"]
|
||||
[ext_resource type="PackedScene" uid="uid://csqyxbjumla33" path="res://player.tscn" id="1_jbc4n"]
|
||||
[ext_resource type="PackedScene" uid="uid://cnnsy8h0dq5y1" path="res://villager.tscn" id="2_i3gws"]
|
||||
[ext_resource type="PackedScene" uid="uid://rn1bmw0lf1lr" path="res://cultist.tscn" id="3_renxb"]
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_62oje"]
|
||||
radius = 80.229
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
# Blender MTL File: 'Barn.blend'
|
||||
# Material Count: 4
|
||||
|
||||
newmtl DarkRed
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.202353 0.042520 0.032067
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl LightRed
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.273903 0.056039 0.041967
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl RoofBlack
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.078802 0.078802 0.078802
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl White
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="wavefront_obj"
|
||||
importer_version=1
|
||||
type="Mesh"
|
||||
uid="uid://cjhaw2h3mvhkk"
|
||||
path="res://.godot/imported/Barn.obj-fde21b6feac1c5c0b3e5db375b44e1fa.mesh"
|
||||
|
||||
[deps]
|
||||
|
||||
files=["res://.godot/imported/Barn.obj-fde21b6feac1c5c0b3e5db375b44e1fa.mesh"]
|
||||
|
||||
source_file="res://Models/Barn.obj"
|
||||
dest_files=["res://.godot/imported/Barn.obj-fde21b6feac1c5c0b3e5db375b44e1fa.mesh", "res://.godot/imported/Barn.obj-fde21b6feac1c5c0b3e5db375b44e1fa.mesh"]
|
||||
|
||||
[params]
|
||||
|
||||
generate_tangents=true
|
||||
scale_mesh=Vector3(1, 1, 1)
|
||||
offset_mesh=Vector3(0, 0, 0)
|
||||
optimize_mesh=true
|
|
@ -1,72 +0,0 @@
|
|||
# Blender MTL File: 'Silo_House.blend'
|
||||
# Material Count: 7
|
||||
|
||||
newmtl Black
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.031250 0.029233 0.031743
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Brown
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.224804 0.076709 0.037364
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl DarkGrey
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.176204 0.176204 0.176204
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl DarkRed
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.202353 0.042520 0.032067
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl Grey
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.350832 0.350832 0.350832
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl LightRed
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.273903 0.056039 0.041967
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
|
||||
newmtl White
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="wavefront_obj"
|
||||
importer_version=1
|
||||
type="Mesh"
|
||||
uid="uid://cv1n88kp1gy2i"
|
||||
path="res://.godot/imported/Silo_House.obj-c77ee50e31090452405f711d3ffdd658.mesh"
|
||||
|
||||
[deps]
|
||||
|
||||
files=["res://.godot/imported/Silo_House.obj-c77ee50e31090452405f711d3ffdd658.mesh"]
|
||||
|
||||
source_file="res://Models/Silo_House.obj"
|
||||
dest_files=["res://.godot/imported/Silo_House.obj-c77ee50e31090452405f711d3ffdd658.mesh", "res://.godot/imported/Silo_House.obj-c77ee50e31090452405f711d3ffdd658.mesh"]
|
||||
|
||||
[params]
|
||||
|
||||
generate_tangents=true
|
||||
scale_mesh=Vector3(1, 1, 1)
|
||||
offset_mesh=Vector3(0, 0, 0)
|
||||
optimize_mesh=true
|
|
@ -4,7 +4,6 @@
|
|||
[ext_resource type="Script" path="res://Models/grape_man.gd" id="2_ksje8"]
|
||||
|
||||
[node name="grape_man" instance=ExtResource("1_fh5yr")]
|
||||
transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0)
|
||||
script = ExtResource("2_ksje8")
|
||||
|
||||
[node name="Skeleton3D" parent="rig" index="0"]
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://difi2tur2j4dg"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dfyt6kjw8yli" path="res://Models/island.glb" id="1_5vc8b"]
|
||||
[ext_resource type="Material" uid="uid://yuhlhpwji3c4" path="res://Textures/sand.tres" id="2_bmkng"]
|
||||
[ext_resource type="Material" uid="uid://b88xmds4mx7rd" path="res://Textures/grass.tres" id="2_knbpa"]
|
||||
[ext_resource type="Material" uid="uid://yuhlhpwji3c4" path="res://Textures/dirt.tres" id="2_twsru"]
|
||||
|
||||
[node name="island" instance=ExtResource("1_5vc8b")]
|
||||
|
||||
[node name="Island" parent="." index="0"]
|
||||
material_override = ExtResource("2_twsru")
|
||||
material_override = ExtResource("2_bmkng")
|
||||
|
||||
[node name="Island_001" parent="." index="1"]
|
||||
material_override = ExtResource("2_knbpa")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://d3ccrfjpg4hbv"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b56skjdfurygh" path="res://Models/PalmCurved.glb" id="1_snqoj"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood.png" id="2_pwgeo"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood1.png" id="2_yi8j6"]
|
||||
[ext_resource type="Material" uid="uid://dudwc12l32jc1" path="res://Textures/leaves.tres" id="4_1vrev"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p2v08"]
|
||||
albedo_texture = ExtResource("2_pwgeo")
|
||||
albedo_texture = ExtResource("2_yi8j6")
|
||||
|
||||
[node name="PalmCurved" instance=ExtResource("1_snqoj")]
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
[ext_resource type="PackedScene" uid="uid://7c7deqr02ce6" path="res://Models/PalmDefault.glb" id="1_wlpps"]
|
||||
[ext_resource type="Material" uid="uid://dudwc12l32jc1" path="res://Textures/leaves.tres" id="2_xkp4w"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood.png" id="3_a0k7p"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood1.png" id="3_vowun"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_81n3a"]
|
||||
albedo_texture = ExtResource("3_a0k7p")
|
||||
albedo_texture = ExtResource("3_vowun")
|
||||
|
||||
[node name="PalmDefault" instance=ExtResource("1_wlpps")]
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
[ext_resource type="PackedScene" uid="uid://bx4qhi6ucs6g1" path="res://Models/PalmYoung.glb" id="1_aeax5"]
|
||||
[ext_resource type="Material" uid="uid://dudwc12l32jc1" path="res://Textures/leaves.tres" id="2_6pvnm"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood.png" id="3_u0erk"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood1.png" id="3_ynktd"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tug8p"]
|
||||
albedo_texture = ExtResource("3_u0erk")
|
||||
albedo_texture = ExtResource("3_ynktd")
|
||||
|
||||
[node name="PalmYoung" instance=ExtResource("1_aeax5")]
|
||||
|
||||
|
|
|
@ -26,17 +26,17 @@ states/Walk/position = Vector2(329, 155)
|
|||
transitions = ["Walk", "Idle", SubResource("AnimationNodeStateMachineTransition_n3s05"), "Idle", "Walk", SubResource("AnimationNodeStateMachineTransition_fbi2x"), "Start", "Idle", SubResource("AnimationNodeStateMachineTransition_srcja")]
|
||||
|
||||
[node name="slime" instance=ExtResource("1_jttw0")]
|
||||
transform = Transform3D(0.035, 0, 0, 0, 0.035, 0, 0, 0, 0.035, 0, 0, 0)
|
||||
script = ExtResource("2_xo27e")
|
||||
|
||||
[node name="Skeleton3D" parent="Armature" index="0"]
|
||||
bones/1/position = Vector3(0, 0.408076, 0)
|
||||
bones/2/rotation = Quaternion(-0.0627444, 0.00212883, -0.213248, 0.974979)
|
||||
bones/3/rotation = Quaternion(0.100834, -0.698956, 0.0125015, 0.707911)
|
||||
bones/7/rotation = Quaternion(-0.275892, 2.28845e-09, 2.79242e-09, 0.961189)
|
||||
bones/8/rotation = Quaternion(0.131738, -8.57356e-10, -5.26868e-10, 0.991285)
|
||||
bones/10/rotation = Quaternion(0.275768, -5.73458e-08, -4.54648e-08, 0.961224)
|
||||
bones/11/rotation = Quaternion(-0.131755, 8.86793e-08, 4.46748e-08, 0.991282)
|
||||
bones/1/position = Vector3(0, 0.264857, 0)
|
||||
bones/2/position = Vector3(0.028393, 0.513056, 0.0124737)
|
||||
bones/2/rotation = Quaternion(-0.178538, 0.0193832, -0.211014, 0.960844)
|
||||
bones/3/rotation = Quaternion(0.109512, -0.695192, 0.00400734, 0.710422)
|
||||
bones/7/rotation = Quaternion(-0.347763, 2.02718e-09, 2.9685e-09, 0.937583)
|
||||
bones/8/rotation = Quaternion(-0.091967, -7.45328e-10, -7.10578e-10, 0.995762)
|
||||
bones/10/rotation = Quaternion(0.0144373, -4.10082e-08, -1.82391e-09, 0.999896)
|
||||
bones/11/rotation = Quaternion(-0.373719, 8.36829e-08, 6.89615e-08, 0.927542)
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="." index="2"]
|
||||
tree_root = SubResource("AnimationNodeStateMachine_prt7l")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
extends CharacterBody3D
|
||||
|
||||
|
||||
const SPEED = 5.0
|
||||
const JUMP_VELOCITY = 4.5
|
||||
@export var horiz_sens = 0.25
|
||||
|
@ -12,6 +13,9 @@ var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
|
|||
|
||||
func _ready():
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
playerCam = get_node("CameraMount") as Node3D
|
||||
playerVisuals = get_node("grape_man") as Node3D
|
||||
|
||||
|
||||
func _process(delta):
|
||||
# Brings your mouse out of the window if you press escape. Add pause screen function here?
|
||||
|
@ -24,17 +28,19 @@ func _input(event):
|
|||
if event is InputEventMouseMotion:
|
||||
# Side to side, first player object then player visuals.
|
||||
rotate_y(deg_to_rad(-event.relative.x * horiz_sens))
|
||||
$grape_man.rotate_y(deg_to_rad(event.relative.x * horiz_sens))
|
||||
playerVisuals.rotate_y(deg_to_rad(event.relative.x * horiz_sens))
|
||||
|
||||
# Vertical camera rotation.
|
||||
playerCam.rotate_x(deg_to_rad(-event.relative.y * vert_sens))
|
||||
$CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11))
|
||||
|
||||
func _physics_process(delta):
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity.y -= gravity * delta
|
||||
|
||||
# Handle Jump.
|
||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||
velocity.y = JUMP_VELOCITY
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
|
|
BIN
godot/Textures/Elements_15-128x128.png (Stored with Git LFS)
BIN
godot/Textures/Elements_15-128x128.png (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
|
@ -2,8 +2,8 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d0onbp1v5c7s3"
|
||||
path.s3tc="res://.godot/imported/Elements_15-128x128.png-39888977615198f49985dd432e248679.s3tc.ctex"
|
||||
uid="uid://cg4en6vvbibj3"
|
||||
path.s3tc="res://.godot/imported/grass2.png-937551ccce52f42d9f9c12c7cf49916c.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
|
@ -11,8 +11,8 @@ metadata={
|
|||
|
||||
[deps]
|
||||
|
||||
source_file="res://Textures/Elements_15-128x128.png"
|
||||
dest_files=["res://.godot/imported/Elements_15-128x128.png-39888977615198f49985dd432e248679.s3tc.ctex"]
|
||||
source_file="res://Textures/grass2.png"
|
||||
dest_files=["res://.godot/imported/grass2.png-937551ccce52f42d9f9c12c7cf49916c.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://dudwc12l32jc1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood.png" id="1_5s240"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqdi13k4hs5vb" path="res://Textures/wood1.png" id="1_5s240"]
|
||||
[ext_resource type="Texture2D" uid="uid://d0pddcjy8uhp" path="res://Textures/leaves3.png" id="2_blarx"]
|
||||
|
||||
[resource]
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://c3u8uoiywkd2n"]
|
||||
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://c3u8uoiywkd2n"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://d0onbp1v5c7s3" path="res://Textures/Elements_15-128x128.png" id="1_02nrx"]
|
||||
[ext_resource type="Texture2D" uid="uid://d0pddcjy8uhp" path="res://Textures/leaves3.png" id="1_x366e"]
|
||||
|
||||
[resource]
|
||||
albedo_color = Color(0.219608, 0.772549, 0.67451, 1)
|
||||
albedo_texture = ExtResource("1_02nrx")
|
||||
albedo_color = Color(0.101961, 0.517647, 0.729412, 1)
|
||||
normal_texture = ExtResource("1_x366e")
|
||||
uv1_scale = Vector3(15, 15, 15)
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cwhif8yubo7pv"
|
||||
path.s3tc="res://.godot/imported/weirding2.png-0ec272148c017c4eeacae4dee370838c.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Textures/weirding2.png"
|
||||
dest_files=["res://.godot/imported/weirding2.png-0ec272148c017c4eeacae4dee370838c.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
|
|
@ -3,7 +3,7 @@
|
|||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cqdi13k4hs5vb"
|
||||
path.s3tc="res://.godot/imported/wood.png-e9bea9d81f4e9a138b221cec4feecdec.s3tc.ctex"
|
||||
path.s3tc="res://.godot/imported/wood1.png-e14cdc49f9065a35c75e56b56e461231.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
|
@ -11,8 +11,8 @@ metadata={
|
|||
|
||||
[deps]
|
||||
|
||||
source_file="res://Textures/wood.png"
|
||||
dest_files=["res://.godot/imported/wood.png-e9bea9d81f4e9a138b221cec4feecdec.s3tc.ctex"]
|
||||
source_file="res://Textures/wood1.png"
|
||||
dest_files=["res://.godot/imported/wood1.png-e14cdc49f9065a35c75e56b56e461231.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
Binary file not shown.
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://m6mopkkotfjc"
|
||||
path.s3tc="res://.godot/imported/wood2.png-f0fb4b8150e6ddd08d41375fa35b14a7.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Textures/wood2.png"
|
||||
dest_files=["res://.godot/imported/wood2.png-f0fb4b8150e6ddd08d41375fa35b14a7.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 not shown.
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://xtmihxoot0c5"
|
||||
path.s3tc="res://.godot/imported/wood5.png-00769a26e54f211b2d40fde27ccee07b.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Textures/wood5.png"
|
||||
dest_files=["res://.godot/imported/wood5.png-00769a26e54f211b2d40fde27ccee07b.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,82 +1,67 @@
|
|||
extends CharacterBody3D
|
||||
extends Node3D
|
||||
|
||||
var rng = RandomNumberGenerator.new()
|
||||
@export var target_location_xz = global_transform.origin * Vector3(1, 0, 1)
|
||||
@export var location_xz = global_transform.origin * Vector3(1, 0, 1)
|
||||
@export var target_direction_xz = (transform.basis * Vector3(1, 0, 1)).normalized()
|
||||
@export var direction_xz = (transform.basis * Vector3(1, 0, 1)).normalized()
|
||||
var task = "idle"
|
||||
var spin_amount = 0
|
||||
var spinning = false
|
||||
var wait_time = 0
|
||||
var walking = false
|
||||
var walk_dist = 0
|
||||
|
||||
# Percentage chances of the character performing certain actions while idle.
|
||||
@export var walk_chance = 0.1
|
||||
@export var spin_chance = 0.2
|
||||
|
||||
@export var walk_speed = 0.5
|
||||
|
||||
# Rate at which character corrects their direction after going off course (percentage).
|
||||
@export var dir_correction_rate = 0.95
|
||||
|
||||
# Margin of accuracy to which the character will correct their direction when off course (radians).
|
||||
@export var dir_accuracy = deg_to_rad(0.1)
|
||||
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
location_xz = global_transform.origin * Vector3(1, 0, 1)
|
||||
direction_xz = (transform.basis * Vector3(1, 0, 1)).normalized()
|
||||
var task = "idle"
|
||||
|
||||
match task:
|
||||
"idle":
|
||||
task = rng.randf_range(0, 100)
|
||||
task = rng.randi_range(0, 100)
|
||||
|
||||
# 3% chance to walk somewhere.
|
||||
if task <= walk_chance:
|
||||
if task <= 33:
|
||||
task = "walk"
|
||||
target_location_xz = global_transform.origin * Vector3(1, 0, 1) + (direction_xz * 16)
|
||||
# 6% chance to rotate.
|
||||
elif task > walk_chance and task <= (walk_chance + spin_chance):
|
||||
elif task > 33 and task <= 50:
|
||||
task = "spin"
|
||||
var rotation_angle = rng.randf_range(-2*PI, 2*PI)
|
||||
var rotation_vector = Vector3(cos(rotation_angle), 0, sin(rotation_angle))
|
||||
target_direction_xz = direction_xz + rotation_vector
|
||||
# 90% chance to idle.
|
||||
elif task > (spin_chance + walk_chance):
|
||||
task = "idle"
|
||||
elif task > 50:
|
||||
task = "wait"
|
||||
|
||||
"walk":
|
||||
# Get the direction to the target in z-x plane.
|
||||
target_direction_xz = (location_xz.direction_to(target_location_xz) * Vector3(1, 0, 1)).normalized()
|
||||
|
||||
# Continue to correct direction to within a margin of dir_accuracy degrees.
|
||||
if direction_xz.angle_to(target_direction_xz) >= dir_accuracy:
|
||||
# Rotate towards destination at specified percentage rate.
|
||||
rotate_y(direction_xz.angle_to(target_direction_xz) * dir_correction_rate)
|
||||
if !walking:
|
||||
walk_dist = rng.randi_range(0, 20)
|
||||
walking = true
|
||||
|
||||
if walk_dist > 0:
|
||||
# Small change to turn a little while walking.
|
||||
var spin_chance = rng.randi_range(0, 10)
|
||||
if spin_chance <= 1:
|
||||
rotate_y(5)
|
||||
|
||||
|
||||
if location_xz.distance_to(target_location_xz) <= (Vector2(direction_xz.x, direction_xz.z) * walk_speed).length():
|
||||
target_direction_xz = direction_xz
|
||||
target_location_xz = location_xz
|
||||
task = "idle"
|
||||
|
||||
"spin":
|
||||
task = "idle"
|
||||
|
||||
if !spinning:
|
||||
var spin_amount = rng.randi_range(-360, 360)
|
||||
spinning = true
|
||||
|
||||
if spin_amount > 0:
|
||||
rotate_y(5)
|
||||
spin_amount -= 5
|
||||
elif spin_amount < 0:
|
||||
rotate_y(-5)
|
||||
spin_amount += 5
|
||||
else:
|
||||
task = "idle"
|
||||
spinning = false
|
||||
|
||||
"wait":
|
||||
# Idle Animation goes here!
|
||||
wait_time += 1
|
||||
if wait_time == 100:
|
||||
task = "idle"
|
||||
wait_time = 0
|
||||
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity.y -= gravity * delta
|
||||
|
||||
# Walk to target location.
|
||||
if location_xz.distance_to(target_location_xz) > (Vector2(direction_xz.x, direction_xz.z) * walk_speed).length():
|
||||
velocity.x = direction_xz.x * walk_speed
|
||||
velocity.z = direction_xz.z * walk_speed
|
||||
|
||||
move_and_slide()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://e0s4phx2jiit"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://rn1bmw0lf1lr"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://df0xror4t3gbc" path="res://Default Purple.png" id="1_x8j7f"]
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0,
|
|||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.45879, 0)
|
||||
|
||||
[node name="PlayerCam" type="Camera3D" parent="CameraMount"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 11.9417)
|
||||
fov = 50.0
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 7)
|
||||
fov = 105.5
|
||||
|
|
|
@ -15,14 +15,6 @@ run/main_scene="res://cameraTest.tscn"
|
|||
config/features=PackedStringArray("4.1", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=512
|
||||
window/size/viewport_height=512
|
||||
window/size/mode=3
|
||||
window/stretch/mode="viewport"
|
||||
window/stretch/aspect="expand"
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="abgj23"
|
||||
|
|
|
@ -11,6 +11,3 @@ func _on_idle_pressed():
|
|||
|
||||
func _on_walk_pressed():
|
||||
$grape_man.walk()
|
||||
|
||||
func _on_hold_pressed():
|
||||
$grape_man.hold()
|
||||
|
|
|
@ -51,7 +51,7 @@ layout_mode = 2
|
|||
text = "Walk"
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(0.551151, 0, 0.834406, 0, 1, 0, -0.834406, 0, 0.551151, 1.041, 0.45, 0.03)
|
||||
transform = Transform3D(0.551151, 0, 0.834406, 0, 1, 0, -0.834406, 0, 0.551151, 10.2206, 6.04514, 5.32455)
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Pickup" to="." method="_on_pickup_pressed"]
|
||||
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Hold" to="." method="_on_hold_pressed"]
|
||||
|
|
|
@ -39,7 +39,7 @@ layout_mode = 2
|
|||
text = "Walk"
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(0.999682, 0, -0.0251998, 0, 1, 0, 0.0251998, 0, 0.999682, 0, 0.138, 0.315)
|
||||
transform = Transform3D(0.999682, 0, -0.0251998, 0, 1, 0, 0.0251998, 0, 0.999682, 0.262823, 2.33598, 7.32455)
|
||||
current = true
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Idle" to="." method="_on_idle_pressed"]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dl4g083w17qh1"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cnnsy8h0dq5y1"]
|
||||
|
||||
[ext_resource type="Script" path="res://Villager.gd" id="1_ardgw"]
|
||||
|
||||
|
@ -6,11 +6,13 @@
|
|||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_b3srs"]
|
||||
|
||||
[node name="Villager" type="CharacterBody3D"]
|
||||
[node name="Node3D" type="Node3D"]
|
||||
script = ExtResource("1_ardgw")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
|
||||
shape = SubResource("CapsuleShape3D_s4x8n")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="CollisionShape3D"]
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D/CollisionShape3D"]
|
||||
mesh = SubResource("CapsuleMesh_b3srs")
|
||||
|
|
Loading…
Reference in New Issue