mirror of
https://github.com/tonytins/citylimits
synced 2025-06-26 17:54:43 -04:00
Basic AI
- If a power plant is present, the zone animates. Just like the original. - Your budget also goes through the roof This is just a proof-of-concept right now, and will likely crash your machine if you leave it on too long.
This commit is contained in:
parent
5fa863114a
commit
239fa63a0c
9 changed files with 236 additions and 177 deletions
|
@ -1,7 +1,10 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/power_station.gd" type="Script" id=1]
|
||||
[ext_resource path="res://scripts/simtactics/turn_on.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/coal.png" type="Texture" id=2]
|
||||
[ext_resource path="res://addons/beehave/nodes/composites/sequence.gd" type="Script" id=3]
|
||||
[ext_resource path="res://scripts/simtactics/zone.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/beehave/nodes/beehave_root.gd" type="Script" id=6]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 32.2297, 31.8602 )
|
||||
|
@ -26,9 +29,19 @@ tracks/0/keys = {
|
|||
|
||||
[node name="PowerStation" type="KinematicBody2D"]
|
||||
input_pickable = true
|
||||
|
||||
[node name="BeehaveRoot" type="Node" parent="."]
|
||||
script = ExtResource( 6 )
|
||||
|
||||
[node name="SequenceComposite" type="Node" parent="BeehaveRoot"]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="TurnOn" type="Node" parent="BeehaveRoot/SequenceComposite"]
|
||||
script = ExtResource( 1 )
|
||||
income = 0
|
||||
expense = 250
|
||||
|
||||
[node name="ActionLeaf" type="Node" parent="BeehaveRoot/SequenceComposite"]
|
||||
script = ExtResource( 4 )
|
||||
zone_texture = "res://assets/res_houses.png"
|
||||
|
||||
[node name="Quarters" type="Timer" parent="."]
|
||||
wait_time = 10.0
|
||||
|
@ -44,5 +57,3 @@ playback_speed = 5.0
|
|||
anims/Animante = SubResource( 2 )
|
||||
|
||||
[node name="RayCast2D" type="RayCast2D" parent="."]
|
||||
|
||||
[connection signal="timeout" from="Quarters" to="." method="_on_Quarters_timeout"]
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/zone.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/res_zones.png" type="Texture" id=2]
|
||||
[ext_resource path="res://scripts/simtactics/has_power.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/beehave/nodes/beehave_root.gd" type="Script" id=5]
|
||||
[ext_resource path="res://addons/beehave/nodes/composites/selector.gd" type="Script" id=7]
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "Animante"
|
||||
length = 5.0
|
||||
step = 1.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
|
@ -17,7 +20,22 @@ tracks/0/keys = {
|
|||
"times": PoolRealArray( 0, 1, 2, 3, 4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 1, 2, 3, 4, 6 ]
|
||||
"values": [ 0, 1, 2, 3, 4 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ 1 ]
|
||||
}
|
||||
|
||||
[sub_resource type="CircleShape2D" id=3]
|
||||
|
@ -26,15 +44,26 @@ radius = 34.955
|
|||
[node name="Zone" type="Area2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Quarters" type="Timer" parent="."]
|
||||
wait_time = 10.0
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
vframes = 19
|
||||
frame = 1
|
||||
|
||||
[node name="BeehaveRoot" type="Node" parent="."]
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="SelectorComposite" type="Node" parent="BeehaveRoot"]
|
||||
script = ExtResource( 7 )
|
||||
|
||||
[node name="HasPower" type="Node" parent="BeehaveRoot/SelectorComposite"]
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="Quarters" type="Timer" parent="."]
|
||||
wait_time = 10.0
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
anims/Animante = SubResource( 2 )
|
||||
anims/RESET = SubResource( 4 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 3 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue