basic building structures
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								assets/blender-projects/highlights.blend
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/blender-projects/highlights.blend
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								assets/blender-projects/highlights.blend1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/blender-projects/highlights.blend1
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								assets/meshes/highlights-grass.glb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/meshes/highlights-grass.glb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								assets/meshes/highlights-sand.glb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/meshes/highlights-sand.glb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								assets/meshes/highlights-water.glb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/meshes/highlights-water.glb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										8
									
								
								assets/meshes/highlights_grass.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								assets/meshes/highlights_grass.tscn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| [gd_scene load_steps=2 format=3 uid="uid://cdakee12nn8un"] | ||||
|  | ||||
| [ext_resource type="PackedScene" uid="uid://drquy4ugyqfej" path="res://assets/meshes/highlights-grass.glb" id="1_nkvow"] | ||||
|  | ||||
| [node name="highlights-grass" instance=ExtResource("1_nkvow")] | ||||
|  | ||||
| [node name="highlight-grass" parent="." index="0"] | ||||
| transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) | ||||
							
								
								
									
										8
									
								
								assets/meshes/highlights_sand.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								assets/meshes/highlights_sand.tscn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| [gd_scene load_steps=2 format=3 uid="uid://bea5tpiqs0m4b"] | ||||
|  | ||||
| [ext_resource type="PackedScene" uid="uid://boupol2bwdrty" path="res://assets/meshes/highlights-sand.glb" id="1_jjdub"] | ||||
|  | ||||
| [node name="highlights-sand" instance=ExtResource("1_jjdub")] | ||||
|  | ||||
| [node name="highlight-sand" parent="." index="0"] | ||||
| transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0190696, -0.0119573, -0.0436006) | ||||
							
								
								
									
										5
									
								
								assets/meshes/highlights_water.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								assets/meshes/highlights_water.tscn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| [gd_scene load_steps=2 format=3 uid="uid://be1m1udcg0v54"] | ||||
|  | ||||
| [ext_resource type="PackedScene" uid="uid://ds0lxspxtnkcp" path="res://assets/meshes/highlights-water.glb" id="1_kcb3v"] | ||||
|  | ||||
| [node name="highlights-water" instance=ExtResource("1_kcb3v")] | ||||
							
								
								
									
										
											BIN
										
									
								
								assets/tilesets/highlights.glb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/tilesets/highlights.glb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										9
									
								
								buildings/arms_building.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								buildings/arms_building.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| using Godot; | ||||
|  | ||||
| public partial class arms_building : base_building | ||||
| { | ||||
|     [Export] | ||||
|     public int Megaton { get; set; } = 1; | ||||
|     [Export] | ||||
|     public int Approval { get; set; } = -1; | ||||
| } | ||||
							
								
								
									
										31
									
								
								buildings/base_building.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								buildings/base_building.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| using Godot; | ||||
|  | ||||
| public partial class base_building : Node3D | ||||
| { | ||||
|     [Export] | ||||
|     public Node3D BlocksNode { get; set; } = null; | ||||
|     private building_block[] _blocks = null; | ||||
|  | ||||
|     [Export] | ||||
|     public string DisplayName { get; set; } = "base_building"; | ||||
|     [Export] | ||||
|     public int KashCost { get; set; } = -1; | ||||
|     public bool IsPlaceable | ||||
|     { | ||||
|         get | ||||
|         { | ||||
|             return false; | ||||
|         } | ||||
|     } | ||||
|     public override void _Ready() | ||||
|     { | ||||
|         if (BlocksNode != null) | ||||
|         { | ||||
|  | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override void _Process(double delta) | ||||
|     { | ||||
|     } | ||||
| } | ||||
							
								
								
									
										34
									
								
								buildings/building_block.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								buildings/building_block.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| using Godot; | ||||
| public enum TileTypes | ||||
| { | ||||
|     NONE, | ||||
|     Grass, | ||||
|     Sand, | ||||
|     Water, | ||||
| } | ||||
|  | ||||
| public partial class building_block : Node3D | ||||
| { | ||||
|     [Export] | ||||
|     public RayCast3D _ray = null; | ||||
|  | ||||
|     [Export] | ||||
|     private TileTypes _compatible_tile = TileTypes.NONE; | ||||
|  | ||||
|     public bool IsPlaceable | ||||
|     { | ||||
|         get | ||||
|         { | ||||
|             if (_ray == null || _compatible_tile == TileTypes.NONE) | ||||
|                 return false; | ||||
|  | ||||
|             GodotObject collider = _ray.GetCollider(); | ||||
|             GD.Print(collider); | ||||
|  | ||||
|             if (collider == null) | ||||
|                 return false; | ||||
|  | ||||
|             return false; | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								buildings/grass_block.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								buildings/grass_block.tscn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| [gd_scene load_steps=3 format=3 uid="uid://m3lrwoup4i4r"] | ||||
|  | ||||
| [ext_resource type="Script" path="res://buildings/building_block.cs" id="1_3ht4p"] | ||||
| [ext_resource type="PackedScene" uid="uid://cdakee12nn8un" path="res://assets/meshes/highlights_grass.tscn" id="2_m6bs4"] | ||||
|  | ||||
| [node name="grass_block" type="Node3D" node_paths=PackedStringArray("_ray")] | ||||
| script = ExtResource("1_3ht4p") | ||||
| _ray = NodePath("RayCast3D") | ||||
| _compatible_tile = 1 | ||||
|  | ||||
| [node name="highlights-grass" parent="." instance=ExtResource("2_m6bs4")] | ||||
|  | ||||
| [node name="RayCast3D" type="RayCast3D" parent="."] | ||||
							
								
								
									
										7
									
								
								buildings/kash_building.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								buildings/kash_building.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| using Godot; | ||||
|  | ||||
| public partial class kash_building : base_building | ||||
| { | ||||
|     [Export] | ||||
|     public int KashGenPerSec { get; set; } = 1; | ||||
| } | ||||
							
								
								
									
										7
									
								
								buildings/propaganda_building.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								buildings/propaganda_building.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| using Godot; | ||||
|  | ||||
| public partial class propaganda_building : base_building | ||||
| { | ||||
|     [Export] | ||||
|     public int Approval { get; set; } = 1; | ||||
| } | ||||
							
								
								
									
										13
									
								
								buildings/sand_block.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								buildings/sand_block.tscn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| [gd_scene load_steps=3 format=3 uid="uid://dffhktks7ro6y"] | ||||
|  | ||||
| [ext_resource type="Script" path="res://buildings/building_block.cs" id="1_xuxw4"] | ||||
| [ext_resource type="PackedScene" uid="uid://bea5tpiqs0m4b" path="res://assets/meshes/highlights_sand.tscn" id="2_pmjbb"] | ||||
|  | ||||
| [node name="sand_block" type="Node3D" node_paths=PackedStringArray("_ray")] | ||||
| script = ExtResource("1_xuxw4") | ||||
| _ray = NodePath("RayCast3D") | ||||
| _compatible_tile = 2 | ||||
|  | ||||
| [node name="highlights-sand" parent="." instance=ExtResource("2_pmjbb")] | ||||
|  | ||||
| [node name="RayCast3D" type="RayCast3D" parent="."] | ||||
							
								
								
									
										13
									
								
								buildings/water_block.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								buildings/water_block.tscn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| [gd_scene load_steps=3 format=3 uid="uid://b3jpnuj1suvcj"] | ||||
|  | ||||
| [ext_resource type="Script" path="res://buildings/building_block.cs" id="1_p3ylt"] | ||||
| [ext_resource type="PackedScene" uid="uid://ds0lxspxtnkcp" path="res://assets/meshes/highlights-water.glb" id="2_53d7w"] | ||||
|  | ||||
| [node name="water_block" type="Node3D" node_paths=PackedStringArray("_ray")] | ||||
| script = ExtResource("1_p3ylt") | ||||
| _ray = NodePath("RayCast3D") | ||||
| _compatible_tile = 3 | ||||
|  | ||||
| [node name="highlights-water" parent="." instance=ExtResource("2_53d7w")] | ||||
|  | ||||
| [node name="RayCast3D" type="RayCast3D" parent="."] | ||||
| @@ -18,6 +18,7 @@ config/icon="res://icon.svg" | ||||
|  | ||||
| window/size/viewport_width=1920 | ||||
| window/size/viewport_height=1080 | ||||
| window/size/mode=3 | ||||
|  | ||||
| [dotnet] | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user