Initial foundation for VR Mode

A lot has happened since May that I couldn't begin to describe what was working at the time. What I can tell you that is new as of this commit is an upcoming VR mode.
This commit is contained in:
Tony Bark 2021-09-24 11:12:02 -04:00
parent ef6b097ef2
commit 1f038ea53c
16 changed files with 374 additions and 318 deletions

View file

@ -1 +1,11 @@
# City Limits # City Limits
City Limits is a re-imagining of SimCity Classic that brings modern city building concepts to the classic game.
## Advisors
Advisors were first introduced in the SNES version of SimCity.
## Upgrades
Though SimCity: BuildIt is a microtransaction hell, it functions very similar to classic in that zones are dragged and dropped down, instead of painted, but differs in h

42
docs/octy.md Normal file
View file

@ -0,0 +1,42 @@
# Open City Spec
*This ia WIP save file structure.*
Save file in City Limits are nothing more than JSON files.
## Top-level
```json
{
"city": "",
"mayor": "",
"version": "",
}
```
## Zones
```json
{
"zones": {
"commercial": {},
"residential": {},
"industrial": {}
}
}
```
Within each zone type are the zones themselves with their coordinates on the map. Each zone is given a random number as an id.
```json
{
"1": {
"x": 654,
"y": 564
},
"2": {
"x": 321,
"y": 85
}
}
```

View file

@ -1,6 +1,6 @@
{ {
"1": { "name": "Cindy Diamond",
"name": "Roll up your sleeves, Mayor!", "messages": {
"text": "Nice to meet you, Mayor [name]. I'm Cindy, your city planner. I'll be helping you with zoning, land values, and handling connections to and from the city." "welcome": "Nice to meet you, Mayor [name]. I'm Cindy, your city planner. I'll be helping you with zoning, land values, and handling connections to and from the city."
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"1": { "name": "Kit Welsh",
"name": "Let's get number crunching.", "messages": {
"text": "Hello, Mayor, I'm Kit Welsh. I'll be your financial advisor. I control the income and expenditures for your city. I'll keep you up-to-date on expenditures and let you know if we may need to lower or rise taxes." "welcome": "Hello, Mayor, I'm Kit Welsh. I'll be your financial advisor. I control the income and expenditures for your city. I'll keep you up-to-date on expenditures and let you know if we may need to lower or rise taxes."
} }
} }

View file

@ -0,0 +1,4 @@
{
"name:": "Zack Casey",
"messages": {}
}

43
json/saves/octy_file.json Normal file
View file

@ -0,0 +1,43 @@
{
"city": "Furtropolis",
"mayor": "Defacto",
"version": "0.1",
"zones": {
"commercial": {
"1": {
"x": 654,
"y": 564
},
"2": {
"x": 321,
"y": 85
}
},
"residential": {
"1": {
"x": 315,
"y": 564
},
"2": {
"x": 874,
"y": 843
}
},
"industrial": {
"1": {
"x": 156,
"y": 489
},
"2": {
"x": 845,
"y": 314
}
}
},
"buildings": {
"coal": {
"x": 648,
"y": 654
}
}
}

View file

@ -1,27 +0,0 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://sprites/water.tres" type="TileSet" id=1]
[ext_resource path="res://scripts/map_generator.gd" type="Script" id=2]
[ext_resource path="res://sprites/terrian.tres" type="TileSet" id=4]
[ext_resource path="res://scripts/camera_move.gd" type="Script" id=5]
[node name="World" type="Node2D"]
script = ExtResource( 2 )
__meta__ = {
"_edit_lock_": true
}
[node name="Water" type="TileMap" parent="."]
tile_set = ExtResource( 1 )
cell_size = Vector2( 16, 16 )
format = 1
[node name="Terrian" type="TileMap" parent="."]
tile_set = ExtResource( 4 )
cell_size = Vector2( 16, 16 )
format = 1
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2( 512, 304 )
current = true
script = ExtResource( 5 )

View file

@ -1,11 +1,11 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://scripts/start_game.gd" type="Script" id=1] [ext_resource path="res://scripts/start_game.gd" type="Script" id=1]
[ext_resource path="res://scenes/Map.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/maps/MapOne.tscn" type="PackedScene" id=2]
[node name="SartMenu" type="Node"] [node name="SartMenu" type="Node"]
[node name="World" parent="." instance=ExtResource( 2 )] [node name="MapOne" parent="." instance=ExtResource( 2 )]
[node name="Controls" type="CanvasLayer" parent="."] [node name="Controls" type="CanvasLayer" parent="."]
@ -31,14 +31,14 @@ __meta__ = {
} }
[node name="Label" type="Label" parent="Controls/Start/Container"] [node name="Label" type="Label" parent="Controls/Start/Container"]
margin_right = 219.0 margin_right = 218.0
margin_bottom = 14.0 margin_bottom = 14.0
text = "Welcome to City Limits!" text = "Welcome to City Limits!"
align = 1 align = 1
[node name="CityNameEdit" type="LineEdit" parent="Controls/Start/Container"] [node name="CityNameEdit" type="LineEdit" parent="Controls/Start/Container"]
margin_top = 18.0 margin_top = 18.0
margin_right = 219.0 margin_right = 218.0
margin_bottom = 42.0 margin_bottom = 42.0
align = 1 align = 1
caret_blink = true caret_blink = true
@ -49,7 +49,7 @@ __meta__ = {
[node name="MayorNameEdit" type="LineEdit" parent="Controls/Start/Container"] [node name="MayorNameEdit" type="LineEdit" parent="Controls/Start/Container"]
margin_top = 46.0 margin_top = 46.0
margin_right = 219.0 margin_right = 218.0
margin_bottom = 70.0 margin_bottom = 70.0
align = 1 align = 1
caret_blink = true caret_blink = true
@ -60,7 +60,7 @@ __meta__ = {
[node name="BudgetMenu" type="MenuButton" parent="Controls/Start/Container"] [node name="BudgetMenu" type="MenuButton" parent="Controls/Start/Container"]
margin_top = 74.0 margin_top = 74.0
margin_right = 219.0 margin_right = 218.0
margin_bottom = 94.0 margin_bottom = 94.0
text = "Starting Budget" text = "Starting Budget"
items = [ "20000", null, 0, false, false, 0, 0, null, "", false, "10000", null, 0, false, false, 1, 0, null, "", false, "500", null, 0, false, false, 2, 0, null, "", false ] items = [ "20000", null, 0, false, false, 0, 0, null, "", false, "10000", null, 0, false, false, 1, 0, null, "", false, "500", null, 0, false, false, 2, 0, null, "", false ]
@ -70,7 +70,7 @@ __meta__ = {
[node name="CreateBtn" type="Button" parent="Controls/Start/Container"] [node name="CreateBtn" type="Button" parent="Controls/Start/Container"]
margin_top = 98.0 margin_top = 98.0
margin_right = 219.0 margin_right = 218.0
margin_bottom = 118.0 margin_bottom = 118.0
text = "Create" text = "Create"

3
scenes/VR Game.tscn Normal file
View file

@ -0,0 +1,3 @@
[gd_scene format=2]
[node name="VR Game" type="Spatial"]

View file

@ -1,13 +1,10 @@
[gd_scene load_steps=45 format=2] [gd_scene load_steps=35 format=2]
[ext_resource path="res://scenes/Map.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/maps/MapOne.tscn" type="PackedScene" id=1]
[ext_resource path="res://sprites/symbols/fontawesome/population.svg" type="Texture" id=2] [ext_resource path="res://scenes/windows/Status.tscn" type="PackedScene" id=2]
[ext_resource path="res://scripts/city_status.gd" type="Script" id=3]
[ext_resource path="res://scenes/windows/Advisor.tscn" type="PackedScene" id=4] [ext_resource path="res://scenes/windows/Advisor.tscn" type="PackedScene" id=4]
[ext_resource path="res://sprites/ui/iccom.png" type="Texture" id=5] [ext_resource path="res://sprites/ui/iccom.png" type="Texture" id=5]
[ext_resource path="res://scenes/windows/DebugConsole.tscn" type="PackedScene" id=6] [ext_resource path="res://scenes/windows/DebugConsole.tscn" type="PackedScene" id=6]
[ext_resource path="res://sprites/symbols/fontawesome/pie-chart.svg" type="Texture" id=7]
[ext_resource path="res://sprites/symbols/fontawesome/calendar.svg" type="Texture" id=8]
[ext_resource path="res://sprites/ui/icres.png" type="Texture" id=9] [ext_resource path="res://sprites/ui/icres.png" type="Texture" id=9]
[ext_resource path="res://sprites/ui/icreshi.png" type="Texture" id=10] [ext_resource path="res://sprites/ui/icreshi.png" type="Texture" id=10]
[ext_resource path="res://sprites/ui/icfire.png" type="Texture" id=11] [ext_resource path="res://sprites/ui/icfire.png" type="Texture" id=11]
@ -34,15 +31,8 @@
[ext_resource path="res://scenes/windows/TaxWindow.tscn" type="PackedScene" id=32] [ext_resource path="res://scenes/windows/TaxWindow.tscn" type="PackedScene" id=32]
[ext_resource path="res://sprites/ui/icfirehi.png" type="Texture" id=33] [ext_resource path="res://sprites/ui/icfirehi.png" type="Texture" id=33]
[ext_resource path="res://scenes/windows/Credits.tscn" type="PackedScene" id=34] [ext_resource path="res://scenes/windows/Credits.tscn" type="PackedScene" id=34]
[ext_resource path="res://scripts/ticker.gd" type="Script" id=35]
[ext_resource path="res://sprites/symbols/fontawesome/city.svg" type="Texture" id=36]
[ext_resource path="res://scripts/windows.gd" type="Script" id=37] [ext_resource path="res://scripts/windows.gd" type="Script" id=37]
[ext_resource path="res://sprites/symbols/fontawesome/envelope.svg" type="Texture" id=38]
[ext_resource path="res://sprites/ui/pause.svg" type="Texture" id=39] [ext_resource path="res://sprites/ui/pause.svg" type="Texture" id=39]
[ext_resource path="res://sprites/symbols/fontawesome/slow.svg" type="Texture" id=40]
[ext_resource path="res://sprites/symbols/fontawesome/fast.svg" type="Texture" id=41]
[ext_resource path="res://sprites/symbols/fontawesome/coins.svg" type="Texture" id=42]
[ext_resource path="res://sprites/symbols/fontawesome/cogs.svg" type="Texture" id=43]
[ext_resource path="res://scenes/windows/Ordinance.tscn" type="PackedScene" id=44] [ext_resource path="res://scenes/windows/Ordinance.tscn" type="PackedScene" id=44]
[node name="Game" type="Node2D"] [node name="Game" type="Node2D"]
@ -59,7 +49,7 @@ __meta__ = {
wait_time = 6.0 wait_time = 6.0
autostart = true autostart = true
[node name="Map" parent="." instance=ExtResource( 1 )] [node name="MapOne" parent="." instance=ExtResource( 1 )]
[node name="Controls" type="CanvasLayer" parent="."] [node name="Controls" type="CanvasLayer" parent="."]
@ -251,203 +241,17 @@ __meta__ = {
[node name="Ordinance" parent="Controls/Windows" instance=ExtResource( 44 )] [node name="Ordinance" parent="Controls/Windows" instance=ExtResource( 44 )]
[node name="Status" type="Panel" parent="Controls"] [node name="VRMode" type="Button" parent="Controls/Windows"]
anchor_top = 0.860396 anchor_left = 0.919922
anchor_right = 1.0 anchor_top = 0.0216667
anchor_bottom = 1.00206 anchor_right = 0.989258
__meta__ = { anchor_bottom = 0.0683333
"_edit_lock_": true, text = "VR Mode"
"_edit_use_anchors_": true
}
[node name="SettingsBtn" type="Button" parent="Controls/Status"]
anchor_left = 0.0115391
anchor_top = 0.155151
anchor_right = 0.0525548
anchor_bottom = 0.57868
margin_top = -9.53674e-07
hint_tooltip = "Meet"
size_flags_horizontal = 4
icon = ExtResource( 43 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": true "_edit_use_anchors_": true
} }
[node name="StatCtr" type="HBoxContainer" parent="Controls/Status"] [node name="Status" parent="Controls" instance=ExtResource( 2 )]
anchor_left = 0.0556641
anchor_top = 0.141176
anchor_right = 1.0
anchor_bottom = 0.564706
margin_top = 9.53674e-07
custom_constants/separation = 50
alignment = 1
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": true
}
[node name="ButtonCtr" type="HBoxContainer" parent="Controls/Status/StatCtr"]
margin_left = 235.0
margin_right = 517.0
margin_bottom = 36.0
custom_constants/separation = 10
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TaxBtn" type="Button" parent="Controls/Status/StatCtr/ButtonCtr"]
margin_right = 42.0
margin_bottom = 36.0
hint_tooltip = "RCI"
size_flags_horizontal = 4
icon = ExtResource( 7 )
[node name="ToolsBtn" type="Button" parent="Controls/Status/StatCtr/ButtonCtr"]
margin_left = 52.0
margin_right = 94.0
margin_bottom = 36.0
hint_tooltip = "Tools"
size_flags_horizontal = 4
icon = ExtResource( 36 )
[node name="AdvsiorBtn" type="Button" parent="Controls/Status/StatCtr/ButtonCtr"]
margin_left = 104.0
margin_right = 146.0
margin_bottom = 36.0
hint_tooltip = "Meet"
size_flags_horizontal = 4
icon = ExtResource( 38 )
[node name="VSeparator" type="VSeparator" parent="Controls/Status/StatCtr/ButtonCtr"]
margin_left = 156.0
margin_right = 160.0
margin_bottom = 36.0
[node name="TurtleBtn" type="Button" parent="Controls/Status/StatCtr/ButtonCtr"]
margin_left = 170.0
margin_right = 211.0
margin_bottom = 36.0
hint_tooltip = "Slow"
toggle_mode = true
icon = ExtResource( 40 )
[node name="CheetaBtn" type="Button" parent="Controls/Status/StatCtr/ButtonCtr"]
margin_left = 221.0
margin_right = 268.0
margin_bottom = 36.0
hint_tooltip = "Fast"
toggle_mode = true
icon = ExtResource( 41 )
[node name="VSeparator2" type="VSeparator" parent="Controls/Status/StatCtr/ButtonCtr"]
margin_left = 278.0
margin_right = 282.0
margin_bottom = 36.0
[node name="NameDate" type="VBoxContainer" parent="Controls/Status/StatCtr"]
margin_left = 567.0
margin_right = 655.0
margin_bottom = 36.0
alignment = 1
[node name="CityNameLbl" type="Label" parent="Controls/Status/StatCtr/NameDate"]
margin_top = 2.0
margin_right = 88.0
margin_bottom = 16.0
text = "City Name"
align = 1
[node name="YearCtr" type="HBoxContainer" parent="Controls/Status/StatCtr/NameDate"]
margin_top = 20.0
margin_right = 88.0
margin_bottom = 34.0
[node name="CalIcon" type="TextureRect" parent="Controls/Status/StatCtr/NameDate/YearCtr"]
margin_right = 10.0
margin_bottom = 14.0
texture = ExtResource( 8 )
stretch_mode = 4
[node name="CalendarLbl" type="Label" parent="Controls/Status/StatCtr/NameDate/YearCtr"]
margin_left = 14.0
margin_right = 88.0
margin_bottom = 14.0
text = "01/01/2000"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PopBudget" type="VBoxContainer" parent="Controls/Status/StatCtr"]
margin_left = 705.0
margin_right = 731.0
margin_bottom = 36.0
alignment = 1
[node name="BudgetCtr" type="HBoxContainer" parent="Controls/Status/StatCtr/PopBudget"]
margin_top = 2.0
margin_right = 26.0
margin_bottom = 16.0
[node name="CoinsIcon" type="TextureRect" parent="Controls/Status/StatCtr/PopBudget/BudgetCtr"]
margin_right = 14.0
margin_bottom = 14.0
texture = ExtResource( 42 )
stretch_mode = 4
[node name="BudgetLbl" type="Label" parent="Controls/Status/StatCtr/PopBudget/BudgetCtr"]
margin_left = 18.0
margin_right = 26.0
margin_bottom = 14.0
text = "0"
[node name="PopCtr" type="HBoxContainer" parent="Controls/Status/StatCtr/PopBudget"]
margin_top = 20.0
margin_right = 26.0
margin_bottom = 34.0
[node name="PopIcon" type="TextureRect" parent="Controls/Status/StatCtr/PopBudget/PopCtr"]
margin_right = 14.0
margin_bottom = 14.0
texture = ExtResource( 2 )
stretch_mode = 4
[node name="PopLbl" type="Label" parent="Controls/Status/StatCtr/PopBudget/PopCtr"]
margin_left = 18.0
margin_right = 26.0
margin_bottom = 14.0
text = "0"
[node name="TickerBg" type="ColorRect" parent="Controls/Status"]
anchor_left = 0.00073738
anchor_top = 1.0
anchor_right = 1.00074
anchor_bottom = 1.0
margin_top = -28.0
color = Color( 0, 0, 0, 1 )
script = ExtResource( 35 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TickerTxt" type="RichTextLabel" parent="Controls/Status/TickerBg"]
anchor_left = 0.0145068
anchor_top = 0.17248
anchor_right = 0.987427
anchor_bottom = 0.93248
margin_top = 0.687989
margin_bottom = 0.687988
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": true
}
[connection signal="timeout" from="DayCycle" to="." method="_on_DayCycle_timeout"] [connection signal="timeout" from="DayCycle" to="." method="_on_DayCycle_timeout"]
[connection signal="timeout" from="RotateNews" to="Controls/Status/TickerBg" method="_on_RotateNews_timeout"] [connection signal="pressed" from="Controls/Windows/VRMode" to="." method="_on_VRMode_pressed"]
[connection signal="pressed" from="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/LargeCtr/CoalBtn" to="Map" method="_on_CoalBtn_pressed"]
[connection signal="pressed" from="Controls/Windows/ToolsWindow/CenterCtr/VertCtr/ZonesCtr/ResBtn" to="Map" method="_on_ResBtn_pressed"]
[connection signal="pressed" from="Controls/Status/StatCtr/ButtonCtr/TaxBtn" to="Controls/Windows" method="_on_TaxBtn_pressed"]
[connection signal="pressed" from="Controls/Status/StatCtr/ButtonCtr/ToolsBtn" to="Controls/Windows" method="_on_ToolsBtn_pressed"]
[connection signal="pressed" from="Controls/Status/StatCtr/ButtonCtr/AdvsiorBtn" to="Controls/Windows" method="_on_AdvsiorBtn_pressed"]
[connection signal="toggled" from="Controls/Status/StatCtr/ButtonCtr/TurtleBtn" to="." method="_on_TurtleBtn_toggled"]
[connection signal="toggled" from="Controls/Status/StatCtr/ButtonCtr/CheetaBtn" to="." method="_on_CheetaBtn_toggled"]

30
scenes/maps/MapOne.tscn Normal file

File diff suppressed because one or more lines are too long

188
scenes/windows/Status.tscn Normal file
View file

@ -0,0 +1,188 @@
[gd_scene load_steps=12 format=2]
[ext_resource path="res://scripts/ticker.gd" type="Script" id=1]
[ext_resource path="res://sprites/symbols/fontawesome/fast.svg" type="Texture" id=2]
[ext_resource path="res://sprites/symbols/fontawesome/cogs.svg" type="Texture" id=3]
[ext_resource path="res://scripts/city_status.gd" type="Script" id=4]
[ext_resource path="res://sprites/symbols/fontawesome/coins.svg" type="Texture" id=5]
[ext_resource path="res://sprites/symbols/fontawesome/city.svg" type="Texture" id=6]
[ext_resource path="res://sprites/symbols/fontawesome/envelope.svg" type="Texture" id=7]
[ext_resource path="res://sprites/symbols/fontawesome/slow.svg" type="Texture" id=8]
[ext_resource path="res://sprites/symbols/fontawesome/population.svg" type="Texture" id=9]
[ext_resource path="res://sprites/symbols/fontawesome/pie-chart.svg" type="Texture" id=10]
[ext_resource path="res://sprites/symbols/fontawesome/calendar.svg" type="Texture" id=11]
[node name="Status" type="Panel"]
anchor_top = 0.891667
anchor_right = 1.0
anchor_bottom = 1.00333
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": true
}
[node name="SettingsBtn" type="Button" parent="."]
anchor_left = 0.0115391
anchor_top = 0.193259
anchor_right = 0.0525548
anchor_bottom = 0.670871
margin_top = -9.53674e-07
hint_tooltip = "Meet"
size_flags_horizontal = 4
icon = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": true
}
[node name="StatCtr" type="HBoxContainer" parent="."]
anchor_left = 0.0566406
anchor_top = 0.208955
anchor_right = 0.601562
anchor_bottom = 0.746269
margin_top = 9.53674e-07
custom_constants/separation = 50
alignment = 1
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": true
}
[node name="ButtonCtr" type="HBoxContainer" parent="StatCtr"]
margin_left = 30.0
margin_right = 312.0
margin_bottom = 36.0
custom_constants/separation = 10
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TaxBtn" type="Button" parent="StatCtr/ButtonCtr"]
margin_right = 42.0
margin_bottom = 36.0
hint_tooltip = "RCI"
size_flags_horizontal = 4
icon = ExtResource( 10 )
[node name="ToolsBtn" type="Button" parent="StatCtr/ButtonCtr"]
margin_left = 52.0
margin_right = 94.0
margin_bottom = 36.0
hint_tooltip = "Tools"
size_flags_horizontal = 4
icon = ExtResource( 6 )
[node name="AdvsiorBtn" type="Button" parent="StatCtr/ButtonCtr"]
margin_left = 104.0
margin_right = 146.0
margin_bottom = 36.0
hint_tooltip = "Meet"
size_flags_horizontal = 4
icon = ExtResource( 7 )
[node name="VSeparator" type="VSeparator" parent="StatCtr/ButtonCtr"]
margin_left = 156.0
margin_right = 160.0
margin_bottom = 36.0
[node name="TurtleBtn" type="Button" parent="StatCtr/ButtonCtr"]
margin_left = 170.0
margin_right = 211.0
margin_bottom = 36.0
hint_tooltip = "Slow"
toggle_mode = true
icon = ExtResource( 8 )
[node name="CheetaBtn" type="Button" parent="StatCtr/ButtonCtr"]
margin_left = 221.0
margin_right = 268.0
margin_bottom = 36.0
hint_tooltip = "Fast"
toggle_mode = true
icon = ExtResource( 2 )
[node name="VSeparator2" type="VSeparator" parent="StatCtr/ButtonCtr"]
margin_left = 278.0
margin_right = 282.0
margin_bottom = 36.0
[node name="NameDate" type="VBoxContainer" parent="StatCtr"]
margin_left = 362.0
margin_right = 450.0
margin_bottom = 36.0
alignment = 1
[node name="CityNameLbl" type="Label" parent="StatCtr/NameDate"]
margin_top = 2.0
margin_right = 88.0
margin_bottom = 16.0
text = "City Name"
align = 1
[node name="YearCtr" type="HBoxContainer" parent="StatCtr/NameDate"]
margin_top = 20.0
margin_right = 88.0
margin_bottom = 34.0
[node name="CalIcon" type="TextureRect" parent="StatCtr/NameDate/YearCtr"]
margin_right = 10.0
margin_bottom = 14.0
texture = ExtResource( 11 )
stretch_mode = 4
[node name="CalendarLbl" type="Label" parent="StatCtr/NameDate/YearCtr"]
margin_left = 14.0
margin_right = 88.0
margin_bottom = 14.0
text = "01/01/2000"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PopBudget" type="VBoxContainer" parent="StatCtr"]
margin_left = 500.0
margin_right = 526.0
margin_bottom = 36.0
alignment = 1
[node name="BudgetCtr" type="HBoxContainer" parent="StatCtr/PopBudget"]
margin_top = 2.0
margin_right = 26.0
margin_bottom = 16.0
[node name="CoinsIcon" type="TextureRect" parent="StatCtr/PopBudget/BudgetCtr"]
margin_right = 14.0
margin_bottom = 14.0
texture = ExtResource( 5 )
stretch_mode = 4
[node name="BudgetLbl" type="Label" parent="StatCtr/PopBudget/BudgetCtr"]
margin_left = 18.0
margin_right = 26.0
margin_bottom = 14.0
text = "0"
[node name="PopCtr" type="HBoxContainer" parent="StatCtr/PopBudget"]
margin_top = 20.0
margin_right = 26.0
margin_bottom = 34.0
[node name="PopIcon" type="TextureRect" parent="StatCtr/PopBudget/PopCtr"]
margin_right = 14.0
margin_bottom = 14.0
texture = ExtResource( 9 )
stretch_mode = 4
[node name="PopLbl" type="Label" parent="StatCtr/PopBudget/PopCtr"]
margin_left = 18.0
margin_right = 26.0
margin_bottom = 14.0
text = "0"
[node name="Ticker" type="ItemList" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 622.0
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -60,18 +60,19 @@ func _init_advisor(file, advisor):
rank_label.text = "Transportation Advisor" rank_label.text = "Transportation Advisor"
func _launch_advisor_window(key): func _launch_advisor_window(key):
_index_dialogue() # _index_dialogue()
var message: String = dialogue_keys[key].text # var message: String = dialogue_keys[key].text
#
if "[name]" in message: # if "[name]" in message:
message = message.replace("[name]", SimData.mayor_name) # message = message.replace("[name]", SimData.mayor_name)
#
if "[city]" in message: # if "[city]" in message:
message = message.replace("[city]", SimData.city_name) # message = message.replace("[city]", SimData.city_name)
#
description_label.text = message # description_label.text = message
window_title = dialogue_keys[key].name # window_title = dialogue_keys[key].name
show() # show()
pass
func _advisor_dialogue(advisor, message): func _advisor_dialogue(advisor, message):
_init_advisor(JsonFile.ANNOUNCEMENTS, advisor) _init_advisor(JsonFile.ANNOUNCEMENTS, advisor)

View file

@ -45,3 +45,5 @@ func _on_CheetaBtn_toggled(button_pressed):
day_cycle.wait_time = 2 day_cycle.wait_time = 2
turtle_btn.pressed = false turtle_btn.pressed = false
func _on_VRMode_pressed():
get_tree().change_scene("res://scenes/VR Game.tscn")

View file

@ -1,49 +0,0 @@
extends Node2D
var noise: OpenSimplexNoise
var map_size = Vector2(80, 60)
var terrian_cap = 0.3
onready var terrian = $Terrian
onready var water = $Water
func _ready():
randomize()
noise = OpenSimplexNoise.new()
noise.seed = randi()
noise.octaves = 1.5
noise.period = 12
make_terrian_map()
make_water()
func make_terrian_map():
for x in map_size.x:
for y in map_size.y:
var a = noise.get_noise_2d(x, y)
if a < terrian_cap:
terrian.set_cell(x, y, 0)
terrian.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y))
func make_water():
for x in map_size.x:
for y in map_size.y:
if terrian.get_cell(x, y):
water.set_cell(x, y, 0)
water.update_bitmask_region(Vector2(0.0, 0.0), Vector2(map_size.x, map_size.y))
func _on_ResBtn_pressed():
var new_zone = preload("res://scenes/deparments/Zone.tscn")
var instance = new_zone.instance()
add_child(instance)
instance.emit_signal("grabbed")
func _on_CoalBtn_pressed():
var new_zone = preload("res://scenes/deparments/CoalPlant.tscn")
var instance = new_zone.instance()
add_child(instance)
instance.emit_signal("grabbed")

View file

@ -1,9 +1,9 @@
extends ColorRect extends Panel
onready var ticker_text = $TickerTxt
const ticker_path = "res://json/ticker/" const ticker_path = "res://json/ticker/"
onready var ticker_text = $Ticker
var news_file: String = "" var news_file: String = ""
var rng = RandomNumberGenerator.new() var rng = RandomNumberGenerator.new()
var all_news = [] var all_news = []
@ -67,9 +67,12 @@ func _ready():
_random_news(json_files) _random_news(json_files)
func _start_alert(message): func _start_alert(message):
if ticker_text.items.size() > 3:
ticker_text.clear()
SimData.on_alert = true SimData.on_alert = true
news_file = str(ticker_path + "ticker_alerts.json") news_file = str(ticker_path + "ticker_alerts.json")
ticker_text = all_news ticker_text.add_item(all_news)
func _random_news(files: Array): func _random_news(files: Array):
for file in files: for file in files:
@ -84,14 +87,13 @@ func _random_news(files: Array):
var news_range = rng.randi_range(0, all_news.size() - 1) var news_range = rng.randi_range(0, all_news.size() - 1)
var news_text: String = all_news[news_range] var news_text: String = all_news[news_range]
if SimData.has_ctower or SimData.city_name == "Furtropolis" or "Furville" and "[outlet]" in news_text: if SimData.city_name == "Furtropolis" or "Furville" and "[outlet]" in news_text:
# FNN = Furtropolis/Furry News Network # FNN = Furtropolis/Furry News Network
news_text.replace("[outlet]", "FNN") news_text.replace("[outlet]", "FNN")
else: elif "[outlet]" in news_text:
news_text.replace("[outlet]", "Pawprint Press") news_text.replace("[outlet]", "Pawprint Press")
if "[species]" in news_text: if "[species]" in news_text:
randomize()
speices.shuffle() speices.shuffle()
var speices_range = rng.randi_range(speices.size() - 1) var speices_range = rng.randi_range(speices.size() - 1)
news_text.replace("[species]", speices[speices_range]) news_text.replace("[species]", speices[speices_range])
@ -102,7 +104,10 @@ func _random_news(files: Array):
if "[mayor]" in news_text: if "[mayor]" in news_text:
news_text.replace("[mayor]", SimData.mayor_name) news_text.replace("[mayor]", SimData.mayor_name)
ticker_text.text = news_text if ticker_text.items.size() > 3:
ticker_text.clear()
ticker_text.add_item(news_text)
func _resume_ticker(): func _resume_ticker():
_random_news(json_files) _random_news(json_files)