LD56 is over. This is the game.

This commit is contained in:
Douwe Ravers
2024-10-07 02:28:14 +02:00
parent 4c0c57d5ba
commit af7a46cd23
183 changed files with 20357 additions and 442 deletions

31
entities/ants/ant.gd Normal file
View File

@@ -0,0 +1,31 @@
class_name Ant extends CharacterBody3D
@export var damage := 3
@export var max_health := 10
@export var speed:float = 5
@onready var navigation_agent := ($NavigationAgent3D as NavigationAgent3D)
@onready var health := max_health
func on_interact(object:CollisionObject3D, point:Vector3)->void:
pass
func go_to(target_position:Vector3)->void:
navigation_agent.target_position = target_position
func hit(damage:int) -> void:
health -= damage
if health < 0:
queue_free()
func _physics_process(_delta: float) -> void:
var next_step := navigation_agent.get_next_path_position()
next_step += Vector3.DOWN * 0.5
var dir := (next_step-global_position).normalized()
navigation_agent.set_velocity(dir * speed)
func _on_velocity_computed(safe_velocity: Vector3)->void:
look_at(global_position + (-global_basis.z).lerp(safe_velocity, 0.1))
velocity = safe_velocity
var __ := move_and_slide()

View File

@@ -0,0 +1,34 @@
[gd_resource type="AnimationNodeStateMachine" load_steps=8 format=3 uid="uid://cljrd41byapp6"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_eld4b"]
animation = &"Attack"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_p6tj7"]
animation = &"ShieldHold"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ddkaf"]
animation = &"Walk"
[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_7v3er"]
blend_point_0/node = SubResource("AnimationNodeAnimation_p6tj7")
blend_point_0/pos = 0.0
blend_point_1/node = SubResource("AnimationNodeAnimation_ddkaf")
blend_point_1/pos = 1.0
min_space = 0.0
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3vt4k"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_o5jsw"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_13gou"]
switch_mode = 2
advance_mode = 2
[resource]
states/Attack/node = SubResource("AnimationNodeAnimation_eld4b")
states/Attack/position = Vector2(469, 181)
states/Start/position = Vector2(336, 90)
states/Walk/node = SubResource("AnimationNodeBlendSpace1D_7v3er")
states/Walk/position = Vector2(469, 90)
transitions = ["Start", "Walk", SubResource("AnimationNodeStateMachineTransition_3vt4k"), "Walk", "Attack", SubResource("AnimationNodeStateMachineTransition_o5jsw"), "Attack", "Walk", SubResource("AnimationNodeStateMachineTransition_13gou")]

View File

@@ -0,0 +1,20 @@
extends Area3D
signal attack
func _on_attack_timer_timeout() -> void:
var ant := get_parent() as Ant
for body in get_overlapping_bodies():
if body is Ant:
var other_ant := body as Ant
if ant is SoldierAnt and other_ant is EnemyAnt:
other_ant.hit(randi_range(0, ant.damage))
attack.emit()
if ant is EnemyAnt and other_ant is not EnemyAnt:
other_ant.hit(randi_range(0, ant.damage))
attack.emit()
for area in get_overlapping_areas():
if area.get_parent() is Building:
var building := area.get_parent() as Building
building.hit(randi_range(0, ant.damage))
attack.emit()

View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=3 uid="uid://2jr3r0ybf0l6"]
[ext_resource type="Script" path="res://entities/ants/attackzone.gd" id="1_2bwdd"]
[sub_resource type="BoxShape3D" id="BoxShape3D_vnqsj"]
size = Vector3(3, 3, 3)
[node name="Attackzone" type="Area3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -2.20881)
monitorable = false
script = ExtResource("1_2bwdd")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("BoxShape3D_vnqsj")
[node name="AttackTimer" type="Timer" parent="."]
autostart = true
[connection signal="timeout" from="AttackTimer" to="." method="_on_attack_timer_timeout"]

View File

@@ -0,0 +1,9 @@
extends MeshInstance3D
@export var type:CollectableResource.ResourceType
@export var ant:WorkerAnt
func _process(delta: float) -> void:
visible = ant.capacity > 0 and \
ant.target == PlayerCamp.instance and \
ant.source_target.type == type

91
entities/ants/ene870C.tmp Normal file
View File

@@ -0,0 +1,91 @@
[gd_scene load_steps=8 format=3 uid="uid://8mub6rxf7rnu"]
[ext_resource type="Script" path="res://entities/ants/enemy_ant.gd" id="1_kehry"]
[ext_resource type="Texture2D" uid="uid://dwbhv28mnyrc3" path="res://assets/textures/enemyicon.png" id="2_hdgws"]
[ext_resource type="PackedScene" uid="uid://dtf65yetl4rus" path="res://entities/ants/healthbar.tscn" id="4_cfhra"]
[ext_resource type="PackedScene" uid="uid://cd6uh62e3o5oj" path="res://assets/fbx/enemy.glb" id="4_kadvl"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://cljrd41byapp6" path="res://entities/ants/attack_animationtree.tres" id="4_px4kn"]
[ext_resource type="PackedScene" uid="uid://2jr3r0ybf0l6" path="res://entities/ants/attackzone.tscn" id="6_1i0rn"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bqyr6"]
height = 3.3045
[node name="EnemyAnt" type="CharacterBody3D"]
axis_lock_angular_x = true
axis_lock_angular_z = true
script = ExtResource("1_kehry")
damage = 4
speed = 10.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.583011, 0.371911)
shape = SubResource("CapsuleShape3D_bqyr6")
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
target_desired_distance = 2.0
avoidance_enabled = true
debug_path_custom_color = Color(0.3, 0.381667, 1, 1)
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("2_hdgws")
[node name="enemy" parent="." instance=ExtResource("4_kadvl")]
[node name="Skeleton3D" parent="enemy/EnemyAnt" index="0"]
bones/0/rotation = Quaternion(-0.151731, -0.023891, -0.015694, 0.988008)
bones/1/rotation = Quaternion(-0.454655, 0.00811729, -0.000928479, 0.89063)
bones/2/rotation = Quaternion(0.597894, 0.051707, -0.697194, 0.392135)
bones/3/rotation = Quaternion(-0.260339, 0.0560302, -0.586219, 0.765135)
bones/3/scale = Vector3(1, 1, 1)
bones/4/rotation = Quaternion(-0.185361, 0.0767715, -0.304188, 0.931245)
bones/4/scale = Vector3(1, 1, 1)
bones/5/position = Vector3(0.131012, 0.4206, 0.0209323)
bones/5/rotation = Quaternion(0.31011, 0.152475, -0.49965, 0.794313)
bones/5/scale = Vector3(1, 1, 1)
bones/6/rotation = Quaternion(0.0374684, -0.123236, -0.663372, 0.73712)
bones/7/rotation = Quaternion(-0.0440464, -0.00121472, -0.335458, 0.941024)
bones/7/scale = Vector3(1, 1, 1)
bones/8/position = Vector3(0.14848, 0.144013, -0.0139494)
bones/8/rotation = Quaternion(0.731112, 0.216438, -0.270013, 0.587982)
bones/9/rotation = Quaternion(-0.147272, -0.690287, -0.291994, 0.64541)
bones/10/rotation = Quaternion(0.035527, -0.0722718, -0.344413, 0.935358)
bones/10/scale = Vector3(1, 1, 1)
bones/11/rotation = Quaternion(0.581951, -0.379946, 0.688898, 0.205898)
bones/12/rotation = Quaternion(-0.275331, -0.0633099, 0.577289, 0.766108)
bones/12/scale = Vector3(1, 1, 1)
bones/13/rotation = Quaternion(0.011061, 0.346548, 0.117026, 0.930638)
bones/13/scale = Vector3(1, 1, 1)
bones/14/position = Vector3(-0.131012, 0.4206, 0.0209323)
bones/14/rotation = Quaternion(0.311801, -0.156763, 0.515707, 0.782465)
bones/14/scale = Vector3(1, 1, 1)
bones/15/rotation = Quaternion(0.0538017, 0.163269, 0.666243, 0.725651)
bones/16/rotation = Quaternion(-0.0440464, 0.00121472, 0.335458, 0.941024)
bones/16/scale = Vector3(1, 1, 1)
bones/17/position = Vector3(-0.14848, 0.144013, -0.0139494)
bones/17/rotation = Quaternion(0.742166, -0.221688, 0.264848, 0.574369)
bones/18/rotation = Quaternion(-0.156224, 0.731565, 0.301322, 0.59128)
bones/19/rotation = Quaternion(0.035527, 0.0722718, 0.344413, 0.935358)
bones/19/scale = Vector3(1, 1, 1)
bones/20/rotation = Quaternion(0.00114255, 0.716427, 0.697648, -0.00431879)
[node name="AnimationTree" type="AnimationTree" parent="enemy"]
tree_root = ExtResource("4_px4kn")
anim_player = NodePath("../AnimationPlayer")
parameters/Walk/blend_position = -0.133562
[node name="healthbar" parent="." instance=ExtResource("4_cfhra")]
[node name="EnemyTrackerTimer" type="Timer" parent="."]
autostart = true
[node name="Attackzone" parent="." instance=ExtResource("6_1i0rn")]
[connection signal="navigation_finished" from="NavigationAgent3D" to="." method="_on_target_reached"]
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_velocity_computed"]
[connection signal="timeout" from="EnemyTrackerTimer" to="." method="_on_enemy_tracker_timer_timeout"]
[connection signal="attack" from="Attackzone" to="." method="_on_attackzone_attack"]
[editable path="enemy"]

View File

@@ -0,0 +1,43 @@
class_name EnemyAnt extends Ant
var ant_target:Ant
var building_target:Building
func _process(delta: float) -> void:
var value := $enemy/AnimationTree.get("parameters/Walk/blend_position") as float
var speed_anim := lerpf(value, velocity.length()/speed, delta*5)
$enemy/AnimationTree.set("parameters/Walk/blend_position", speed_anim)
func _exit_tree() -> void:
Game.instance.score += 1
func search_target()->void:
var player_ants := Player.instance.get_node("Ants").get_children()
ant_target = player_ants.reduce(
func(closest_ant:Ant,new_ant:Ant)->Ant:
var closest_dist := closest_ant.global_position.distance_squared_to(global_position)
var new_dist := new_ant.global_position.distance_squared_to(global_position)
return new_ant if new_dist<closest_dist else closest_ant
) as Ant
if ant_target == null:
var player_buildings := Player.instance.get_node("Buildings").get_children()
building_target = player_buildings.reduce(
func(closest_building:Building,new_building:Building)->Building:
var closest_dist := closest_building.global_position.distance_squared_to(global_position)
var new_dist := new_building.global_position.distance_squared_to(global_position)
return new_building if new_dist<closest_dist else closest_building
) as Building
func _on_enemy_tracker_timer_timeout() -> void:
if (ant_target==null and building_target==null) or randi_range(0,10) == 0:
search_target()
if ant_target!=null: go_to(ant_target.global_position)
if building_target!=null: go_to(building_target.global_position)
func _on_attackzone_attack() -> void:
if ant_target!=null: look_at(ant_target.global_position)
if building_target!=null: look_at(building_target.global_position)
var state_machine := $enemy/AnimationTree.get("parameters/playback") as AnimationNodeStateMachinePlayback
state_machine.travel("Attack")

View File

@@ -0,0 +1,93 @@
[gd_scene load_steps=8 format=3 uid="uid://8mub6rxf7rnu"]
[ext_resource type="Script" path="res://entities/ants/enemy_ant.gd" id="1_kehry"]
[ext_resource type="Texture2D" uid="uid://dwbhv28mnyrc3" path="res://assets/textures/enemyicon.png" id="2_hdgws"]
[ext_resource type="PackedScene" uid="uid://dtf65yetl4rus" path="res://entities/ants/healthbar.tscn" id="4_cfhra"]
[ext_resource type="PackedScene" uid="uid://cd6uh62e3o5oj" path="res://assets/fbx/enemy.glb" id="4_kadvl"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://cljrd41byapp6" path="res://entities/ants/attack_animationtree.tres" id="4_px4kn"]
[ext_resource type="PackedScene" uid="uid://2jr3r0ybf0l6" path="res://entities/ants/attackzone.tscn" id="6_1i0rn"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bqyr6"]
radius = 1.06919
height = 2.88419
[node name="EnemyAnt" type="CharacterBody3D"]
axis_lock_angular_x = true
axis_lock_angular_z = true
script = ExtResource("1_kehry")
damage = 4
max_health = 15
speed = 3.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 1.44004, 0.371911)
shape = SubResource("CapsuleShape3D_bqyr6")
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
target_desired_distance = 2.0
avoidance_enabled = true
debug_path_custom_color = Color(0.3, 0.381667, 1, 1)
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("2_hdgws")
[node name="enemy" parent="." instance=ExtResource("4_kadvl")]
[node name="Skeleton3D" parent="enemy/EnemyAnt" index="0"]
bones/0/rotation = Quaternion(-0.151731, -0.023891, -0.015694, 0.988008)
bones/1/rotation = Quaternion(-0.448048, 0.00344809, -0.000394401, 0.894003)
bones/2/rotation = Quaternion(0.597894, 0.051707, -0.697194, 0.392135)
bones/3/rotation = Quaternion(-0.268977, 0.0602213, -0.581107, 0.765729)
bones/3/scale = Vector3(1, 1, 1)
bones/4/rotation = Quaternion(-0.185361, 0.0767715, -0.304188, 0.931245)
bones/4/scale = Vector3(1, 1, 1)
bones/5/position = Vector3(0.131012, 0.4206, 0.0209323)
bones/5/rotation = Quaternion(0.31011, 0.152475, -0.49965, 0.794313)
bones/5/scale = Vector3(1, 1, 1)
bones/6/rotation = Quaternion(0.0374684, -0.123236, -0.663372, 0.73712)
bones/7/rotation = Quaternion(-0.0440464, -0.00121472, -0.335458, 0.941024)
bones/7/scale = Vector3(1, 1, 1)
bones/8/position = Vector3(0.14848, 0.144013, -0.0139494)
bones/8/rotation = Quaternion(0.731112, 0.216438, -0.270013, 0.587982)
bones/9/rotation = Quaternion(-0.147272, -0.690287, -0.291994, 0.64541)
bones/10/rotation = Quaternion(0.035527, -0.0722718, -0.344413, 0.935358)
bones/10/scale = Vector3(1, 1, 1)
bones/11/rotation = Quaternion(0.582122, -0.384409, 0.688139, 0.199572)
bones/12/rotation = Quaternion(-0.275331, -0.0633099, 0.577289, 0.766108)
bones/12/scale = Vector3(1, 1, 1)
bones/13/rotation = Quaternion(0.0216325, 0.352033, 0.113455, 0.928834)
bones/13/scale = Vector3(1, 1, 1)
bones/14/position = Vector3(-0.131012, 0.4206, 0.0209323)
bones/14/rotation = Quaternion(0.311801, -0.156763, 0.515707, 0.782465)
bones/14/scale = Vector3(1, 1, 1)
bones/15/rotation = Quaternion(0.0538017, 0.163269, 0.666243, 0.725651)
bones/16/rotation = Quaternion(-0.0440464, 0.00121472, 0.335458, 0.941024)
bones/16/scale = Vector3(1, 1, 1)
bones/17/position = Vector3(-0.14848, 0.144013, -0.0139494)
bones/17/rotation = Quaternion(0.742166, -0.221688, 0.264848, 0.574369)
bones/18/rotation = Quaternion(-0.156224, 0.731565, 0.301322, 0.59128)
bones/19/rotation = Quaternion(0.035527, 0.0722718, 0.344413, 0.935358)
bones/19/scale = Vector3(1, 1, 1)
bones/20/rotation = Quaternion(0.000485378, 0.711083, 0.703105, -0.00183471)
[node name="AnimationTree" type="AnimationTree" parent="enemy"]
tree_root = ExtResource("4_px4kn")
anim_player = NodePath("../AnimationPlayer")
parameters/Walk/blend_position = -0.133562
[node name="healthbar" parent="." instance=ExtResource("4_cfhra")]
[node name="EnemyTrackerTimer" type="Timer" parent="."]
autostart = true
[node name="Attackzone" parent="." instance=ExtResource("6_1i0rn")]
[connection signal="navigation_finished" from="NavigationAgent3D" to="." method="_on_target_reached"]
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_velocity_computed"]
[connection signal="timeout" from="EnemyTrackerTimer" to="." method="_on_enemy_tracker_timer_timeout"]
[connection signal="attack" from="Attackzone" to="." method="_on_attackzone_attack"]
[editable path="enemy"]

View File

@@ -0,0 +1,18 @@
extends Node3D
func _process(delta: float) -> void:
var health:int
var max_health:int
if get_parent() is Ant:
var ant := get_parent() as Ant
health = ant.health
max_health = ant.max_health
elif get_parent() is Building:
var building := get_parent() as Building
health = building.health
max_health = building.max_health
var bar := $Sprite3D/SubViewport/HSlider as HSlider
bar.max_value = max_health
bar.value = health

View File

@@ -0,0 +1,42 @@
[gd_scene load_steps=5 format=3 uid="uid://dtf65yetl4rus"]
[ext_resource type="Script" path="res://entities/ants/healthbar.gd" id="1_xu8r6"]
[sub_resource type="ViewportTexture" id="ViewportTexture_ftmea"]
viewport_path = NodePath("Sprite3D/SubViewport")
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_c13yg"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jpeoh"]
bg_color = Color(1, 0, 0.0166664, 1)
[node name="Hea;thbar" type="Node3D"]
script = ExtResource("1_xu8r6")
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.96965, 0)
billboard = 1
texture = SubResource("ViewportTexture_ftmea")
[node name="SubViewport" type="SubViewport" parent="Sprite3D"]
disable_3d = true
transparent_bg = true
size = Vector2i(100, 25)
[node name="HSlider" type="HSlider" parent="Sprite3D/SubViewport"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_icons/grabber = SubResource("PlaceholderTexture2D_c13yg")
theme_override_icons/grabber_highlight = SubResource("PlaceholderTexture2D_c13yg")
theme_override_icons/grabber_disabled = SubResource("PlaceholderTexture2D_c13yg")
theme_override_icons/tick = SubResource("PlaceholderTexture2D_c13yg")
theme_override_styles/grabber_area = SubResource("StyleBoxFlat_jpeoh")
theme_override_styles/grabber_area_highlight = SubResource("StyleBoxFlat_jpeoh")
max_value = 10.0
value = 5.0
rounded = true
editable = false
scrollable = false

View File

@@ -0,0 +1,16 @@
class_name Indicator extends Node3D
enum IndicatorType {
ANT_WORKER, ANT_SOLDIER, BUILDING_BALISTA,
OTHER
}
@export var type:IndicatorType
func _process(_delta: float) -> void:
var raycast := Player.instance.raycast
if raycast.get_collider() is Terrain:
visible = true
global_position = raycast.get_collision_point()
else:
visible = false

6
entities/ants/select.gd Normal file
View File

@@ -0,0 +1,6 @@
extends Node3D
func _process(delta: float) -> void:
var parent := get_parent() as Ant
visible = Player.instance.selected_unit == parent

93
entities/ants/sleect.tscn Normal file
View File

@@ -0,0 +1,93 @@
[gd_scene load_steps=9 format=4 uid="uid://c05rbbsw4du21"]
[ext_resource type="Script" path="res://entities/ants/select.gd" id="1_47iba"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_rbo5m"]
albedo_color = Color(0.17, 0.585, 1, 1)
emission_enabled = true
emission = Color(0.364706, 0.94902, 1, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_uc22g"]
[sub_resource type="ArrayMesh" id="ArrayMesh_4kqou"]
_surfaces = [{
"aabb": AABB(-0.00674903, -0.00389656, -0.0139223, 0.0134981, 0.0116897, 0.0239223),
"format": 34359742465,
"index_count": 18,
"index_data": PackedByteArray("AAABAAIAAwABAAAAAgABAAMABAADAAAABAACAAMABAAAAAIA"),
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 5,
"vertex_data": PackedByteArray("AAAAAFtd/zuhDLe7AAAAAAAAAAAK1yM8/Cbdu1tdf7uhDLe7/CbdO1tdf7uhDLe7V2lZsArXo6+DGmS8")
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_to4s8"]
resource_name = "Cone"
_surfaces = [{
"aabb": AABB(-0.00674903, -0.00389656, -0.0139223, 0.0134981, 0.0116897, 0.0239223),
"attribute_data": PackedByteArray("AACAPn8eED8AAIA+AABAP4ZFtD3A8Fc/nu7SPsDwVz8AAIA+AABAPwAAgD5+HhA/iEW0PcDwVz8AAIA+AABAP57u0j7A8Fc/cGqwPkJ9LD+e7tI+wPBXPwAAgD5+HhA/75WJPlK4Xj+IRbQ9wPBXP57u0j7A8Fc/RP8LPmzKND8AAIA+fx4QP4ZFtD3A8Fc/"),
"format": 34359742487,
"index_count": 18,
"index_data": PackedByteArray("AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEA"),
"material": SubResource("StandardMaterial3D_uc22g"),
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 18,
"vertex_data": PackedByteArray("AAAAAFtd/zuhDLe7AAAAAAAAAAAK1yM8/Cbdu1tdf7uhDLe7/CbdO1tdf7uhDLe7AAAAAAAAAAAK1yM8AAAAAFtd/zuhDLe7/Cbdu1tdf7uhDLe7AAAAAAAAAAAK1yM8/CbdO1tdf7uhDLe7V2lZsArXo6+DGmS8/CbdO1tdf7uhDLe7AAAAAFtd/zuhDLe7V2lZsArXo6+DGmS8/Cbdu1tdf7uhDLe7/CbdO1tdf7uhDLe7V2lZsArXo6+DGmS8AAAAAFtd/zuhDLe7/Cbdu1tdf7uhDLe7ZzuZp6uc/79nO5mnq5z/v2c7maernP+/l8SZp/7/VY6XxJmn/v9VjpfEmaf+/1WO/3+ZGf///7//f5kZ////v/9/mRn///+/F92Jw6scCIwX3YnDqxwIjBfdicOrHAiMxagAAP///7/FqAAA////v8WoAAD///+/5yKJw5RflMjnIonDlF+UyOciicOUX5TI")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_4kqou")
[sub_resource type="Animation" id="Animation_l16oe"]
resource_name = "turn"
loop_mode = 1
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Cone:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(100, 100, 100), Vector3(50, 50, 50), Vector3(100, 100, 100)]
}
[sub_resource type="Animation" id="Animation_0as7f"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Cone:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(100, 100, 100)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qaqbv"]
_data = {
"RESET": SubResource("Animation_0as7f"),
"turn": SubResource("Animation_l16oe")
}
[node name="Node3D" type="Node3D"]
script = ExtResource("1_47iba")
[node name="Cone" type="MeshInstance3D" parent="."]
transform = Transform3D(-61.3722, 5.36533e-06, -2.34526e-13, 0, -2.68266e-06, -61.3722, -5.36533e-06, -61.3722, 2.68266e-06, 0, 3.91648, 0)
material_overlay = SubResource("StandardMaterial3D_rbo5m")
mesh = SubResource("ArrayMesh_to4s8")
skeleton = NodePath("")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_qaqbv")
}
autoplay = "turn"

View File

@@ -0,0 +1,46 @@
class_name SoldierAnt extends Ant
var target:EnemyAnt
func _enter_tree() -> void:
Game.instance.score += 1
func _process(delta: float) -> void:
if Player.instance.selected_unit == self:
$image.visible = true
else:
$image.visible = false
var value := $soldier/AnimationTree.get("parameters/Walk/blend_position") as float
var speed_anim := lerpf(value, velocity.length()/speed, delta*5)
$soldier/AnimationTree.set("parameters/Walk/blend_position", speed_anim)
func on_interact(object:CollisionObject3D, point:Vector3)->void:
target = null
if object is Terrain:
go_to(point)
elif object is EnemyAnt:
var enemy := object as EnemyAnt
target = enemy
go_to(target.global_position)
func _on_target_reached() -> void:
if target == null: return
look_at(target.global_position)
func _on_enemy_tracker_timer_timeout() -> void:
if target == null:
var enemy_detectoion := $enemyDetection as Area3D
target = enemy_detectoion.get_overlapping_bodies().filter(
func(ant:Ant)->bool: return ant is EnemyAnt
).reduce(
func(closest_ant:Ant,new_ant:Ant)->Ant:
var closest_dist := closest_ant.global_position.distance_squared_to(global_position)
var new_dist := new_ant.global_position.distance_squared_to(global_position)
return new_ant if new_dist<closest_dist else closest_ant
) as EnemyAnt
else:
go_to(target.global_position)
func _on_attackzone_attack() -> void:
var state_machine := $soldier/AnimationTree.get("parameters/playback") as AnimationNodeStateMachinePlayback
state_machine.travel("Attack")

View File

@@ -0,0 +1,140 @@
[gd_scene load_steps=14 format=3 uid="uid://dwg0fmlthxkfy"]
[ext_resource type="Script" path="res://entities/ants/soldier_ant.gd" id="1_qknud"]
[ext_resource type="Texture2D" uid="uid://b62r4utkky6vn" path="res://assets/textures/soldiericon.png" id="3_6qm85"]
[ext_resource type="Texture2D" uid="uid://cdd5spo86if85" path="res://assets/textures/soldier_ant.png" id="4_uj3cw"]
[ext_resource type="PackedScene" uid="uid://ccwk31nx0qnnr" path="res://assets/fbx/soldier.glb" id="4_y5xia"]
[ext_resource type="PackedScene" uid="uid://dtf65yetl4rus" path="res://entities/ants/healthbar.tscn" id="5_4b3vr"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://cljrd41byapp6" path="res://entities/ants/attack_animationtree.tres" id="5_c6ikb"]
[ext_resource type="PackedScene" uid="uid://2jr3r0ybf0l6" path="res://entities/ants/attackzone.tscn" id="5_sdcjo"]
[ext_resource type="PackedScene" uid="uid://c05rbbsw4du21" path="res://entities/ants/sleect.tscn" id="8_j5os0"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bqyr6"]
radius = 1.37224
height = 5.01604
[sub_resource type="Gradient" id="Gradient_5vivq"]
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_vkfjj"]
gradient = SubResource("Gradient_5vivq")
fill = 1
fill_from = Vector2(0, 1)
fill_to = Vector2(1, 1)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_4ehjl"]
texture = SubResource("GradientTexture2D_vkfjj")
[sub_resource type="SphereShape3D" id="SphereShape3D_twqc0"]
radius = 20.0
[node name="SoldierAnt" type="CharacterBody3D"]
axis_lock_angular_x = true
axis_lock_angular_z = true
script = ExtResource("1_qknud")
damage = 6
max_health = 20
speed = 3.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 1.51762, 0.371911)
shape = SubResource("CapsuleShape3D_bqyr6")
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
target_desired_distance = 2.0
avoidance_enabled = true
debug_path_custom_color = Color(0.3, 0.381667, 1, 1)
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("3_6qm85")
[node name="image" type="Panel" parent="."]
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -186.0
offset_right = 186.0
grow_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxTexture_4ehjl")
[node name="TextureRect" type="TextureRect" parent="image"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -186.0
offset_right = 186.0
grow_vertical = 0
texture = ExtResource("4_uj3cw")
expand_mode = 1
stretch_mode = 4
[node name="soldier" parent="." instance=ExtResource("4_y5xia")]
[node name="Skeleton3D" parent="soldier/SoldierAnt" index="0"]
bones/0/rotation = Quaternion(-0.151731, -0.023891, -0.015694, 0.988008)
bones/1/rotation = Quaternion(-0.454449, 0.00797132, -0.000911783, 0.890736)
bones/2/rotation = Quaternion(0.597894, 0.051707, -0.697194, 0.392135)
bones/3/rotation = Quaternion(-0.26061, 0.0561613, -0.58606, 0.765155)
bones/3/scale = Vector3(1, 1, 1)
bones/4/rotation = Quaternion(-0.185361, 0.0767715, -0.304188, 0.931245)
bones/4/scale = Vector3(1, 1, 1)
bones/5/position = Vector3(0.131012, 0.4206, 0.0209323)
bones/5/rotation = Quaternion(0.31011, 0.152475, -0.49965, 0.794313)
bones/5/scale = Vector3(1, 1, 1)
bones/6/rotation = Quaternion(0.0374684, -0.123236, -0.663372, 0.73712)
bones/7/rotation = Quaternion(-0.0440464, -0.00121472, -0.335458, 0.941024)
bones/7/scale = Vector3(1, 1, 1)
bones/8/position = Vector3(0.14848, 0.144013, -0.0139494)
bones/8/rotation = Quaternion(0.731112, 0.216438, -0.270013, 0.587982)
bones/9/rotation = Quaternion(-0.147272, -0.690287, -0.291994, 0.64541)
bones/10/rotation = Quaternion(0.035527, -0.0722718, -0.344413, 0.935358)
bones/10/scale = Vector3(1, 1, 1)
bones/11/rotation = Quaternion(0.581957, -0.380086, 0.688875, 0.2057)
bones/12/rotation = Quaternion(-0.275331, -0.0633099, 0.577289, 0.766108)
bones/12/scale = Vector3(1, 1, 1)
bones/13/rotation = Quaternion(0.0113916, 0.34672, 0.116915, 0.930584)
bones/13/scale = Vector3(1, 1, 1)
bones/14/position = Vector3(-0.131012, 0.4206, 0.0209323)
bones/14/rotation = Quaternion(0.311801, -0.156763, 0.515707, 0.782465)
bones/14/scale = Vector3(1, 1, 1)
bones/15/rotation = Quaternion(0.0538017, 0.163269, 0.666243, 0.725651)
bones/16/rotation = Quaternion(-0.0440464, 0.00121472, 0.335458, 0.941024)
bones/16/scale = Vector3(1, 1, 1)
bones/17/position = Vector3(-0.14848, 0.144013, -0.0139494)
bones/17/rotation = Quaternion(0.742166, -0.221688, 0.264848, 0.574369)
bones/18/rotation = Quaternion(-0.156224, 0.731565, 0.301322, 0.59128)
bones/19/rotation = Quaternion(0.035527, 0.0722718, 0.344413, 0.935358)
bones/19/scale = Vector3(1, 1, 1)
bones/20/rotation = Quaternion(0.001122, 0.716261, 0.697819, -0.00424113)
[node name="AnimationTree" type="AnimationTree" parent="soldier"]
tree_root = ExtResource("5_c6ikb")
anim_player = NodePath("../AnimationPlayer")
parameters/Walk/blend_position = -0.140741
[node name="Attackzone" parent="." instance=ExtResource("5_sdcjo")]
[node name="healthbar" parent="." instance=ExtResource("5_4b3vr")]
[node name="EnemyTracker" type="Timer" parent="."]
wait_time = 2.0
autostart = true
[node name="enemyDetection" type="Area3D" parent="."]
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="enemyDetection"]
shape = SubResource("SphereShape3D_twqc0")
[node name="Select" parent="." instance=ExtResource("8_j5os0")]
[connection signal="navigation_finished" from="NavigationAgent3D" to="." method="_on_target_reached"]
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_velocity_computed"]
[connection signal="attack" from="Attackzone" to="." method="_on_attackzone_attack"]
[connection signal="timeout" from="EnemyTracker" to="." method="_on_enemy_tracker_timer_timeout"]
[editable path="soldier"]

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,45 @@
class_name WorkerAnt extends Ant
var capacity:=0
var target:Node3D
var source_target:CollectableResource
func _enter_tree() -> void:
Game.instance.score += 1
func _process(delta: float) -> void:
if Player.instance.selected_unit == self:
$image.visible = true
else:
$image.visible = false
$base_ant/AnimationTree.set("parameters/blend_position", velocity.length()/speed)
func on_interact(object:CollisionObject3D, point:Vector3)->void:
target = null
source_target = null
if object is Terrain:
go_to(point)
elif object is CollectableResource:
var resource := object as CollectableResource
target = resource
source_target = resource
go_to(target.global_position)
func _on_target_reached() -> void:
if target is CollectableResource:
var resource := target as CollectableResource
capacity = resource.collect(5)
target = PlayerCamp.instance
go_to(target.global_position)
elif target is PlayerCamp:
var camp := target as PlayerCamp
match source_target.type:
CollectableResource.ResourceType.FOOD:
camp.food_capacity += capacity
CollectableResource.ResourceType.WOOD:
camp.wood_capacity += capacity
CollectableResource.ResourceType.STONE:
camp.stone_capacity += capacity
capacity = 0
target = source_target
go_to(target.global_position)

View File

@@ -0,0 +1,232 @@
[gd_scene load_steps=23 format=4 uid="uid://cbc61u4p4mn05"]
[ext_resource type="Script" path="res://entities/ants/worker_ant.gd" id="1_hmrg3"]
[ext_resource type="PackedScene" uid="uid://v2kcdfr5npqb" path="res://assets/fbx/base_ant.fbx" id="2_b8awe"]
[ext_resource type="Script" path="res://entities/ants/collectable_visualizer.tres.gd" id="3_dmlf0"]
[ext_resource type="Script" path="res://entities/overlay_on_hover.gd" id="3_drusa"]
[ext_resource type="Texture2D" uid="uid://bavm56ag04tga" path="res://assets/textures/ant.png" id="4_s6d2j"]
[ext_resource type="Texture2D" uid="uid://bvq6rr7hgtl3e" path="res://assets/textures/worker_icon.png" id="6_l4m2r"]
[ext_resource type="PackedScene" uid="uid://dtf65yetl4rus" path="res://entities/ants/healthbar.tscn" id="7_vg6jq"]
[ext_resource type="PackedScene" uid="uid://c05rbbsw4du21" path="res://entities/ants/sleect.tscn" id="8_th62q"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bqyr6"]
radius = 0.856327
height = 3.21665
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_litva"]
resource_name = "Material"
vertex_color_use_as_albedo = true
albedo_color = Color(0.36363, 0.36363, 0.36363, 1)
emission_enabled = true
emission = Color(1, 1, 1, 1)
emission_energy_multiplier = 0.0
[sub_resource type="ArrayMesh" id="ArrayMesh_i3u1j"]
_surfaces = [{
"aabb": AABB(-0.0098529, -0.013433, -0.00977134, 0.0196394, 0.0275119, 0.021111),
"format": 34359742465,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAwACAAEABAAAAAIABQAEAAIAAwAFAAIABgADAAEABwABAAAACAAAAAQACQAEAAUACgAFAAMABwAGAAEACAAHAAAACQAIAAQACgAJAAUABgAKAAMACwAGAAcACwAHAAgACwAIAAkACwAJAAoACwAKAAYA"),
"name": "Material",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 12,
"vertex_data": PackedByteArray("3AMIuxIWXLxmcZu7xvD9O5YMI7x21NG7wF6WuKspnjuDgMO7HycJPBiALTz8FyC8jaQVvOPBjjvmopq7zgeSu1KrZjyaxgC8bFcgPH+Qpbv2lrE7aH8CO5GaFbwcLzM7xLLKu58ZM7zIH7w7D24hvAB/9jtcD+k7fWU0O195VDwINek7gWuTOvZ1v7vpyTk8")
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_u8uvg"]
resource_name = "Icosphere_002"
_surfaces = [{
"aabb": AABB(-0.0098529, -0.013433, -0.00977134, 0.0196394, 0.0275119, 0.021111),
"attribute_data": PackedByteArray("Bi+6PaOwVz8Bo4s+o7BXP8MuOj4AAIA/QbroPqOwVz+hLro+AACAPwGjiz6jsFc/YHRRP6OwVz8AAIA/o7BXPzC6aD8AAIA/wOgiP6OwVz9gdFE/o7BXP5AuOj8AAIA/QbroPqOwVz/A6CI/o7BXP/CiCz8AAIA/oS66PlZhLz9Buug+o7BXPwGjiz6jsFc/wy46PlZhLz8Bo4s+o7BXPwYvuj2jsFc/MLpoP1ZhLz8AAIA/o7BXP2B0UT+jsFc/kC46P1ZhLz9gdFE/o7BXP8DoIj+jsFc/8KILP1ZhLz/A6CI/o7BXP0G66D6jsFc/wy46PlZhLz+hLro+VmEvPwGjiz6jsFc/AAAAAFZhLz/DLjo+VmEvPwYvuj2jsFc/kC46P1ZhLz8wumg/VmEvP2B0UT+jsFc/8KILP1ZhLz+QLjo/VmEvP8DoIj+jsFc/oS66PlZhLz/wogs/VmEvP0G66D6jsFc/AaOLPvkRBz+hLro+VmEvP8MuOj5WYS8/Bi+6PfkRBz/DLjo+VmEvPwAAAABWYS8/YHRRP/kRBz8wumg/VmEvP5AuOj9WYS8/wOgiP/kRBz+QLjo/VmEvP/CiCz9WYS8/QbroPvkRBz/wogs/VmEvP6Euuj5WYS8/"),
"format": 34359742487,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsA"),
"material": SubResource("StandardMaterial3D_litva"),
"name": "Material",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 60,
"vertex_data": PackedByteArray("3AMIuxIWXLxmcZu7xvD9O5YMI7x21NG7wF6WuKspnjuDgMO7HycJPBiALTz8FyC8wF6WuKspnjuDgMO7xvD9O5YMI7x21NG7jaQVvOPBjjvmopq73AMIuxIWXLxmcZu7wF6WuKspnjuDgMO7zgeSu1KrZjyaxgC8jaQVvOPBjjvmopq7wF6WuKspnjuDgMO7HycJPBiALTz8FyC8zgeSu1KrZjyaxgC8wF6WuKspnjuDgMO7bFcgPH+Qpbv2lrE7HycJPBiALTz8FyC8xvD9O5YMI7x21NG7aH8CO5GaFbwcLzM7xvD9O5YMI7x21NG73AMIuxIWXLxmcZu7xLLKu58ZM7zIH7w73AMIuxIWXLxmcZu7jaQVvOPBjjvmopq7D24hvAB/9jtcD+k7jaQVvOPBjjvmopq7zgeSu1KrZjyaxgC8fWU0O195VDwINek7zgeSu1KrZjyaxgC8HycJPBiALTz8FyC8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6WmyatrEx2XpabJq2sna6fi1heG+udrp+LWF4b652un4tYXhvr")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_i3u1j")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_canbt"]
albedo_color = Color(0.874529, 0.721894, 0.645742, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_e680x"]
resource_name = "Leaf.001"
vertex_color_use_as_albedo = true
albedo_color = Color(0.0853074, 0.659084, 0.142423, 1)
emission_enabled = true
emission = Color(1, 1, 1, 1)
emission_energy_multiplier = 0.0
[sub_resource type="ArrayMesh" id="ArrayMesh_ffc4j"]
_surfaces = [{
"aabb": AABB(-0.0858499, -0.0503021, -0.00647851, 0.137846, 0.100604, 0.0170829),
"format": 34359742465,
"index_count": 228,
"index_data": PackedByteArray("AAABAAIAAgADAAAABAAFAAYABgAHAAQACAAJAAoACgALAAgADAANAA4ADgAPAAwAEAARABIAEgATABAAFAAVABYAFgAXABQAGAAZABoAGgAbABgAHAAdAB4AHgAfABwAIAAhACIAIgAjACAAJAAgAAwAEAAhACUABgAWAB8AHAAVAAIADQAjABsAGAAiABMACgAXAAUAFAAJAAMADwAHAB4AHgAmAA8AAQARACcAJwAdAAEABAAOABoAGgALAAQAEgAAAAgACAAZABIAJAAMAA8ADwAmACQAJAAlACEAIQAgACQAHAACAAEAAQAdABwAHwAWABUAFQAcAB8AFgAGAAUABQAXABYAFQAUAAMAAwACABUAFwAKAAkACQAUABcACwAKAAUABQAEAAsAGAATABIAEgAZABgAGAAbACMAIwAiABgAIAAjAA0ADQAMACAAIQAQABMAEwAiACEAHwAeAAcABwAGAB8AJQAnABEAEQAQACUAGgAOAA0ADQAbABoACAAAAAMAAwAJAAgAAAASABEAEQABAAAABwAPAA4ADgAEAAcACwAaABkAGQAIAAsAJwAmAB4AHgAdACcAJgAnACUAJQAkACYA"),
"lods": [0.00706801, PackedByteArray("EwABAAIAEQABABMAEAARABMAAgADABMACAATAAMAEwAIABgAAwAJAAgAD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ASpvTOlMrwqvi08D9KvvTGlMryWeSI8")
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_2q5uw"]
resource_name = "Cylinder_003"
_surfaces = [{
"aabb": AABB(-0.0858499, -0.0503021, -0.00647851, 0.137846, 0.100604, 0.0170829),
"attribute_data": PackedByteArray("GUkqP9722z65v08/3vbbPhLRTj8gCeQ+euoqPyIJ5D7Obas+4PbbPgwrqj4gCeQ+vbtEPiQJ5D4dAUE+3vbbPhiVXT7g9ts+FpVdPiAJ5D66mkg/IAnkPrqaSD/g9ts+vrtEPtz2mz4KK6o+4PabPs9tqz4gCaQ+GwFBPiIJpD4S0U4/3vabPrm/Tz8iCaQ+GEkqPyAJpD566io/4PabPhaVXT5w+w0/FJVdPpAEMj+6mkg/kQQyP7yaSD9w+w0/GJVdPt72mz4WlV0+IAmkPrqaSD8iCaQ+uppIP972mz4UlV0+uO9GPxaVXT5IEFk/vJpIP0gQWT+6mkg/ue9GP7yaSD/wtl89FpVdPgC3Xz0UlV0+RBJIPrqaSD9IEkg+AAAAPnLfjT6+7Tc+AACAPr67RD7c9ps+AAAgP3wofj8AAMA+AACAPwAAID9HEHk/vbtEPiQJ5D687Tc+AAAAPwAAAD6QIPI+AAAgP7jvRj8AAMA+AABAPwAAID+E10E/CiuqPuD2mz4hCaQ+AACAPgAAwD7e9ps+AADAPgAAgD4AACA/QBJIPgAAID9AEkg+AADAPiAJ5D4iCaQ+AAAAPwwrqj4gCeQ+AADAPgAAAD8AACA/IAnkPgAAID8gCeQ+GwFBPiIJpD7bU3A+AADAPtLlGT4AAMA+AAAAPo4gsj4AACA/hj1zPwAAID9bH3o/AAAgP7jvZj8AAMA+AABgP85tqz7g9ts+z22rPiAJpD66mkg/IgmkPrqaSD/g9ts+GEkqPyAJpD4ZSSo/3vbbPhiVXT7g9ts+FpVdPiAJpD4AAAA+cN+NPr67RD7c9ps+GwFBPiIJpD4AAAA+jiCyPrqaSD9HEHk/GJVdPkcQeT8AAMA+A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AlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsAPAA9AD4APgA/ADwAQABBAEIAQgBDAEAARABFAEYARgBHAEQASABJAEoASgBLAEgATABNAE4ATgBPAEwAUABRAFIAUgBTAFAAVABVAFYAVgBXAFQAWABZAFoAWgBbAFgAXABdAF4AXgBfAFwAYABhAGIAYgBjAGAAZABlAGYAZgBnAGQAaABpAGoAagBrAGgAbABtAG4AbgBvAGwAcABxAHIAcgBzAHAAdAB1AHYAdgB3AHQAeAB5AHoAegB7AHgAfAB9AH4AfgB/AHwAgACBAIIAggCDAIAAhACFAIYAhgCHAIQAiACJAIoAigCLAIgAjACNAI4AjgCPAIwAkACRAJIAkgCTAJAAlACVAJYAlgCXAJQAmACZAJoAmgCbAJgAnACdAJ4AngCfAJwA"),
"lods": [0.00706801, PackedByteArray("EwABAAIAEQABABMAEAARABMAAgADABMASgATAAMAEwBKAGwAAwCLAEoADQAFAAcALAB9AAcALAAHAAUABQA3ACwANgA3AAUARwBpAAUABQANAEcADQCHAEcABwAPAA0ADQAxADIAJQAxAA0ADQAPACUAPwAlAA8APgA/AA8ADwA9AD4ACAAJAAoAZAAKAAkACQBnAGQACgALAAgAGAAIAAsACwAbABgAGAAbAHIAcgBzABgAoAChAB8AHwCiAKAAoQAcAB8AHgAfABwAHAAdAB4AHgAdAJgAmACZAB4AmQCYAKMAmQCjAKQApAClAJkAIAAhACIAIgAjACAAJwAoACkAggAnAIAAgACBAIIALQAuAC8AVAAvAFYAVgBXAFQAMwA0ADUAOQA6ADsAQABBAEIAQgBDAEAAYABhAGIAYgBjAGAAeAB5AHoAegB7AHgA")],
"material": SubResource("StandardMaterial3D_e680x"),
"name": "Leaf.001",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 166,
"vertex_data": PackedByteArray("d78JPaYNtDxX1Hy77d4GvaENtDzAY4s7QJTFvJoF6Dypa1A7eL8JPZ8F6DxX1Hy7HMADPaQNtDz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/z8VBFvyC+r/P63cEwEL6v8/DwRk8gvq/z925Vv5C+r/P7EAQg4L6v8/pwQgDwvq/z8=")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_ffc4j")
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_bu6rq"]
animation = &"BaseAnt|Idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0up1r"]
animation = &"BaseAnt|Walk"
[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_udmob"]
blend_point_0/node = SubResource("AnimationNodeAnimation_bu6rq")
blend_point_0/pos = 0.0
blend_point_1/node = SubResource("AnimationNodeAnimation_0up1r")
blend_point_1/pos = 1.0
min_space = 0.0
[sub_resource type="Gradient" id="Gradient_36plk"]
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_upbt3"]
gradient = SubResource("Gradient_36plk")
fill = 1
fill_from = Vector2(0, 1)
fill_to = Vector2(1, 1)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_uj2kw"]
texture = SubResource("GradientTexture2D_upbt3")
[node name="WorkerAnt" type="CharacterBody3D"]
axis_lock_angular_x = true
axis_lock_angular_z = true
script = ExtResource("1_hmrg3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.987483, 0.371911)
shape = SubResource("CapsuleShape3D_bqyr6")
[node name="base_ant" parent="." instance=ExtResource("2_b8awe")]
[node name="Skeleton3D" parent="base_ant/BaseAnt" index="0"]
bones/0/rotation = Quaternion(9.9051e-05, -8.31996e-29, 6.6946e-17, 1)
bones/1/rotation = Quaternion(0.0811275, 0.000963642, -0.206745, 0.975025)
bones/3/rotation = Quaternion(0.541099, 0.16567, -0.351117, 0.745978)
bones/4/rotation = Quaternion(-0.275331, 0.0633099, -0.577289, 0.766108)
bones/7/rotation = Quaternion(0.674429, 0.240017, -0.247256, 0.652994)
bones/8/rotation = Quaternion(0.0099471, -0.0269178, -0.678221, 0.734297)
bones/11/rotation = Quaternion(0.731112, 0.216438, -0.270013, 0.587982)
bones/12/rotation = Quaternion(0.0469251, -0.0954517, -0.66037, 0.74337)
bones/15/rotation = Quaternion(0.541099, -0.16567, 0.351117, 0.745978)
bones/17/rotation = Quaternion(-0.185361, -0.0767715, 0.304188, 0.931245)
bones/19/rotation = Quaternion(0.674429, -0.240017, 0.247256, 0.652994)
bones/20/rotation = Quaternion(0.0099471, 0.0269178, 0.678221, 0.734297)
bones/23/rotation = Quaternion(0.731112, -0.216438, 0.270013, 0.587982)
bones/24/rotation = Quaternion(0.0469251, 0.0954517, 0.66037, 0.74337)
bones/27/rotation = Quaternion(0, 0, 1, 0)
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="base_ant/BaseAnt/Skeleton3D" index="0"]
transform = Transform3D(0.914511, 0.40332, -0.0316663, -0.403001, 0.901318, -0.158797, -0.0355045, 0.157983, 0.986803, 1.16994e-19, 0.00431615, 0.00552689)
bone_name = "Head"
bone_idx = 1
[node name="Food" type="MeshInstance3D" parent="base_ant/BaseAnt/Skeleton3D/BoneAttachment3D" node_paths=PackedStringArray("ant")]
transform = Transform3D(0.529327, -8.27181e-25, 0, 0, 0.529327, -1.11759e-08, -3.10193e-25, 0, 0.529327, -3.47747e-19, 0.0145688, -0.000891426)
mesh = SubResource("ArrayMesh_u8uvg")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_canbt")
script = ExtResource("3_dmlf0")
ant = NodePath("../../../../..")
[node name="Stone" type="MeshInstance3D" parent="base_ant/BaseAnt/Skeleton3D/BoneAttachment3D" node_paths=PackedStringArray("ant")]
transform = Transform3D(0.529327, -8.27181e-25, 0, 0, 0.529327, -1.11759e-08, -3.10193e-25, 0, 0.529327, -3.47747e-19, 0.0145688, -0.000891426)
mesh = SubResource("ArrayMesh_u8uvg")
skeleton = NodePath("")
script = ExtResource("3_dmlf0")
type = 1
ant = NodePath("../../../../..")
[node name="Leaf" type="MeshInstance3D" parent="base_ant/BaseAnt/Skeleton3D/BoneAttachment3D" node_paths=PackedStringArray("ant")]
transform = Transform3D(-0.0933726, -0.0249202, -0.782633, -0.114132, -0.0507136, 0.603702, -0.0552145, 0.14697, 0.0756109, -0.00130663, 0.0167936, 0.00209703)
mesh = SubResource("ArrayMesh_2q5uw")
skeleton = NodePath("")
script = ExtResource("3_dmlf0")
type = 2
ant = NodePath("../../../../..")
[node name="Head2" parent="base_ant/BaseAnt/Skeleton3D" index="1"]
script = ExtResource("3_drusa")
[node name="AnimationTree" type="AnimationTree" parent="base_ant"]
tree_root = SubResource("AnimationNodeBlendSpace1D_udmob")
anim_player = NodePath("../AnimationPlayer")
parameters/blend_position = 0.0
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
target_desired_distance = 2.0
avoidance_enabled = true
debug_path_custom_color = Color(0.3, 0.381667, 1, 1)
[node name="image" type="Panel" parent="."]
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -186.0
offset_right = 186.0
grow_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxTexture_uj2kw")
[node name="TextureRect" type="TextureRect" parent="image"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -186.0
offset_right = 186.0
grow_vertical = 0
texture = ExtResource("4_s6d2j")
expand_mode = 1
stretch_mode = 4
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("6_l4m2r")
[node name="healthbar" parent="." instance=ExtResource("7_vg6jq")]
[node name="Node3D" parent="." instance=ExtResource("8_th62q")]
[connection signal="mouse_entered" from="." to="base_ant/BaseAnt/Skeleton3D/Head2" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="base_ant/BaseAnt/Skeleton3D/Head2" method="_on_mouse_exited"]
[connection signal="navigation_finished" from="NavigationAgent3D" to="." method="_on_target_reached"]
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_velocity_computed"]
[editable path="base_ant"]

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://dw8pefngely67"]
[ext_resource type="Script" path="res://entities/buildings/arrow.gd" id="1_cc6i4"]
[ext_resource type="PackedScene" uid="uid://djwo81th50yfi" path="res://assets/fbx/arrow.fbx" id="1_ctgjr"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_qal86"]
height = 2.61515
[node name="Arrow" type="Area3D"]
monitorable = false
script = ExtResource("1_cc6i4")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1.91069e-15, 4.37114e-08, 1, 1, -4.37114e-08, 0, 4.37114e-08, 1, -4.37114e-08, 0, 0, 0)
shape = SubResource("CapsuleShape3D_qal86")
[node name="arrow" parent="." instance=ExtResource("1_ctgjr")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@@ -0,0 +1,15 @@
extends Area3D
func _process(delta: float) -> void:
global_position += global_basis.z * delta * 25
#var enemies := get_overlapping_bodies().filter(
#func(body:Node3D)->bool: return body is EnemyAnt
#)
#for enemy:EnemyAnt in enemies:
#enemy.hit(6)
#
func _on_body_entered(body: Node3D) -> void:
if body is EnemyAnt:
var enemy := body as EnemyAnt
enemy.hit(6)

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,22 @@
class_name Ballista extends Building
var target:EnemyAnt
var arrow_scene := preload("res://entities/buildings/Arrow.tscn")
func _process(delta: float) -> void:
if target != null:
$pivot.look_at(target.global_position)
func _on_timer_timeout() -> void:
if target == null or target.global_position.distance_to(global_position)>50:
var target_area := $targetArea as Area3D
var targets := target_area.get_overlapping_bodies().filter(
func(body:Node3D)->bool: return body is EnemyAnt
)
if targets.is_empty(): return
target = targets.pick_random()
var arrow := arrow_scene.instantiate() as Area3D
$pivot.add_child(arrow)
arrow.rotation.y = PI
arrow.global_position = $pivot.global_position + Vector3.UP*0.25

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
class_name Building extends StaticBody3D
@export var max_health := 10
@onready var health := max_health
func hit(damage:int) -> void:
health -= damage
if health < 0:
queue_free()

View File

@@ -0,0 +1,14 @@
[gd_scene load_steps=2 format=3 uid="uid://c36qc7q4r0juf"]
[ext_resource type="Script" path="res://scenes/enemy_ants.gd" id="1_t0wxe"]
[node name="EnemySpawn" type="Marker3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -39.5054, 0, -85.415)
script = ExtResource("1_t0wxe")
[node name="Timer" type="Timer" parent="."]
autostart = true
[node name="Ants" type="Node" parent="."]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View File

@@ -0,0 +1,69 @@
class_name PlayerCamp extends Building
static var instance:PlayerCamp
var food_capacity:=100
var wood_capacity:=100
var stone_capacity:=100
var active_indicator:Indicator
func _init() -> void:
instance = self
func _exit_tree() -> void:
Game.instance.game_over()
func on_interact(object:CollisionObject3D, point:Vector3)->void:
if object is Terrain and active_indicator != null:
if active_indicator.type == Indicator.IndicatorType.ANT_WORKER:
var worker_scene := load("res://entities/ants/worker_ant.tscn") as PackedScene
buy_ant(20, point, worker_scene)
if active_indicator.type == Indicator.IndicatorType.ANT_SOLDIER:
var soldier_scene := load("res://entities/ants/soldier_ant.tscn") as PackedScene
buy_ant(40, point, soldier_scene)
if active_indicator.type == Indicator.IndicatorType.BUILDING_BALISTA:
var ballista_scene := load("res://entities/buildings/ballista.tscn") as PackedScene
buy_building(40, 40, point, ballista_scene)
func _on_worker_pressed() -> void:
if active_indicator != null: active_indicator.queue_free()
var worker_indicator_scene := load("res://entities/ants/worker_indicator.tscn") as PackedScene
active_indicator = worker_indicator_scene.instantiate() as Indicator
add_child(active_indicator)
func _on_soldier_pressed() -> void:
if active_indicator != null: active_indicator.queue_free()
var soldier_indicator_scene := load("res://entities/ants/soldier_indicator.tscn") as PackedScene
active_indicator = soldier_indicator_scene.instantiate() as Indicator
add_child(active_indicator)
func _on_balista_pressed() -> void:
if active_indicator != null: active_indicator.queue_free()
var ballista_indicator_scene := load("res://entities/buildings/balista_indicator.tscn") as PackedScene
active_indicator = ballista_indicator_scene.instantiate() as Indicator
add_child(active_indicator)
func buy_ant(food:int, point:Vector3, ant_scene:PackedScene)->void:
if food_capacity < food: return
food_capacity -= food
if food_capacity < food: active_indicator.queue_free()
var ant:= ant_scene.instantiate() as Ant
Player.instance.get_node("Ants").add_child(ant)
ant.global_position = point
func buy_building(stone:int, wood:int, point:Vector3, building_scene:PackedScene)->void:
if stone_capacity < stone or wood_capacity < wood: return
stone_capacity -= stone
wood_capacity -= wood
if stone_capacity < stone or wood_capacity < wood: active_indicator.queue_free()
var building:= building_scene.instantiate() as Node3D
Player.instance.get_node("Buildings").add_child(building)
building.global_position = point
Terrain.instance.refresh_navmap()
func _on_timer_timeout() -> void:
if health < max_health:
health += 1

View File

@@ -0,0 +1,288 @@
[gd_scene load_steps=24 format=3 uid="uid://b1b7efqg14tt3"]
[ext_resource type="Script" path="res://entities/buildings/player_camp.gd" id="1_kq4x7"]
[ext_resource type="PackedScene" uid="uid://dg5p1vlgmycl4" path="res://assets/fbx/temple.fbx" id="2_aaq5d"]
[ext_resource type="Texture2D" uid="uid://cg6qp7raun8x7" path="res://assets/textures/icons/temple.png" id="3_gks02"]
[ext_resource type="Texture2D" uid="uid://y75pedv63owl" path="res://assets/textures/icons/foodicon.png" id="5_hua3m"]
[ext_resource type="Texture2D" uid="uid://c2uk3aoo6wbpy" path="res://assets/textures/icons/woodicon.png" id="6_pteps"]
[ext_resource type="Texture2D" uid="uid://iftvude25iw" path="res://assets/textures/icons/stoneicon.png" id="7_217be"]
[ext_resource type="Texture2D" uid="uid://flbtrl8g838a" path="res://assets/textures/background_green.png" id="8_7h6r1"]
[ext_resource type="Texture2D" uid="uid://qf0d41ilx4f8" path="res://assets/textures/background_red.png" id="8_cqwcq"]
[ext_resource type="Texture2D" uid="uid://bavm56ag04tga" path="res://assets/textures/ant.png" id="8_qcgtm"]
[ext_resource type="Texture2D" uid="uid://cdd5spo86if85" path="res://assets/textures/soldier_ant.png" id="9_j7ooj"]
[ext_resource type="Texture2D" uid="uid://cr5tsywlrp3e0" path="res://assets/textures/ballista.png" id="12_8fevw"]
[ext_resource type="PackedScene" uid="uid://dtf65yetl4rus" path="res://entities/ants/healthbar.tscn" id="13_0oymu"]
[sub_resource type="BoxShape3D" id="BoxShape3D_6vqva"]
size = Vector3(0.03, 0.0703308, 0.0250723)
[sub_resource type="Gradient" id="Gradient_0pgrn"]
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_vi8kg"]
gradient = SubResource("Gradient_0pgrn")
fill = 1
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_owdd5"]
texture = SubResource("GradientTexture2D_vi8kg")
[sub_resource type="GDScript" id="GDScript_543f2"]
script/source = "extends HBoxContainer
func _process(delta: float) -> void:
$Food.text = \"Food: %5d\" % PlayerCamp.instance.food_capacity
$Wood.text = \"Wood: %5d\" % PlayerCamp.instance.wood_capacity
$Stone.text = \"Stone: %5d\" % PlayerCamp.instance.stone_capacity
"
[sub_resource type="Gradient" id="Gradient_7vn4a"]
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_loiqi"]
gradient = SubResource("Gradient_7vn4a")
fill = 1
fill_from = Vector2(0.5, 1)
fill_to = Vector2(0.5, 0.5)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_m4vot"]
texture = SubResource("GradientTexture2D_loiqi")
[sub_resource type="GDScript" id="GDScript_66i81"]
script/source = "extends Panel
func _process(delta: float) -> void:
$HBoxContainer/Worker/Worker.disabled = PlayerCamp.instance.food_capacity < 20
$HBoxContainer/Soldier/Soldier.disabled = PlayerCamp.instance.food_capacity < 40
$HBoxContainer/Balista/AspectRatioContainer/balista.disabled = PlayerCamp.instance.stone_capacity < 40 or PlayerCamp.instance.wood_capacity < 40
"
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_hx5fy"]
texture = ExtResource("8_cqwcq")
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_84sr8"]
texture = ExtResource("8_7h6r1")
[node name="PlayerCamp" type="StaticBody3D" groups=["NavmeshTargets"]]
script = ExtResource("1_kq4x7")
max_health = 100
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(100, 0, 0, 0, -1.19209e-05, 100, 0, -100, -1.19209e-05, -0.0326234, 1.22666, 0.0199586)
shape = SubResource("BoxShape3D_6vqva")
[node name="temple" parent="." instance=ExtResource("2_aaq5d")]
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("3_gks02")
[node name="ResourcePanel" type="Panel" parent="."]
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 66.0
grow_horizontal = 2
theme_override_styles/panel = SubResource("StyleBoxTexture_owdd5")
[node name="ResourceTab" type="HBoxContainer" parent="ResourcePanel"]
layout_mode = 2
offset_right = 351.0
offset_bottom = 42.0
theme_override_constants/separation = 10
script = SubResource("GDScript_543f2")
[node name="TextureRect" type="TextureRect" parent="ResourcePanel/ResourceTab"]
layout_mode = 2
texture = ExtResource("5_hua3m")
expand_mode = 2
[node name="Food" type="Label" parent="ResourcePanel/ResourceTab"]
layout_mode = 2
text = "test"
[node name="Control" type="Control" parent="ResourcePanel/ResourceTab"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
[node name="TextureRect2" type="TextureRect" parent="ResourcePanel/ResourceTab"]
layout_mode = 2
texture = ExtResource("6_pteps")
expand_mode = 2
[node name="Wood" type="Label" parent="ResourcePanel/ResourceTab"]
layout_mode = 2
[node name="Control2" type="Control" parent="ResourcePanel/ResourceTab"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
[node name="TextureRect3" type="TextureRect" parent="ResourcePanel/ResourceTab"]
layout_mode = 2
texture = ExtResource("7_217be")
expand_mode = 2
[node name="Stone" type="Label" parent="ResourcePanel/ResourceTab"]
layout_mode = 2
[node name="RecruitOptions" type="Panel" parent="."]
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -120.0
grow_horizontal = 2
grow_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxTexture_m4vot")
script = SubResource("GDScript_66i81")
[node name="Label" type="Label" parent="RecruitOptions"]
layout_mode = 0
offset_right = 40.0
offset_bottom = 42.0
[node name="HBoxContainer" type="HBoxContainer" parent="RecruitOptions"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -25.0
offset_top = -50.0
offset_right = 25.0
grow_horizontal = 2
grow_vertical = 0
theme_override_constants/separation = 50
[node name="Worker" type="VBoxContainer" parent="RecruitOptions/HBoxContainer"]
layout_mode = 2
[node name="Worker" type="Button" parent="RecruitOptions/HBoxContainer/Worker"]
custom_minimum_size = Vector2(75, 75)
layout_mode = 2
focus_mode = 0
theme_override_colors/icon_pressed_color = Color(0, 0, 1, 1)
theme_override_colors/icon_hover_color = Color(0, 1, 0, 1)
theme_override_styles/disabled = SubResource("StyleBoxTexture_hx5fy")
theme_override_styles/hover = SubResource("StyleBoxTexture_84sr8")
theme_override_styles/pressed = SubResource("StyleBoxTexture_84sr8")
theme_override_styles/normal = SubResource("StyleBoxTexture_84sr8")
icon = ExtResource("8_qcgtm")
expand_icon = true
[node name="HBoxContainer" type="HBoxContainer" parent="RecruitOptions/HBoxContainer/Worker"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="RecruitOptions/HBoxContainer/Worker/HBoxContainer"]
layout_mode = 2
texture = ExtResource("5_hua3m")
expand_mode = 2
[node name="Label" type="Label" parent="RecruitOptions/HBoxContainer/Worker/HBoxContainer"]
layout_mode = 2
text = "20"
horizontal_alignment = 1
[node name="Soldier" type="VBoxContainer" parent="RecruitOptions/HBoxContainer"]
layout_mode = 2
[node name="Soldier" type="Button" parent="RecruitOptions/HBoxContainer/Soldier"]
custom_minimum_size = Vector2(75, 75)
layout_mode = 2
focus_mode = 0
theme_override_colors/icon_pressed_color = Color(0, 0, 1, 1)
theme_override_colors/icon_hover_color = Color(0, 1, 0, 1)
theme_override_styles/disabled = SubResource("StyleBoxTexture_hx5fy")
theme_override_styles/hover = SubResource("StyleBoxTexture_84sr8")
theme_override_styles/pressed = SubResource("StyleBoxTexture_84sr8")
theme_override_styles/normal = SubResource("StyleBoxTexture_84sr8")
icon = ExtResource("9_j7ooj")
expand_icon = true
[node name="HBoxContainer" type="HBoxContainer" parent="RecruitOptions/HBoxContainer/Soldier"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="RecruitOptions/HBoxContainer/Soldier/HBoxContainer"]
layout_mode = 2
texture = ExtResource("5_hua3m")
expand_mode = 2
[node name="Label" type="Label" parent="RecruitOptions/HBoxContainer/Soldier/HBoxContainer"]
layout_mode = 2
text = "40"
horizontal_alignment = 1
[node name="Balista" type="VBoxContainer" parent="RecruitOptions/HBoxContainer"]
layout_mode = 2
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="RecruitOptions/HBoxContainer/Balista"]
layout_mode = 2
[node name="balista" type="Button" parent="RecruitOptions/HBoxContainer/Balista/AspectRatioContainer"]
custom_minimum_size = Vector2(75, 75)
layout_mode = 2
size_flags_vertical = 4
focus_mode = 0
theme_override_colors/icon_pressed_color = Color(0, 0, 1, 1)
theme_override_colors/icon_hover_color = Color(0, 1, 0, 1)
theme_override_styles/disabled = SubResource("StyleBoxTexture_hx5fy")
theme_override_styles/hover = SubResource("StyleBoxTexture_84sr8")
theme_override_styles/pressed = SubResource("StyleBoxTexture_84sr8")
theme_override_styles/normal = SubResource("StyleBoxTexture_84sr8")
icon = ExtResource("12_8fevw")
expand_icon = true
[node name="HBoxContainer" type="HBoxContainer" parent="RecruitOptions/HBoxContainer/Balista"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="RecruitOptions/HBoxContainer/Balista/HBoxContainer"]
layout_mode = 2
texture = ExtResource("6_pteps")
expand_mode = 2
[node name="TextureRect2" type="TextureRect" parent="RecruitOptions/HBoxContainer/Balista/HBoxContainer/TextureRect"]
show_behind_parent = true
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -49.0
offset_top = -24.0
offset_right = -18.0
offset_bottom = 7.0
grow_horizontal = 0
grow_vertical = 2
texture = ExtResource("7_217be")
expand_mode = 2
[node name="Label" type="Label" parent="RecruitOptions/HBoxContainer/Balista/HBoxContainer"]
layout_mode = 2
text = "40"
horizontal_alignment = 1
[node name="Healthbar" parent="." instance=ExtResource("13_0oymu")]
transform = Transform3D(5, 0, 0, 0, 1.5, 0, 0, 0, 1, 0, 0, 0)
[node name="Area3D" type="Area3D" parent="."]
monitoring = false
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(100, 0, 0, 0, -1.19209e-05, 100, 0, -100, -1.19209e-05, -0.0326234, 1.22666, 0.0199586)
shape = SubResource("BoxShape3D_6vqva")
[node name="Timer" type="Timer" parent="."]
wait_time = 10.0
autostart = true
[connection signal="mouse_entered" from="." to="temple/Temple" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="temple/Temple" method="_on_mouse_exited"]
[connection signal="pressed" from="RecruitOptions/HBoxContainer/Worker/Worker" to="." method="_on_worker_pressed"]
[connection signal="pressed" from="RecruitOptions/HBoxContainer/Soldier/Soldier" to="." method="_on_soldier_pressed"]
[connection signal="pressed" from="RecruitOptions/HBoxContainer/Balista/AspectRatioContainer/balista" to="." method="_on_balista_pressed"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
[editable path="temple"]

View File

@@ -1,11 +0,0 @@
extends Faction
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@@ -1,13 +0,0 @@
class_name Faction extends Node
var buildings:Array[Node3D]:
get:
var buildings:Array[Node3D]
buildings.assign($Buildings.get_children())
return buildings
var units:Array[Node3D]:
get:
var buildings:Array[Node3D]
buildings.assign($Units.get_children())
return buildings

View File

@@ -1,47 +0,0 @@
class_name FogOfWar extends Node
@export var visual:bool = true
@export var width:int = 20
@export var height:int = 20
var size:int:
get: return width*height
var faction:Faction:
get: return get_parent() as Faction
var grid:Array[bool] = []
func _ready() -> void:
if not visual: $FogOfWarVisual.queue_free()
generate_new_grid()
visualize_grid()
func _on_tick() -> void:
update_fog_of_war()
visualize_grid()
func generate_new_grid()->void:
grid.resize(size)
for i in range(size):
grid[i] = true
func visualize_grid()->void:
if not has_node("FogOfWarVisual"): return
var fog_of_war_visual := $FogOfWarVisual as GridMap
for i in range(size):
var item := 0 if grid[i] else -1
fog_of_war_visual.set_cell_item(c2p(i2c(i)), item)
func update_fog_of_war()->void:
var entities := faction.buildings + faction.units
for i in range(size):
grid[i] = grid[i] and not entities.map(
func(entity:Node3D)->bool:
return entity.position.distance_squared_to(c2p(i2c(i))) < 10
).has(true)
# Converters from coordinates to index values
func c2i(coor:Vector2i)->int: return coor.x+coor.y*width
func i2c(index:int)->Vector2i: return Vector2i(index%width, index/width)
func c2p(coor:Vector2i)->Vector3i: return Vector3i(coor.x-width/2, 0, coor.y-height/2)

View File

@@ -1,18 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://ch7ug2prgwyyn"]
[ext_resource type="Script" path="res://entities/faction/fog_of_war.gd" id="1_bm7vn"]
[ext_resource type="MeshLibrary" uid="uid://cesuajklj4ds4" path="res://resources/meshlib.tres" id="2_5docv"]
[node name="FogOfWar" type="Node"]
script = ExtResource("1_bm7vn")
[node name="TickTimer" type="Timer" parent="."]
wait_time = 0.5
autostart = true
[node name="FogOfWarVisual" type="GridMap" parent="."]
mesh_library = ExtResource("2_5docv")
cell_size = Vector3(1, 1, 1)
metadata/_editor_floor_ = Vector3(0, 0, 0)
[connection signal="timeout" from="TickTimer" to="." method="_on_tick"]

View File

@@ -1,11 +0,0 @@
extends Faction
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@@ -1,33 +0,0 @@
extends Camera3D
var move_speed : float = 5
var tilt_speed : float = 2
func _process(delta: float) -> void:
process_movement_speed()
process_movement(delta)
process_camera_tilt(delta)
func process_movement(delta:float) -> void:
var input_vector := Vector3.ZERO;
input_vector += Vector3.UP * Input.get_axis("move_down", "move_up")
input_vector += Vector3.FORWARD * Input.get_axis("move_back", "move_forward")
input_vector += Vector3.RIGHT * Input.get_axis("move_left", "move_right")
translate(input_vector * move_speed * delta)
position.y = clampf(position.y, 2, 20)
func process_movement_speed() -> void:
if Input.is_action_just_released("move_increase"):
move_speed = clampf(move_speed + 1, 1, 10)
if Input.is_action_just_released("move_decrease"):
move_speed = clampf(move_speed-1, 1, 10)
func process_camera_tilt(delta: float) -> void:
if Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT):
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
var mouse_move := -Input.get_last_mouse_velocity().normalized()
mouse_move *= tilt_speed * delta
rotation.y = rotation.y + mouse_move.x
rotation.x =clampf(rotation.x + mouse_move.y, -PI/2, 0)
else:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE

View File

@@ -0,0 +1,8 @@
extends MeshInstance3D
func _on_mouse_entered() -> void:
var overlay_material := preload("res://resources/selectable_overlay.tres") as StandardMaterial3D
material_overlay = overlay_material
func _on_mouse_exited() -> void:
material_overlay = null

View File

@@ -0,0 +1,19 @@
class_name CollectableResource extends StaticBody3D
enum ResourceType {FOOD, STONE, WOOD}
@export var type:ResourceType
var capacity := 100
func collect(amount:int)->int:
if capacity > amount:
capacity -= amount
return amount
else:
var remains := capacity
capacity = 0
return remains
func _on_tick() -> void:
if capacity < 100: return
capacity += 1

View File

@@ -0,0 +1,41 @@
[gd_scene load_steps=7 format=3 uid="uid://dsx7wydm6py7h"]
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_ys2g0"]
[ext_resource type="PackedScene" uid="uid://csjoq8lb6gctu" path="res://assets/fbx/food.fbx" id="2_pn8lj"]
[ext_resource type="Script" path="res://entities/overlay_on_hover.gd" id="3_sy2bo"]
[ext_resource type="Texture2D" uid="uid://y75pedv63owl" path="res://assets/textures/icons/foodicon.png" id="4_w3ttc"]
[sub_resource type="SphereShape3D" id="SphereShape3D_g8vog"]
radius = 2.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_llrdr"]
albedo_color = Color(0.41, 0.285223, 0.0697, 1)
[node name="FoodResource" type="StaticBody3D" groups=["NavmeshTargets"]]
script = ExtResource("1_ys2g0")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.442429, 0)
shape = SubResource("SphereShape3D_g8vog")
[node name="Timer" type="Timer" parent="."]
autostart = true
[node name="food" parent="." instance=ExtResource("2_pn8lj")]
transform = Transform3D(1, 0, 0, 0, 0.00624819, -0.99998, 0, 0.99998, 0.00624819, 0, 0.444963, 0)
[node name="Food" parent="food" index="0"]
surface_material_override/2 = SubResource("StandardMaterial3D_llrdr")
script = ExtResource("3_sy2bo")
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("4_w3ttc")
[connection signal="mouse_entered" from="." to="food/Food" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="food/Food" method="_on_mouse_exited"]
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
[editable path="food"]

View File

@@ -0,0 +1,32 @@
[gd_scene load_steps=5 format=3 uid="uid://kslywe6neejo"]
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_ybx4f"]
[ext_resource type="PackedScene" uid="uid://rheyik3n6qia" path="res://assets/fbx/rock.fbx" id="2_uwrg3"]
[ext_resource type="Texture2D" uid="uid://iftvude25iw" path="res://assets/textures/icons/stoneicon.png" id="3_uq1d7"]
[sub_resource type="SphereShape3D" id="SphereShape3D_2ifhi"]
radius = 1.9217
[node name="StoneResource" type="StaticBody3D" groups=["NavmeshTargets"]]
script = ExtResource("1_ybx4f")
type = 1
[node name="Timer" type="Timer" parent="."]
autostart = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.845515, 0)
shape = SubResource("SphereShape3D_2ifhi")
[node name="rock" parent="." instance=ExtResource("2_uwrg3")]
transform = Transform3D(0.97435, -0.225036, 0, 0.225036, 0.97435, 0, 0, 0, 1, 0.497189, 0.726997, -2.5003)
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("3_uq1d7")
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
[editable path="rock"]

View File

@@ -0,0 +1,39 @@
[gd_scene load_steps=6 format=3 uid="uid://kh5xmgawk26n"]
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_khlta"]
[ext_resource type="PackedScene" uid="uid://87uikru2r8pc" path="res://assets/fbx/plant.fbx" id="2_u6krj"]
[ext_resource type="Texture2D" uid="uid://c2uk3aoo6wbpy" path="res://assets/textures/icons/woodicon.png" id="3_i5i26"]
[sub_resource type="SphereShape3D" id="SphereShape3D_32b8q"]
radius = 2.49866
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_do68j"]
albedo_color = Color(0.53, 0.366053, 0.1908, 1)
[node name="WoodResource" type="StaticBody3D" groups=["NavmeshTargets"]]
script = ExtResource("1_khlta")
type = 2
[node name="Timer" type="Timer" parent="."]
autostart = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00649216, 0.935511, 0.0162298)
shape = SubResource("SphereShape3D_32b8q")
[node name="plant" parent="." instance=ExtResource("2_u6krj")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.08594, 0)
[node name="Plant" parent="plant" index="0"]
transform = Transform3D(10, 0, 0, 0, -4.37114e-07, 62.94, 0, -10, -2.75119e-06, 0.00649216, 1.08982, 0.0162298)
surface_material_override/0 = SubResource("StandardMaterial3D_do68j")
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 20, 0)
layers = 2
billboard = 1
texture = ExtResource("3_i5i26")
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
[editable path="plant"]

View File

@@ -0,0 +1,13 @@
class_name Terrain extends StaticBody3D
static var instance:Terrain
func _init() -> void:
instance = self
func _ready() -> void:
refresh_navmap()
func refresh_navmap()->void:
$NavigationRegion3D.bake_navigation_mesh()

File diff suppressed because one or more lines are too long