diff --git a/assets/blender-projects/highlights.blend b/assets/blender-projects/highlights.blend new file mode 100644 index 0000000..2b8bb10 Binary files /dev/null and b/assets/blender-projects/highlights.blend differ diff --git a/assets/blender-projects/highlights.blend1 b/assets/blender-projects/highlights.blend1 new file mode 100644 index 0000000..618db13 Binary files /dev/null and b/assets/blender-projects/highlights.blend1 differ diff --git a/assets/meshes/highlights-grass.glb b/assets/meshes/highlights-grass.glb new file mode 100644 index 0000000..d3fe019 Binary files /dev/null and b/assets/meshes/highlights-grass.glb differ diff --git a/assets/meshes/highlights-sand.glb b/assets/meshes/highlights-sand.glb new file mode 100644 index 0000000..32a6be0 Binary files /dev/null and b/assets/meshes/highlights-sand.glb differ diff --git a/assets/meshes/highlights-water.glb b/assets/meshes/highlights-water.glb new file mode 100644 index 0000000..a87a316 Binary files /dev/null and b/assets/meshes/highlights-water.glb differ diff --git a/assets/meshes/highlights_grass.tscn b/assets/meshes/highlights_grass.tscn new file mode 100644 index 0000000..a581f25 --- /dev/null +++ b/assets/meshes/highlights_grass.tscn @@ -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) diff --git a/assets/meshes/highlights_sand.tscn b/assets/meshes/highlights_sand.tscn new file mode 100644 index 0000000..ecbd726 --- /dev/null +++ b/assets/meshes/highlights_sand.tscn @@ -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) diff --git a/assets/meshes/highlights_water.tscn b/assets/meshes/highlights_water.tscn new file mode 100644 index 0000000..72a24cf --- /dev/null +++ b/assets/meshes/highlights_water.tscn @@ -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")] diff --git a/assets/tilesets/highlights.glb b/assets/tilesets/highlights.glb new file mode 100644 index 0000000..93690fc Binary files /dev/null and b/assets/tilesets/highlights.glb differ diff --git a/buildings/arms_building.cs b/buildings/arms_building.cs new file mode 100644 index 0000000..720fba2 --- /dev/null +++ b/buildings/arms_building.cs @@ -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; +} diff --git a/buildings/base_building.cs b/buildings/base_building.cs new file mode 100644 index 0000000..dce3755 --- /dev/null +++ b/buildings/base_building.cs @@ -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) + { + } +} diff --git a/buildings/building_block.cs b/buildings/building_block.cs new file mode 100644 index 0000000..8734151 --- /dev/null +++ b/buildings/building_block.cs @@ -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; + } + } +} \ No newline at end of file diff --git a/buildings/grass_block.tscn b/buildings/grass_block.tscn new file mode 100644 index 0000000..d35940d --- /dev/null +++ b/buildings/grass_block.tscn @@ -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="."] diff --git a/buildings/kash_building.cs b/buildings/kash_building.cs new file mode 100644 index 0000000..6ca237e --- /dev/null +++ b/buildings/kash_building.cs @@ -0,0 +1,7 @@ +using Godot; + +public partial class kash_building : base_building +{ + [Export] + public int KashGenPerSec { get; set; } = 1; +} diff --git a/buildings/propaganda_building.cs b/buildings/propaganda_building.cs new file mode 100644 index 0000000..966b821 --- /dev/null +++ b/buildings/propaganda_building.cs @@ -0,0 +1,7 @@ +using Godot; + +public partial class propaganda_building : base_building +{ + [Export] + public int Approval { get; set; } = 1; +} diff --git a/buildings/sand_block.tscn b/buildings/sand_block.tscn new file mode 100644 index 0000000..1fa3bb7 --- /dev/null +++ b/buildings/sand_block.tscn @@ -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="."] diff --git a/buildings/water_block.tscn b/buildings/water_block.tscn new file mode 100644 index 0000000..07e52c1 --- /dev/null +++ b/buildings/water_block.tscn @@ -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="."] diff --git a/project.godot b/project.godot index 78a01f3..78e19f3 100644 --- a/project.godot +++ b/project.godot @@ -18,6 +18,7 @@ config/icon="res://icon.svg" window/size/viewport_width=1920 window/size/viewport_height=1080 +window/size/mode=3 [dotnet]