Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/building_assets/2d Assets/Firehouse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/building_assets/2d Assets/Hospital.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/building_assets/2d Assets/Library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/building_assets/2d Assets/Museum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/building_assets/2d Assets/UtilityPlant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://scripts/TileCube.gd"
}, {
"base": "Reference",
"base": "Node",
"class": "TourismAgent",
"language": "GDScript",
"path": "res://AI/tourism/TourismAgent.gd"
Expand Down
12 changes: 12 additions & 0 deletions resources/log.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
SELECTION, RESPONSE

We need to get the city fixed up., That’s right! We have to get things in tip-top shape. Join me in the office, and we can get started.
How can we help improve the city?, We need to fix the damaged facilities around the city.
I’ll meet you at the beach. I’d like to explore the city first., EMPTY
We need to get the city fixed up., That’s right! We have to get things in tip-top shape. Join me in the office, and we can get started.
How can we help improve the city?, We need to fix the damaged facilities around the city.
That sounds like a great idea. Let's go!, EMPTY
That’s really cool. What’s your job like?, I work with people every day to put on events and speak up for others so our community remains safe and happy.
Yes., That's great! Then you'll be a great addition to our little team.
Pretty beaches are better than dirty ones., Yes. Clean beaches encourage more visitors, which can improve our city’s economy. Clean beaches also create a healthy environment for marine life.
A clean beach means there’s less trash in the ocean., That’s correct! A clean beach means that less trash will go from the beach and into the ocean.
Yes., EMPTY
I'll go see him right now., EMPTY
10 changes: 6 additions & 4 deletions scripts/Tile.gd
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ func check_if_valid_placement(inf_to_be, height, width):

for a in range(0, height):
for b in range(0, width):
if (i - a >= 0 and j - b >= 0):
var currTile = Global.tileMap[i - a][j - b]
if (i + a < Global.mapHeight and j + b < Global.mapWidth):
var currTile = Global.tileMap[i + a][j + b]
if currTile.inf != TileInf.NONE or currTile.zone != TileZone.NONE:
return false
elif currTile.baseHeight != baseHeight:
Expand All @@ -518,11 +518,11 @@ func set_tile_inf(infType, zoneType, height, width):
if a == 0 and b == 0:
continue
#No need to check if valid, already did that
var currTile = Global.tileMap[i - a][j - b]
var currTile = Global.tileMap[i + a][j + b]
currTile.inf = TileInf.CHILD
currTile.zone = zoneType
currTile.parent = [i, j]
children.append([i - a, j - b])
children.append([i + a, j + b])
City.connectUtilities()
set_active_tile()

Expand Down Expand Up @@ -934,6 +934,8 @@ func set_active_tile():
isActive = true
Global.activeTiles[[i, j]] = true
print(Global.activeTiles.size())
for child in children:
print(child)
func deactivate_tile():
isActive = false
Global.activeTiles.erase([i, j])
Expand Down
9 changes: 4 additions & 5 deletions scripts/TileCube.gd
Original file line number Diff line number Diff line change
Expand Up @@ -379,18 +379,18 @@ func update_polygons():
var image = load("res://assets/building_assets/2d Assets/Library.png")
buildingSprite = Sprite.new()
buildingSprite.texture = image
buildingSprite.position = Vector2(x, y - h)
buildingSprite.position = Vector2(x - w , y)
buildingSprite.z_index = (i + j) * 10
listOfBuildings.append(buildingSprite)
sensor_height = 32
sensor_height = 16
sensor_zindex+=2

elif tile.inf == Tile.TileInf.MUSEUM:
clear_objects()
var image = load("res://assets/building_assets/2d Assets/Museum.png")
buildingSprite = Sprite.new()
buildingSprite.texture = image
buildingSprite.position = Vector2(x, y - h)
buildingSprite.position = Vector2(x, y)
buildingSprite.z_index = (i + j) * 10
listOfBuildings.append(buildingSprite)
sensor_height = 16
Expand All @@ -412,8 +412,7 @@ func update_polygons():
var image = load("res://assets/building_assets/2d Assets/Firehouse.png")
buildingSprite = Sprite.new()
buildingSprite.texture = image
buildingSprite.position = Vector2(x, y - h - 32)
buildingSprite.scale = Vector2(2, 2)
buildingSprite.position = Vector2(x - w , y)
buildingSprite.z_index = (i + j) * 10
listOfBuildings.append(buildingSprite)
sensor_height = 16
Expand Down
16 changes: 8 additions & 8 deletions scripts/ToolsMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ func button_pressed():
Global.placementState = true
Global.hoverImage = "res://assets/building_assets/2d Assets/Hospital.png"
Global.infType = Tile.TileInf.HOSPITAL
Global.buildingHeight = 1
Global.buildingWidth = 1
Global.buildingHeight = 2
Global.buildingWidth = 2
get_node("/root/CityMap/PreviewFade").play("Fade")
'police station_button':
Global.mapTool = Global.Tool.INF_POLICE_STATION
Expand All @@ -277,8 +277,8 @@ func button_pressed():
Global.placementState = true
Global.hoverImage = "res://assets/building_assets/2d Assets/UtilityPlant.png"
Global.infType = Tile.TileInf.UTILITIES_PLANT
Global.buildingHeight = 1
Global.buildingWidth = 1
Global.buildingHeight = 2
Global.buildingWidth = 2
get_node("/root/CityMap/PreviewFade").play("Fade")
'sewage facility_button':
Global.mapTool = Global.Tool.INF_SEWAGE_FACILITY
Expand Down Expand Up @@ -309,16 +309,16 @@ func button_pressed():
Global.placementState = true
Global.hoverImage = "res://assets/building_assets/2d Assets/Library.png"
Global.infType = Tile.TileInf.LIBRARY
Global.buildingHeight = 1
Global.buildingWidth = 1
Global.buildingHeight = 2
Global.buildingWidth = 2
get_node("/root/CityMap/PreviewFade").play("Fade")
'museum_button':
Global.mapTool = Global.Tool.INF_MUSEUM
Global.placementState = true
Global.hoverImage = "res://assets/building_assets/2d Assets/Museum.png"
Global.infType = Tile.TileInf.MUSEUM
Global.buildingHeight = 1
Global.buildingWidth = 1
Global.buildingHeight = 2
Global.buildingWidth = 2
get_node("/root/CityMap/PreviewFade").play("Fade")
'school_button':
Global.mapTool = Global.Tool.INF_SCHOOL
Expand Down
4 changes: 2 additions & 2 deletions scripts/start_map.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func _ready():
#$HUD/TopBar/HBoxContainer/Demand.text = "Residential Demand: " + str(UpdateDemand.calcResidentialDemand()) + "/10" + " Commercial Demand: " + str(UpdateDemand.calcCommercialDemand()) + "/10"
$HUD/Date/Year.text = str(UpdateDate.year)
$HUD/Date/Month.text = UpdateDate.Months.keys()[UpdateDate.month]
if (Global.newGame):
initTutorial()
#if (Global.newGame):
# initTutorial()

func initSave_Exit():
$Popups/SaveDialog.connect("file_selected", self, "_on_file_selected_save")
Expand Down