add anthill model

This commit is contained in:
Teatov 2024-10-21 22:12:29 +10:00
parent 493420acdd
commit 392ec5372c
8 changed files with 117 additions and 11 deletions

BIN
assets/models/anthill.glb (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,43 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b0koc3o63etu1"
path="res://.godot/imported/anthill.glb-5b6c8f58d961f196bcc8e93454476786.scn"
[deps]
source_file="res://assets/models/anthill.glb"
dest_files=["res://.godot/imported/anthill.glb-5b6c8f58d961f196bcc8e93454476786.scn"]
[params]
nodes/root_type=""
nodes/root_name="Anthill"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
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
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={
"materials": {
"anthill_mat": {
"use_external/enabled": true,
"use_external/path": "res://resources/materials/anthill_material.tres"
}
}
}
gltf/naming_version=1
gltf/embedded_image_handling=1

BIN
assets/textures/structures/anthill_albedo.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b7m104tc2wch3"
path.bptc="res://.godot/imported/anthill_albedo.png-bbaa35e5b6a354eec93c815c4147a0e5.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/textures/structures/anthill_albedo.png"
dest_files=["res://.godot/imported/anthill_albedo.png-bbaa35e5b6a354eec93c815c4147a0e5.bptc.ctex"]
[params]
compress/mode=2
compress/high_quality=true
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

View File

@ -0,0 +1,7 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bgc0omqgojp6n"]
[ext_resource type="Texture2D" uid="uid://b7m104tc2wch3" path="res://assets/textures/structures/anthill_albedo.png" id="1_3h7nr"]
[resource]
shading_mode = 0
albedo_texture = ExtResource("1_3h7nr")

View File

@ -3,8 +3,7 @@
[ext_resource type="Script" path="res://scripts/anthill.gd" id="1_8k02d"]
[ext_resource type="Material" uid="uid://f0nlf4tdpvbd" path="res://resources/materials/indicators/hover_indicator_mat.tres" id="2_44p2d"]
[ext_resource type="Script" path="res://scripts/sound_effects_player.gd" id="3_vp3nf"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_x8apu"]
[ext_resource type="PackedScene" uid="uid://b0koc3o63etu1" path="res://assets/models/anthill.glb" id="4_tp2c4"]
[sub_resource type="BoxShape3D" id="BoxShape3D_ruupa"]
@ -17,24 +16,31 @@ orientation = 1
collision_mask = 0
script = ExtResource("1_8k02d")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("CapsuleMesh_x8apu")
[node name="Anthill" parent="." instance=ExtResource("4_tp2c4")]
[node name="Anthill" parent="Anthill" index="0"]
layers = 32
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
shape = SubResource("BoxShape3D_ruupa")
[node name="UiOrigin" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.15587, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0356, 0)
[node name="HoverIndicator" type="MeshInstance3D" parent="."]
transform = Transform3D(1.62268, 0, 0, 0, 1.62268, 0, 0, 0, 1.62268, 0, 0, 0)
transform = Transform3D(2.703, 0, 0, 0, 2.703, 0, 0, 0, 2.703, 0, 0, 0)
cast_shadow = 0
mesh = SubResource("QuadMesh_2gykr")
[node name="NavigationObstacle3D" type="NavigationObstacle3D" parent="."]
radius = 0.57
[node name="SoundEffectsPlayer" type="AudioStreamPlayer3D" parent="."]
unit_size = 20.0
script = ExtResource("3_vp3nf")
script = ExtResource("3_vp3nf")
[node name="NavigationObstacle3D" type="NavigationObstacle3D" parent="."]
radius = 0.6
[node name="DepositPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.102205, 0.382582, 0.248212)
[editable path="Anthill"]

View File

@ -13,6 +13,8 @@ var _nitwit_scene := preload("res://scenes/units/ant_nitwit.tscn")
var _gatherer_scene := preload("res://scenes/units/ant_gatherer.tscn")
@onready var ui_origin: Node3D = $UiOrigin
@onready var deposit_point: Node3D = $DepositPoint
@onready var animation_player: AnimationPlayer = $Anthill/AnimationPlayer
@onready var audio_player: SoundEffectsPlayer = (
$SoundEffectsPlayer
)
@ -39,6 +41,8 @@ func deposit_honeydew(amount: int) -> int:
leftover = new_honeydew_amount - max_honeydew
else:
honeydew = new_honeydew_amount
animation_player.stop()
animation_player.play("plop_down")
return leftover
@ -84,5 +88,8 @@ func _create_unit(
)
if ding:
audio_player.play_sound(SoundManager.ding())
animation_player.stop()
animation_player.play("plop_up")
buy_ant.emit()
return new_unit

View File

@ -171,7 +171,9 @@ func _deposit() -> void:
_unit.animation_playback.travel("plop_up")
audio_player.play_sound(SoundManager.swoosh())
await item.start_tweening(_unit.anthill.global_position).tween_finished
await item.start_tweening(
_unit.anthill.deposit_point.global_position
).tween_finished
audio_player.play_sound(SoundManager.tok())
item.remove_from_spawner()