diff --git a/assets/textures/chaser/gskin0.png.import b/assets/textures/chaser/gskin0.png.import index 6faca52..f333bd4 100644 --- a/assets/textures/chaser/gskin0.png.import +++ b/assets/textures/chaser/gskin0.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://bu4dwr7l6pwcv" -path="res://.godot/imported/gskin0.png-181c0e3148c4126d978cd8f14eb610d1.ctex" +path.s3tc="res://.godot/imported/gskin0.png-181c0e3148c4126d978cd8f14eb610d1.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://assets/textures/chaser/gskin0.png" -dest_files=["res://.godot/imported/gskin0.png-181c0e3148c4126d978cd8f14eb610d1.ctex"] +dest_files=["res://.godot/imported/gskin0.png-181c0e3148c4126d978cd8f14eb610d1.s3tc.ctex"] [params] -compress/mode=0 +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=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ 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 +detect_3d/compress_to=0 diff --git a/assets/textures/chaser/uncanny.png b/assets/textures/chaser/uncanny.png new file mode 100644 index 0000000..9b2a51e Binary files /dev/null and b/assets/textures/chaser/uncanny.png differ diff --git a/assets/textures/chaser/uncanny.png.import b/assets/textures/chaser/uncanny.png.import new file mode 100644 index 0000000..ea7b766 --- /dev/null +++ b/assets/textures/chaser/uncanny.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c2a63sfnh6il" +path.s3tc="res://.godot/imported/uncanny.png-738ed8a4c24053be61a387bfe7510f94.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/textures/chaser/uncanny.png" +dest_files=["res://.godot/imported/uncanny.png-738ed8a4c24053be61a387bfe7510f94.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 diff --git a/assets/textures/player/canny.png b/assets/textures/player/canny.png index dad99fd..cb2b51e 100644 Binary files a/assets/textures/player/canny.png and b/assets/textures/player/canny.png differ diff --git a/levels/w1/1_01.tscn b/levels/w1/1_01.tscn index b1899b1..115c40c 100644 --- a/levels/w1/1_01.tscn +++ b/levels/w1/1_01.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://bkas0lj53glkn"] +[gd_scene load_steps=18 format=3 uid="uid://bkas0lj53glkn"] [ext_resource type="Script" uid="uid://vydhlp6ju8bw" path="res://levels/level.gd" id="1_r1ilo"] [ext_resource type="Script" uid="uid://hmtamckjm4vm" path="res://levels/level_info.gd" id="2_61qek"] @@ -8,10 +8,12 @@ [ext_resource type="Shader" uid="uid://c3y1ht34ep01k" path="res://assets/shaders/horizontal_world_uv.gdshader" id="6_ka4lg"] [ext_resource type="PackedScene" uid="uid://bfic5n608nc5j" path="res://objects/sand_pit.tscn" id="6_rlgmy"] [ext_resource type="Texture2D" uid="uid://cpmi7w2fwm2sf" path="res://assets/textures/world/checker_grass.png" id="7_3jvq7"] +[ext_resource type="PackedScene" uid="uid://bndtsprfwrkau" path="res://objects/uncanny_cat.tscn" id="7_qskty"] +[ext_resource type="PackedScene" uid="uid://13qlrib2dk36" path="res://objects/waterman_pole.tscn" id="10_qrwyj"] [sub_resource type="Resource" id="Resource_qskty"] script = ExtResource("2_61qek") -title = "Welcome To Poo Central!" +title = "Welcome To Golf Central!" difficulty = 1 metadata/_custom_type_script = "uid://hmtamckjm4vm" @@ -93,9 +95,15 @@ polygon = PackedVector2Array(-3, -2, 1, 0, 5, 6, -3, 6) transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -12.5406, 0, -10.5995) polygon = PackedVector2Array(2.33224, -4.27959, 0.718879, 0.533604, 2.00957, 6.26103, -3.74475, 6.12658, -3.52964, -4.44092) +[node name="UncannyCat" parent="Objects" instance=ExtResource("7_qskty")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.89785, 0) + [node name="CSGMesh3D" type="CSGMesh3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0) use_collision = true collision_mask = 0 mesh = SubResource("BoxMesh_25rxq") material = SubResource("ShaderMaterial_tpmcl") + +[node name="WatermanPole" parent="." instance=ExtResource("10_qrwyj")] +transform = Transform3D(1, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 4) diff --git a/levels/w1/1_04.scn b/levels/w1/1_04.scn deleted file mode 100644 index 7343900..0000000 Binary files a/levels/w1/1_04.scn and /dev/null differ diff --git a/objects/canny_cat.tscn b/objects/canny_cat.tscn index 754876e..2140f9b 100644 --- a/objects/canny_cat.tscn +++ b/objects/canny_cat.tscn @@ -52,7 +52,7 @@ resource_name = "Not Moving" script = ExtResource("8_d5slg") expression = "velocity.is_zero_approx()" -[node name="CannyCat" type="CharacterBody3D" node_paths=PackedStringArray("state_chart", "graphics", "power_indicator", "camera_arm", "collision_shape")] +[node name="CannyCat" type="CharacterBody3D" node_paths=PackedStringArray("state_chart", "graphics", "power_indicator", "camera_arm", "collision_shape") groups=["chaser_target"]] process_priority = -100 process_physics_priority = -100 collision_layer = 16 @@ -87,7 +87,7 @@ shape = SubResource("SphereShape3D_4o01j") [node name="Graphics" type="Node3D" parent="."] [node name="CannySprite" type="Sprite3D" parent="Graphics"] -pixel_size = 0.0156 +pixel_size = 0.0313 billboard = 1 texture_filter = 0 texture = ExtResource("1_cp4br") @@ -136,7 +136,7 @@ mesh = SubResource("CylinderMesh_b16dl") [node name="CameraArm" type="SpringArm3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 0, 0) collision_mask = 8 -spring_length = 8.0 +spring_length = 7.0 [node name="Camera3D" type="Camera3D" parent="CameraArm"] current = true diff --git a/objects/uncanny_cat.gd b/objects/uncanny_cat.gd new file mode 100644 index 0000000..baa8cff --- /dev/null +++ b/objects/uncanny_cat.gd @@ -0,0 +1,26 @@ +extends CharacterBody3D + + +@export var acceleration: float +@export var speed: float +@export var vertical_speed: float + + +func _physics_process(delta: float) -> void: + var target: Node3D = null + for node in get_tree().get_nodes_in_group(&"chaser_target"): + if node is Node3D: + if not target or ( + global_position.distance_squared_to(node.global_position) < + global_position.distance_squared_to(target.global_position) + ): + target = node + + if target: + velocity += global_position.direction_to(target.global_position) * acceleration * delta + velocity = velocity.limit_length(speed) + velocity.y = (target.global_position.y - global_position.y) * vertical_speed + + var col = move_and_collide(velocity * delta) + if col: + velocity = velocity.bounce(col.get_normal()) diff --git a/objects/uncanny_cat.gd.uid b/objects/uncanny_cat.gd.uid new file mode 100644 index 0000000..d50f6ae --- /dev/null +++ b/objects/uncanny_cat.gd.uid @@ -0,0 +1 @@ +uid://1mhmcaluavhg diff --git a/objects/uncanny_cat.tscn b/objects/uncanny_cat.tscn new file mode 100644 index 0000000..c36c2ad --- /dev/null +++ b/objects/uncanny_cat.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=6 format=3 uid="uid://bndtsprfwrkau"] + +[ext_resource type="Script" uid="uid://1mhmcaluavhg" path="res://objects/uncanny_cat.gd" id="1_bsm3e"] +[ext_resource type="Texture2D" uid="uid://c2a63sfnh6il" path="res://assets/textures/chaser/uncanny.png" id="2_eotxf"] + +[sub_resource type="SphereShape3D" id="SphereShape3D_eotxf"] +radius = 0.45 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_eotxf"] +transparency = 3 +alpha_hash_scale = 1.0 +alpha_antialiasing_mode = 0 +no_depth_test = true +shading_mode = 0 +albedo_color = Color(1, 0, 0, 0.501961) +albedo_texture = ExtResource("2_eotxf") +texture_filter = 0 +billboard_mode = 1 + +[sub_resource type="SphereShape3D" id="SphereShape3D_ixuei"] + +[node name="UncannyCat" type="CharacterBody3D"] +collision_layer = 32 +collision_mask = 32 +motion_mode = 1 +script = ExtResource("1_bsm3e") +acceleration = 0.6 +speed = 1.5 +vertical_speed = 0.5 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("SphereShape3D_eotxf") + +[node name="Sprite3D" type="Sprite3D" parent="."] +material_overlay = SubResource("StandardMaterial3D_eotxf") +pixel_size = 0.0313 +billboard = 1 +texture_filter = 0 +texture = ExtResource("2_eotxf") + +[node name="PlayerDetector" type="Area3D" parent="."] +collision_layer = 0 +collision_mask = 16 +monitorable = false + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerDetector"] +shape = SubResource("SphereShape3D_ixuei") diff --git a/project.godot b/project.godot index 8a754ec..391a0aa 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="ucg-3d" -run/main_scene="res://test_scene.tscn" +run/main_scene="uid://bkas0lj53glkn" config/features=PackedStringArray("4.4", "GL Compatibility") config/icon="res://icon.svg" @@ -36,6 +36,7 @@ import/blender/enabled=false [global_group] friction_floor="" +chaser_target="Targets that chaser enemies will lock on to." [input] @@ -51,6 +52,7 @@ charge_shot={ 3d_physics/layer_2="friction" 3d_physics/layer_3="water" 3d_physics/layer_5="player" +3d_physics/layer_6="uncanny" [rendering]