Add files via upload
@ -0,0 +1,14 @@
|
||||
extends Control
|
||||
|
||||
func _on_play_pressed():
|
||||
get_tree().change_scene_to_file("res://scenes/main.tscn")
|
||||
|
||||
|
||||
func _on_options_pressed():
|
||||
get_tree().change_scene_to_file("res://scenes/settings.tscn")
|
||||
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Kenney
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@ -0,0 +1,43 @@
|
||||
<p align="center"><img src="icon.png"/></p>
|
||||
|
||||
# Starter Kit City Builder
|
||||
|
||||
This package includes a basic template for a 3D city builder in Godot 4.1.1.stable.official. Includes features like;
|
||||
|
||||
- Building and removing structures
|
||||
- Smooth camera controls
|
||||
- Dynamic MeshLibrary creation
|
||||
- Saving/loading
|
||||
- Sprites and 3D Models _(CC0 licensed)_
|
||||
|
||||
### Screenshot
|
||||
|
||||
<p align="center"><img src="screenshots/screenshot.png"/></p>
|
||||
|
||||
### Controls
|
||||
|
||||
| Key | Command |
|
||||
| --- | --- |
|
||||
| <kbd>W</kbd> <kbd>A</kbd> <kbd>S</kbd> <kbd>D</kbd> | Move camera |
|
||||
| <kbd>F</kbd> | Camera to center |
|
||||
| <kbd>Middle mouse button</kbd> | Hold to rotate camera |
|
||||
| <kbd>Left mouse button</kbd> | Place building |
|
||||
| <kbd>DEL</kbd> | Remove building |
|
||||
| <kbd>Right mouse button</kbd> | Rotate building |
|
||||
| <kbd>Q</kbd> <kbd>E</kbd> | Toggle between buildings |
|
||||
| <kbd>F1</kbd> | Save |
|
||||
| <kbd>F2</kbd> | Load |
|
||||
|
||||
### License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Kenney
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Assets included in this package (2D sprites, 3D models and sound effects) are [CC0 licensed](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
|
After Width: | Height: | Size: 53 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bxthrwdsrm6k8"
|
||||
path="res://.godot/imported/carbonity_splash-screen.png-5b3800ad09310245d4d7a463774c5f18.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://carbonity_splash-screen.png"
|
||||
dest_files=["res://.godot/imported/carbonity_splash-screen.png-5b3800ad09310245d4d7a463774c5f18.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@ -0,0 +1,94 @@
|
||||
Copyright (c) 2011 Juan Montoreano (juan@remolacha.biz),
|
||||
with Reserved Font Name Lilita
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@ -0,0 +1,33 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://d0cxd77jybrcn"
|
||||
path="res://.godot/imported/lilita_one_regular.ttf-68cc4ab6825bdd499d1ad608190f5213.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/lilita_one_regular.ttf"
|
||||
dest_files=["res://.godot/imported/lilita_one_regular.ttf-68cc4ab6825bdd499d1ad608190f5213.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
|
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cqxgx7atxxpet"
|
||||
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cgbkjiq08gaay"
|
||||
path.s3tc="res://.godot/imported/colormap.png-c1bc3c3aabeec406ff4b53328583776a.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/Textures/colormap.png"
|
||||
dest_files=["res://.godot/imported/colormap.png-c1bc3c3aabeec406ff4b53328583776a.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://d0nnrx2y4px2v"
|
||||
path="res://.godot/imported/building-garage.glb-79efa6120b759910e8bd3785cd54e418.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/building-garage.glb"
|
||||
dest_files=["res://.godot/imported/building-garage.glb-79efa6120b759910e8bd3785cd54e418.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cnycdi6t5tj01"
|
||||
path="res://.godot/imported/building-small-a.glb-ebf8430e523f14eba5266940674f54ed.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/building-small-a.glb"
|
||||
dest_files=["res://.godot/imported/building-small-a.glb-ebf8430e523f14eba5266940674f54ed.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://d2h51qlls136h"
|
||||
path="res://.godot/imported/building-small-b.glb-437a13e47ceef14c49e1239f5579f287.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/building-small-b.glb"
|
||||
dest_files=["res://.godot/imported/building-small-b.glb-437a13e47ceef14c49e1239f5579f287.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://m74mvao50wnm"
|
||||
path="res://.godot/imported/building-small-c.glb-73a68022181ffa29853dcbcb1d8aaef9.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/building-small-c.glb"
|
||||
dest_files=["res://.godot/imported/building-small-c.glb-73a68022181ffa29853dcbcb1d8aaef9.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://h0vrvst3cumo"
|
||||
path="res://.godot/imported/building-small-d.glb-5e1b608dc43429cd8ce16f120ad53455.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/building-small-d.glb"
|
||||
dest_files=["res://.godot/imported/building-small-d.glb-5e1b608dc43429cd8ce16f120ad53455.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://dy26b1ba2j2v1"
|
||||
path="res://.godot/imported/grass-trees-tall.glb-7300613123c00a0615ded796764a0c0a.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/grass-trees-tall.glb"
|
||||
dest_files=["res://.godot/imported/grass-trees-tall.glb-7300613123c00a0615ded796764a0c0a.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://b1711sieed2u6"
|
||||
path="res://.godot/imported/grass-trees.glb-0492608f30e8f36fd08db19dc56a2fc4.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/grass-trees.glb"
|
||||
dest_files=["res://.godot/imported/grass-trees.glb-0492608f30e8f36fd08db19dc56a2fc4.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cr3btp34bp3eg"
|
||||
path="res://.godot/imported/grass.glb-0ce858eae1c69c894a569863f13e24f1.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/grass.glb"
|
||||
dest_files=["res://.godot/imported/grass.glb-0ce858eae1c69c894a569863f13e24f1.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://6v0t536s83vb"
|
||||
path="res://.godot/imported/pavement-fountain.glb-0424db34de6f91479f6cbd7008475b67.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/pavement-fountain.glb"
|
||||
dest_files=["res://.godot/imported/pavement-fountain.glb-0424db34de6f91479f6cbd7008475b67.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cpv75mfsda1ml"
|
||||
path="res://.godot/imported/pavement.glb-e677d053825d20c1d08d69229498f8a6.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/pavement.glb"
|
||||
dest_files=["res://.godot/imported/pavement.glb-e677d053825d20c1d08d69229498f8a6.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://c4ccm2qr5wa58"
|
||||
path="res://.godot/imported/road-corner.glb-d7ee80907d88726297a071be68be1fc5.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/road-corner.glb"
|
||||
dest_files=["res://.godot/imported/road-corner.glb-d7ee80907d88726297a071be68be1fc5.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://euxdh7lkq0oj"
|
||||
path="res://.godot/imported/road-intersection.glb-8962e4b1c3c280c3abad7b8b01fadb0a.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/road-intersection.glb"
|
||||
dest_files=["res://.godot/imported/road-intersection.glb-8962e4b1c3c280c3abad7b8b01fadb0a.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://mu30r6rmht07"
|
||||
path="res://.godot/imported/road-split.glb-84d39fa6e15630686f271db254fa4ade.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/road-split.glb"
|
||||
dest_files=["res://.godot/imported/road-split.glb-84d39fa6e15630686f271db254fa4ade.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://5kchntr735l"
|
||||
path="res://.godot/imported/road-straight-lightposts.glb-dce683910787213a109a4c442975fdb1.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/road-straight-lightposts.glb"
|
||||
dest_files=["res://.godot/imported/road-straight-lightposts.glb-dce683910787213a109a4c442975fdb1.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,32 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://b4tgtg0j2dgh8"
|
||||
path="res://.godot/imported/road-straight.glb-31d31cca3c90d98620d476ef869ee90d.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://models/road-straight.glb"
|
||||
dest_files=["res://.godot/imported/road-straight.glb-31d31cca3c90d98620d476ef869ee90d.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
||||
@ -0,0 +1,99 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Starter Kit City Builder"
|
||||
run/main_scene="res://scenes/home.tscn"
|
||||
config/features=PackedStringArray("4.1", "Forward Plus")
|
||||
boot_splash/bg_color=Color(0.92549, 0.92549, 0.960784, 1)
|
||||
boot_splash/image="res://carbonity_splash-screen.png"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[input]
|
||||
|
||||
build={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(258, 12),"global_position":Vector2(262, 55),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
camera_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
camera_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
camera_forward={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
camera_back={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
rotate={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(213, 17),"global_position":Vector2(217, 60),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
demolish={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194312,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
camera_rotate={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":4,"position":Vector2(107, 17),"global_position":Vector2(111, 60),"factor":1.0,"button_index":3,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
structure_next={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
structure_previous={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
save={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194332,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
load={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194333,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
camera_center={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
structure_non={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
anti_aliasing/quality/msaa_3d=2
|
||||
@ -0,0 +1,40 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://drctpgres1cnu"]
|
||||
|
||||
[ext_resource type="Script" path="res://Home.gd" id="1_6ps6j"]
|
||||
|
||||
[node name="Home" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 559.0
|
||||
offset_top = 262.0
|
||||
offset_right = 559.0
|
||||
offset_bottom = 262.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_6ps6j")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="play" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Play"
|
||||
|
||||
[node name="settings" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Settings"
|
||||
|
||||
[node name="quit" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Quit"
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/play" to="." method="_on_play_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/settings" to="." method="_on_options_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/quit" to="." method="_on_quit_pressed"]
|
||||
@ -0,0 +1,27 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://btiwv4l7b2bcm"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/building.gd" id="1_a6qo0"]
|
||||
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
|
||||
[ext_resource type="MeshLibrary" uid="uid://duf40il2303gn" path="res://library/mesh_library.tres" id="2_8lic4"]
|
||||
|
||||
[node name="box" type="Node3D"]
|
||||
script = ExtResource("1_a6qo0")
|
||||
|
||||
[node name="View" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 0, 0, 0)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="View"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30)
|
||||
environment = ExtResource("1_yndf3")
|
||||
fov = 20.0
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
shadow_opacity = 0.75
|
||||
|
||||
[node name="GridMap" type="GridMap" parent="."]
|
||||
mesh_library = ExtResource("2_8lic4")
|
||||
cell_size = Vector3(1, 1, 1)
|
||||
|
||||
[node name="Selector" type="CSGBox3D" parent="."]
|
||||
@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://vgwrcfy1qawf"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/builder.gd" id="1_jybm7"]
|
||||
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
|
||||
[ext_resource type="Resource" uid="uid://dv14kkhb6umkv" path="res://structures/road-straight.tres" id="2_bwyku"]
|
||||
[ext_resource type="Resource" uid="uid://d2jplegnkl6u2" path="res://structures/road-corner.tres" id="3_6fpyf"]
|
||||
|
||||
[node name="Main" type="Node3D"]
|
||||
|
||||
[node name="Builder" type="Node3D" parent="." node_paths=PackedStringArray("selector", "view_camera", "gridmap")]
|
||||
script = ExtResource("1_jybm7")
|
||||
structures = Array[Resource("res://scripts/structure.gd")]([ExtResource("2_bwyku"), ExtResource("3_6fpyf")])
|
||||
selector = NodePath("Selector")
|
||||
view_camera = NodePath("../View/Camera3D")
|
||||
gridmap = NodePath("../GridMap")
|
||||
|
||||
[node name="Selector" type="Node3D" parent="Builder"]
|
||||
|
||||
[node name="Box" type="CSGBox3D" parent="Builder/Selector"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
|
||||
[node name="View" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 0, 0, 0)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="View"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30)
|
||||
environment = ExtResource("1_yndf3")
|
||||
fov = 20.0
|
||||
|
||||
[node name="GridMap" type="GridMap" parent="."]
|
||||
cell_size = Vector3(1, 1, 1)
|
||||
cell_center_x = false
|
||||
cell_center_y = false
|
||||
cell_center_z = false
|
||||
|
||||
[node name="Sun" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
shadow_opacity = 0.75
|
||||
@ -0,0 +1,27 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://btiwv4l7b2bcm"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/building.gd" id="1_a6qo0"]
|
||||
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
|
||||
[ext_resource type="MeshLibrary" uid="uid://duf40il2303gn" path="res://library/mesh_library.tres" id="2_8lic4"]
|
||||
|
||||
[node name="box" type="Node3D"]
|
||||
script = ExtResource("1_a6qo0")
|
||||
|
||||
[node name="View" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 0, 0, 0)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="View"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30)
|
||||
environment = ExtResource("1_yndf3")
|
||||
fov = 20.0
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
shadow_opacity = 0.75
|
||||
|
||||
[node name="GridMap" type="GridMap" parent="."]
|
||||
mesh_library = ExtResource("2_8lic4")
|
||||
cell_size = Vector3(1, 1, 1)
|
||||
|
||||
[node name="Selector" type="CSGBox3D" parent="."]
|
||||
@ -0,0 +1,49 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://vgwrcfy1qawf"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/builder.gd" id="1_jybm7"]
|
||||
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
|
||||
[ext_resource type="Resource" uid="uid://dv14kkhb6umkv" path="res://structures/road-straight.tres" id="2_bwyku"]
|
||||
[ext_resource type="Resource" uid="uid://d2jplegnkl6u2" path="res://structures/road-corner.tres" id="3_6fpyf"]
|
||||
[ext_resource type="Resource" uid="uid://ch8vtcpine1lc" path="res://structures/pavement.tres" id="4_b632v"]
|
||||
[ext_resource type="Texture2D" uid="uid://cbk07cxgshg26" path="res://sprites/selector.png" id="4_wr1wv"]
|
||||
[ext_resource type="Resource" uid="uid://cntgl86ianngh" path="res://structures/building-small-a.tres" id="5_v5o2m"]
|
||||
[ext_resource type="Resource" uid="uid://c5fveedgvunju" path="res://structures/building-small-b.tres" id="6_f4603"]
|
||||
[ext_resource type="Script" path="res://scripts/view.gd" id="8_yovpv"]
|
||||
|
||||
[node name="Main" type="Node3D"]
|
||||
|
||||
[node name="Builder" type="Node3D" parent="." node_paths=PackedStringArray("selector", "selector_container", "view_camera", "gridmap")]
|
||||
script = ExtResource("1_jybm7")
|
||||
structures = Array[Resource("res://scripts/structure.gd")]([ExtResource("2_bwyku"), ExtResource("3_6fpyf"), ExtResource("4_b632v"), ExtResource("5_v5o2m"), ExtResource("6_f4603")])
|
||||
selector = NodePath("Selector")
|
||||
selector_container = NodePath("Selector/Container")
|
||||
view_camera = NodePath("../View/Camera")
|
||||
gridmap = NodePath("../GridMap")
|
||||
|
||||
[node name="Selector" type="Node3D" parent="Builder"]
|
||||
|
||||
[node name="Sprite" type="Sprite3D" parent="Builder/Selector"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
|
||||
texture = ExtResource("4_wr1wv")
|
||||
|
||||
[node name="Container" type="Node3D" parent="Builder/Selector"]
|
||||
|
||||
[node name="View" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 0, 0, 0)
|
||||
script = ExtResource("8_yovpv")
|
||||
|
||||
[node name="Camera" type="Camera3D" parent="View"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30)
|
||||
environment = ExtResource("1_yndf3")
|
||||
fov = 20.0
|
||||
|
||||
[node name="GridMap" type="GridMap" parent="."]
|
||||
cell_size = Vector3(1, 1, 1)
|
||||
cell_center_x = false
|
||||
cell_center_y = false
|
||||
cell_center_z = false
|
||||
|
||||
[node name="Sun" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
shadow_opacity = 0.75
|
||||
@ -0,0 +1,31 @@
|
||||
[gd_resource type="Environment" load_steps=3 format=3 uid="uid://jbptgqvstei3"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_lg8b7"]
|
||||
sky_horizon_color = Color(0.67451, 0.682353, 0.698039, 1)
|
||||
sky_curve = 0.0175
|
||||
ground_bottom_color = Color(1, 1, 1, 1)
|
||||
ground_curve = 0.171484
|
||||
|
||||
[sub_resource type="Sky" id="Sky_7bk1c"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_lg8b7")
|
||||
|
||||
[resource]
|
||||
background_mode = 1
|
||||
background_color = Color(0.560784, 0.592157, 0.670588, 1)
|
||||
sky = SubResource("Sky_7bk1c")
|
||||
ambient_light_source = 2
|
||||
ambient_light_color = Color(0.662745, 0.694118, 0.772549, 1)
|
||||
ambient_light_energy = 0.75
|
||||
tonemap_mode = 2
|
||||
ssao_enabled = true
|
||||
ssao_radius = 0.25
|
||||
ssao_intensity = 0.5
|
||||
ssao_power = 100.0
|
||||
ssao_horizon = 0.1
|
||||
sdfgi_cascades = 1
|
||||
sdfgi_max_distance = 25.6
|
||||
sdfgi_energy = 0.5
|
||||
glow_levels/2 = 0.6
|
||||
glow_levels/3 = 0.6
|
||||
glow_levels/5 = 0.0
|
||||
glow_intensity = 2.0
|
||||
@ -0,0 +1,101 @@
|
||||
[gd_scene load_steps=23 format=3 uid="uid://vgwrcfy1qawf"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/builder.gd" id="1_jybm7"]
|
||||
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
|
||||
[ext_resource type="Resource" uid="uid://dv14kkhb6umkv" path="res://structures/road-straight.tres" id="2_bwyku"]
|
||||
[ext_resource type="Resource" uid="uid://d2jplegnkl6u2" path="res://structures/road-corner.tres" id="3_6fpyf"]
|
||||
[ext_resource type="Resource" uid="uid://mxrnqinnsqnt" path="res://structures/road-straight-lightposts.tres" id="3_o6o81"]
|
||||
[ext_resource type="Resource" uid="uid://ch8vtcpine1lc" path="res://structures/pavement.tres" id="4_b632v"]
|
||||
[ext_resource type="Texture2D" uid="uid://cbk07cxgshg26" path="res://sprites/selector.png" id="4_wr1wv"]
|
||||
[ext_resource type="Resource" uid="uid://cntgl86ianngh" path="res://structures/building-small-a.tres" id="5_v5o2m"]
|
||||
[ext_resource type="Resource" uid="uid://c5fveedgvunju" path="res://structures/building-small-b.tres" id="6_f4603"]
|
||||
[ext_resource type="Resource" uid="uid://cqvwy36htu81" path="res://structures/road-split.tres" id="7_kqu4g"]
|
||||
[ext_resource type="Resource" uid="uid://dveu4dnue0d54" path="res://structures/road-intersection.tres" id="8_1swhv"]
|
||||
[ext_resource type="Resource" uid="uid://dqqe3iofnleup" path="res://structures/pavement-fountain.tres" id="8_4il2q"]
|
||||
[ext_resource type="Script" path="res://scripts/view.gd" id="8_yovpv"]
|
||||
[ext_resource type="Resource" uid="uid://tm532uesguhk" path="res://structures/grass.tres" id="9_ifw7y"]
|
||||
[ext_resource type="Resource" uid="uid://bh65eqgid4kxy" path="res://structures/building-small-c.tres" id="10_84or2"]
|
||||
[ext_resource type="Resource" uid="uid://ccb475jeg7ym5" path="res://structures/grass-trees.tres" id="10_vaeah"]
|
||||
[ext_resource type="Resource" uid="uid://dtal0tl2ee336" path="res://structures/building-small-d.tres" id="12_8obn7"]
|
||||
[ext_resource type="Resource" uid="uid://y6jafhfnhbrp" path="res://structures/grass-trees-tall.tres" id="13_t5d2v"]
|
||||
[ext_resource type="Resource" uid="uid://bqb6g3t0tebno" path="res://structures/building-garage.tres" id="13_ut2cy"]
|
||||
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="16_vlub6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bng0d1sou7c8a" path="res://sprites/coin.png" id="17_cjamx"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_q176i"]
|
||||
font = ExtResource("16_vlub6")
|
||||
font_size = 24
|
||||
shadow_color = Color(0, 0, 0, 0.392157)
|
||||
|
||||
[node name="Main" type="Node3D"]
|
||||
|
||||
[node name="Builder" type="Node3D" parent="." node_paths=PackedStringArray("selector", "selector_container", "view_camera", "gridmap", "cash_display")]
|
||||
script = ExtResource("1_jybm7")
|
||||
structures = Array[Resource("res://scripts/structure.gd")]([ExtResource("2_bwyku"), ExtResource("3_o6o81"), ExtResource("3_6fpyf"), ExtResource("7_kqu4g"), ExtResource("8_1swhv"), ExtResource("4_b632v"), ExtResource("8_4il2q"), ExtResource("5_v5o2m"), ExtResource("6_f4603"), ExtResource("10_84or2"), ExtResource("12_8obn7"), ExtResource("13_ut2cy"), ExtResource("9_ifw7y"), ExtResource("10_vaeah"), ExtResource("13_t5d2v")])
|
||||
selector = NodePath("Selector")
|
||||
selector_container = NodePath("Selector/Container")
|
||||
view_camera = NodePath("../View/Camera")
|
||||
gridmap = NodePath("../GridMap")
|
||||
cash_display = NodePath("../CanvasLayer/Control/Cash")
|
||||
|
||||
[node name="Selector" type="Node3D" parent="Builder"]
|
||||
|
||||
[node name="Sprite" type="Sprite3D" parent="Builder/Selector"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.06, 0)
|
||||
texture = ExtResource("4_wr1wv")
|
||||
|
||||
[node name="Container" type="Node3D" parent="Builder/Selector"]
|
||||
|
||||
[node name="View" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 0, 0, 0)
|
||||
script = ExtResource("8_yovpv")
|
||||
|
||||
[node name="Camera" type="Camera3D" parent="View"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30)
|
||||
environment = ExtResource("1_yndf3")
|
||||
fov = 20.0
|
||||
|
||||
[node name="GridMap" type="GridMap" parent="."]
|
||||
cell_size = Vector3(1, 1, 1)
|
||||
cell_center_x = false
|
||||
cell_center_y = false
|
||||
cell_center_z = false
|
||||
|
||||
[node name="Sun" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
shadow_opacity = 0.75
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Control" type="Control" parent="CanvasLayer"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="CashIcon" type="TextureRect" parent="CanvasLayer/Control"]
|
||||
layout_mode = 0
|
||||
offset_left = 24.0
|
||||
offset_top = 59.0
|
||||
offset_right = 152.0
|
||||
offset_bottom = 187.0
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture = ExtResource("17_cjamx")
|
||||
|
||||
[node name="Cash" type="Label" parent="CanvasLayer/Control"]
|
||||
layout_mode = 0
|
||||
offset_left = 73.0
|
||||
offset_top = 62.0
|
||||
offset_right = 274.0
|
||||
offset_bottom = 136.0
|
||||
text = "$10,000"
|
||||
label_settings = SubResource("LabelSettings_q176i")
|
||||
|
||||
[node name="settings" type="Button" parent="CanvasLayer/Control"]
|
||||
layout_mode = 0
|
||||
offset_right = 8.0
|
||||
offset_bottom = 8.0
|
||||
text = "Settings"
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/Control/settings" to="Builder" method="_on_settings_pressed"]
|
||||
@ -0,0 +1,66 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://clrnnhn15m8uv"]
|
||||
|
||||
[ext_resource type="Script" path="res://settings.gd" id="1_75x0g"]
|
||||
|
||||
[node name="settings" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 508.0
|
||||
offset_top = 258.0
|
||||
offset_right = 508.0
|
||||
offset_bottom = 258.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_75x0g")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "some settings
|
||||
"
|
||||
|
||||
[node name="game" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "To game"
|
||||
|
||||
[node name="home" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "To home"
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
offset_top = 140.0
|
||||
offset_right = 116.0
|
||||
offset_bottom = 140.0
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="MarginContainer2/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CheckButton2" type="CheckButton" parent="MarginContainer2/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CheckButton3" type="CheckButton" parent="MarginContainer2/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CheckButton4" type="CheckButton" parent="MarginContainer2/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CheckButton5" type="CheckButton" parent="MarginContainer2/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/Button" to="." method="_on_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/game" to="." method="_on_game_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/home" to="." method="_on_home_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/home" to="." method="_on_back_pressed"]
|
||||
|
After Width: | Height: | Size: 113 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bd6olxeuxahok"
|
||||
path="res://.godot/imported/screenshot.png-366f1bfaaaad7eddb9e724c7ff485921.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://screenshots/screenshot.png"
|
||||
dest_files=["res://.godot/imported/screenshot.png-366f1bfaaaad7eddb9e724c7ff485921.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@ -0,0 +1,172 @@
|
||||
extends Node3D
|
||||
|
||||
@export var structures: Array[Structure] = []
|
||||
|
||||
var map:DataMap
|
||||
|
||||
var index:int = 0 # Index of structure being built
|
||||
|
||||
@export var selector:Node3D # The 'cursor'
|
||||
@export var selector_container:Node3D # Node that holds a preview of the structure
|
||||
@export var view_camera:Camera3D # Used for raycasting mouse
|
||||
@export var gridmap:GridMap
|
||||
@export var cash_display:Label
|
||||
@export var susvar = false
|
||||
|
||||
var plane:Plane # Used for raycasting mouse
|
||||
|
||||
func _ready():
|
||||
|
||||
map = DataMap.new()
|
||||
plane = Plane(Vector3.UP, Vector3.ZERO)
|
||||
|
||||
# Create new MeshLibrary dynamically, can also be done in the editor
|
||||
# See: https://docs.godotengine.org/en/stable/tutorials/3d/using_gridmaps.html
|
||||
|
||||
var mesh_library = MeshLibrary.new()
|
||||
|
||||
for structure in structures:
|
||||
|
||||
var id = mesh_library.get_last_unused_item_id()
|
||||
|
||||
mesh_library.create_item(id)
|
||||
mesh_library.set_item_mesh(id, get_mesh(structure.model))
|
||||
mesh_library.set_item_mesh_transform(id, Transform3D())
|
||||
|
||||
gridmap.mesh_library = mesh_library
|
||||
|
||||
update_structure()
|
||||
update_cash()
|
||||
action_load()
|
||||
|
||||
func _process(delta):
|
||||
|
||||
# Controls
|
||||
|
||||
action_rotate() # Rotates selection 90 degrees
|
||||
action_structure_toggle() # Toggles between structures
|
||||
"""action_structure_onoff_toggle() # Toggles between building and selecting"""
|
||||
|
||||
action_load() # Loading
|
||||
action_save() # Saving
|
||||
|
||||
# Map position based on mouse
|
||||
|
||||
var world_position = plane.intersects_ray(
|
||||
view_camera.project_ray_origin(get_viewport().get_mouse_position()),
|
||||
view_camera.project_ray_normal(get_viewport().get_mouse_position()))
|
||||
|
||||
var gridmap_position = Vector3(round(world_position.x), 0, round(world_position.z))
|
||||
selector.position = lerp(selector.position, gridmap_position, delta * 40)
|
||||
|
||||
action_build(gridmap_position)
|
||||
action_demolish(gridmap_position)
|
||||
|
||||
# Retrieve the mesh from a PackedScene, used for dynamically creating a MeshLibrary
|
||||
|
||||
func get_mesh(packed_scene):
|
||||
var scene_state:SceneState = packed_scene.get_state()
|
||||
for i in range(scene_state.get_node_count()):
|
||||
if(scene_state.get_node_type(i) == "MeshInstance3D"):
|
||||
for j in scene_state.get_node_property_count(i):
|
||||
var prop_name = scene_state.get_node_property_name(i, j)
|
||||
if prop_name == "mesh":
|
||||
var prop_value = scene_state.get_node_property_value(i, j)
|
||||
|
||||
return prop_value.duplicate()
|
||||
|
||||
# Build (place) a structure
|
||||
|
||||
func action_build(gridmap_position):
|
||||
if Input.is_action_just_pressed("build"):
|
||||
|
||||
var previous_tile = gridmap.get_cell_item(gridmap_position)
|
||||
gridmap.set_cell_item(gridmap_position, index, gridmap.get_orthogonal_index_from_basis(selector.basis))
|
||||
|
||||
if previous_tile != index:
|
||||
map.cash -= structures[index].price
|
||||
update_cash()
|
||||
|
||||
# Demolish (remove) a structure
|
||||
|
||||
func action_demolish(gridmap_position):
|
||||
if Input.is_action_just_pressed("demolish"):
|
||||
gridmap.set_cell_item(gridmap_position, -1)
|
||||
|
||||
# Rotates the 'cursor' 90 degrees
|
||||
|
||||
func action_rotate():
|
||||
if Input.is_action_just_pressed("rotate"):
|
||||
selector.rotate_y(deg_to_rad(90))
|
||||
|
||||
# Toggle between structures to build
|
||||
|
||||
func action_structure_toggle():
|
||||
if Input.is_action_just_pressed("structure_next"):
|
||||
index = wrap(index + 1, 0, structures.size())
|
||||
|
||||
if Input.is_action_just_pressed("structure_previous"):
|
||||
index = wrap(index - 1, 0, structures.size())
|
||||
|
||||
update_structure()
|
||||
|
||||
# Update the structure visual in the 'cursor'
|
||||
|
||||
func update_structure():
|
||||
# Clear previous structure preview in selector
|
||||
for n in selector_container.get_children():
|
||||
selector_container.remove_child(n)
|
||||
|
||||
# Create new structure preview in selector
|
||||
var _model = structures[index].model.instantiate()
|
||||
selector_container.add_child(_model)
|
||||
_model.position.y += 0.25
|
||||
|
||||
func update_cash():
|
||||
cash_display.text = "$" + str(map.cash)
|
||||
|
||||
#toggle between building and regular cursor usage
|
||||
|
||||
"""func action_toggle_onoff_structure():
|
||||
if Input.is_action_just_pressed("structure_non"):
|
||||
index = 0
|
||||
|
||||
update_structure()"""
|
||||
|
||||
# Saving/load
|
||||
|
||||
func action_save():
|
||||
if Input.is_action_just_pressed("save"):
|
||||
|
||||
print("Saving map...")
|
||||
|
||||
map.structures.clear()
|
||||
for cell in gridmap.get_used_cells():
|
||||
|
||||
var data_structure:DataStructure = DataStructure.new()
|
||||
|
||||
data_structure.position = Vector2i(cell.x, cell.z)
|
||||
data_structure.orientation = gridmap.get_cell_item_orientation(cell)
|
||||
data_structure.structure = gridmap.get_cell_item(cell)
|
||||
|
||||
map.structures.append(data_structure)
|
||||
|
||||
ResourceSaver.save(map, "user://map.res")
|
||||
|
||||
func action_load():
|
||||
if Input.is_action_just_pressed("load"):
|
||||
print("Loading map...")
|
||||
|
||||
gridmap.clear()
|
||||
|
||||
map = ResourceLoader.load("user://map.res")
|
||||
if not map:
|
||||
map = DataMap.new()
|
||||
for cell in map.structures:
|
||||
gridmap.set_cell_item(Vector3i(cell.position.x, 0, cell.position.y), cell.structure, cell.orientation)
|
||||
|
||||
update_cash()
|
||||
|
||||
|
||||
func _on_settings_pressed():
|
||||
get_tree().change_scene_to_file("res://scenes/settings.tscn")
|
||||
@ -0,0 +1,5 @@
|
||||
extends Resource
|
||||
class_name DataMap
|
||||
|
||||
@export var cash:int = 10000
|
||||
@export var structures:Array[DataStructure]
|
||||
@ -0,0 +1,6 @@
|
||||
extends Resource
|
||||
class_name DataStructure
|
||||
|
||||
@export var position:Vector2i
|
||||
@export var orientation:int
|
||||
@export var structure:int
|
||||
@ -0,0 +1,8 @@
|
||||
extends Resource
|
||||
class_name Structure
|
||||
|
||||
@export_subgroup("Model")
|
||||
@export var model:PackedScene # Model of the structure
|
||||
|
||||
@export_subgroup("Gameplay")
|
||||
@export var price:int # Price of the structure when building
|
||||
@ -0,0 +1,51 @@
|
||||
extends Node3D
|
||||
|
||||
var camera_position:Vector3
|
||||
var camera_rotation:Vector3
|
||||
|
||||
@onready var camera = $Camera
|
||||
|
||||
func _ready():
|
||||
|
||||
camera_rotation = rotation_degrees # Initial rotation
|
||||
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
|
||||
# Set position and rotation to targets
|
||||
|
||||
position = position.lerp(camera_position, delta * 8)
|
||||
rotation_degrees = rotation_degrees.lerp(camera_rotation, delta * 6)
|
||||
|
||||
handle_input(delta)
|
||||
|
||||
# Handle input
|
||||
|
||||
func handle_input(_delta):
|
||||
|
||||
# Rotation
|
||||
|
||||
var input := Vector3.ZERO
|
||||
|
||||
input.x = Input.get_axis("camera_left", "camera_right")
|
||||
input.z = Input.get_axis("camera_forward", "camera_back")
|
||||
|
||||
input = input.rotated(Vector3.UP, rotation.y).normalized()
|
||||
|
||||
camera_position += input / 4
|
||||
|
||||
# Back to center
|
||||
|
||||
if Input.is_action_pressed("camera_center"):
|
||||
camera_position = Vector3()
|
||||
|
||||
func _input(event):
|
||||
|
||||
# Rotate camera using mouse (hold 'middle' mouse button)
|
||||
|
||||
if event is InputEventMouseMotion:
|
||||
if Input.is_action_pressed("camera_rotate"):
|
||||
camera_rotation += Vector3(0, -event.relative.x / 10, 0)
|
||||
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
extends Control
|
||||
|
||||
func _on_button_pressed():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _on_game_pressed():
|
||||
get_tree().change_scene_to_file("res://scenes/main.tscn")
|
||||
|
||||
|
||||
func _on_home_pressed():
|
||||
get_tree().change_scene_to_file("res://scenes/home.tscn")
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 59 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://3levxoui376j"
|
||||
path="res://.godot/imported/splash-screen.png-ae6c8b07e185ee8a074576008d9ccc5a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://splash-screen.png"
|
||||
dest_files=["res://.godot/imported/splash-screen.png-ae6c8b07e185ee8a074576008d9ccc5a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bng0d1sou7c8a"
|
||||
path="res://.godot/imported/coin.png-54d5e156d7891d9603a51f76f85b4fd9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/coin.png"
|
||||
dest_files=["res://.godot/imported/coin.png-54d5e156d7891d9603a51f76f85b4fd9.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 791 B |
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cbk07cxgshg26"
|
||||
path.s3tc="res://.godot/imported/selector.png-a5b2e7bc2bf34414a6d0f4a4e1472988.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/selector.png"
|
||||
dest_files=["res://.godot/imported/selector.png-a5b2e7bc2bf34414a6d0f4a4e1472988.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://bqb6g3t0tebno"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d0nnrx2y4px2v" path="res://models/building-garage.glb" id="1_gyclk"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_jrinw"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_jrinw")
|
||||
model = ExtResource("1_gyclk")
|
||||
price = 70
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://cntgl86ianngh"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cnycdi6t5tj01" path="res://models/building-small-a.glb" id="1_v5apy"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_q3i1h"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_q3i1h")
|
||||
model = ExtResource("1_v5apy")
|
||||
price = 50
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://c5fveedgvunju"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d2h51qlls136h" path="res://models/building-small-b.glb" id="1_klt7o"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_a2t3e"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_a2t3e")
|
||||
model = ExtResource("1_klt7o")
|
||||
price = 60
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://bh65eqgid4kxy"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://m74mvao50wnm" path="res://models/building-small-c.glb" id="1_6yyww"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_rkiq0"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_rkiq0")
|
||||
model = ExtResource("1_6yyww")
|
||||
price = 70
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://dtal0tl2ee336"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://h0vrvst3cumo" path="res://models/building-small-d.glb" id="1_164xq"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_8ewai"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_8ewai")
|
||||
model = ExtResource("1_164xq")
|
||||
price = 70
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://y6jafhfnhbrp"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dy26b1ba2j2v1" path="res://models/grass-trees-tall.glb" id="1_nbdd1"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_b2sah"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_b2sah")
|
||||
model = ExtResource("1_nbdd1")
|
||||
price = 25
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://ccb475jeg7ym5"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b1711sieed2u6" path="res://models/grass-trees.glb" id="1_lcgc1"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_pnpij"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_pnpij")
|
||||
model = ExtResource("1_lcgc1")
|
||||
price = 25
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://tm532uesguhk"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cr3btp34bp3eg" path="res://models/grass.glb" id="1_2n0ef"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_1i4lf"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_1i4lf")
|
||||
model = ExtResource("1_2n0ef")
|
||||
price = 10
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://dqqe3iofnleup"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://6v0t536s83vb" path="res://models/pavement-fountain.glb" id="1_r2n53"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_wqyte"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_wqyte")
|
||||
model = ExtResource("1_r2n53")
|
||||
price = 10
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://ch8vtcpine1lc"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cpv75mfsda1ml" path="res://models/pavement.glb" id="1_gudnj"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_i48go"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_i48go")
|
||||
model = ExtResource("1_gudnj")
|
||||
price = 10
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://d2jplegnkl6u2"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c4ccm2qr5wa58" path="res://models/road-corner.glb" id="1_r8n8k"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="3_oloyn"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_oloyn")
|
||||
model = ExtResource("1_r8n8k")
|
||||
price = 25
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://dveu4dnue0d54"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://euxdh7lkq0oj" path="res://models/road-intersection.glb" id="1_pnjl2"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_3eq5k"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_3eq5k")
|
||||
model = ExtResource("1_pnjl2")
|
||||
price = 25
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://cqvwy36htu81"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://mu30r6rmht07" path="res://models/road-split.glb" id="1_ku0rj"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_xa71m"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_xa71m")
|
||||
model = ExtResource("1_ku0rj")
|
||||
price = 25
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://mxrnqinnsqnt"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://5kchntr735l" path="res://models/road-straight-lightposts.glb" id="1_i07jw"]
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_470aq"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_470aq")
|
||||
model = ExtResource("1_i07jw")
|
||||
price = 25
|
||||
@ -0,0 +1,9 @@
|
||||
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://dv14kkhb6umkv"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/structure.gd" id="1_5fmmh"]
|
||||
[ext_resource type="PackedScene" uid="uid://b4tgtg0j2dgh8" path="res://models/road-straight.glb" id="1_ump1f"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_5fmmh")
|
||||
model = ExtResource("1_ump1f")
|
||||
price = 25
|
||||