Skip to content

Commit ae21a28

Browse files
committed
Implement review collider to fix overlapping buildings. Temporary removal of explosion wand and nut. Bulb is smaller.
1 parent 14c8084 commit ae21a28

File tree

17 files changed

+116
-183
lines changed

17 files changed

+116
-183
lines changed

Assets/Shaders/PreviewShader.gdshader

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
shader_type spatial;
22

3-
uniform vec3 renderColor = vec3(0.0, 1.0, 1.0);
3+
uniform vec3 validRenderColor = vec3(0.0, 1.0, 0.0);
4+
uniform vec3 invalidRenderColor = vec3(1.0, 0.0, 0.0);
5+
uniform bool isValid = true;
46
uniform float transparencyAmplitude = 0.25;
57
uniform float transparencyOffset = 0.125;
68
render_mode unshaded;
@@ -21,7 +23,14 @@ void fragment() {
2123

2224
ROUGHNESS = 1.0;
2325
ALPHA = (abs(sin(TIME)) + transparencyOffset) * transparencyAmplitude;
24-
ALBEDO = renderColor - bgColor;
26+
vec3 currentColor;
27+
if(isValid){
28+
currentColor = validRenderColor;
29+
}
30+
else{
31+
currentColor = invalidRenderColor;
32+
}
33+
ALBEDO = currentColor - bgColor;
2534
}
2635

2736
//void light() {

Entities/Player/Player.tscn

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ properties/6/replication_mode = 1
153153
properties/7/path = NodePath("Components/PlayerItemUse:desiredRotationY")
154154
properties/7/spawn = true
155155
properties/7/replication_mode = 1
156+
properties/8/path = NodePath("Components/PlayerItemUse:isUseValid")
157+
properties/8/spawn = true
158+
properties/8/replication_mode = 1
156159

157160
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("playerMovement", "cameraMovement", "playerInput", "chatHud", "camera", "model", "hud", "componentList", "nameTag")]
158161
floor_stop_on_slope = false
@@ -354,7 +357,7 @@ script = ExtResource("9_rtpsh")
354357
rayCast = NodePath("../../Neck/RayCast3D")
355358
hand = NodePath("../../Neck/Hand")
356359
handAnimator = NodePath("HandAnimator")
357-
inventory = Array[String](["hammer", "cube", "nut", "bulb"])
360+
inventory = Array[String](["hammer", "cube", "bulb"])
358361
parent = NodePath("../..")
359362

360363
[node name="HandAnimator" type="AnimationPlayer" parent="Components/PlayerItemUse"]

Entities/Player/PlayerItemUse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public partial class PlayerItemUse : AbstractPlayerComponent
2323
private BaseItem item;
2424
//desired rotation
2525
[Export] public float desiredRotationY = 0f;
26+
[Export] public bool isUseValid = false;
2627
private float rotationIncrement = 45f;
2728

2829
public override void _Ready()
@@ -87,7 +88,6 @@ public void ClientUse()
8788
[Rpc(MultiplayerApi.RpcMode.AnyPeer, CallLocal = true)]
8889
private void C2S_Use(Dictionary args)
8990
{
90-
GD.Print(item);
9191
item.UseItem(ItemUsageArgs.FromDictionary(args));
9292
}
9393

GameContent/Buildings/Bulb/PlacedBulb.tscn

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ blend_shape_mode = 0
8585
shadow_mesh = SubResource("ArrayMesh_x14qh")
8686

8787
[sub_resource type="BoxShape3D" id="BoxShape3D_col7d"]
88-
size = Vector3(0.728088, 1.16309, 0.728516)
88+
size = Vector3(0.5, 0.9, 0.5)
8989

9090
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0g4ia"]
9191
properties/0/path = NodePath(".:position")
@@ -100,7 +100,7 @@ freeze = true
100100
script = ExtResource("1_mqh4i")
101101

102102
[node name="model" type="Node3D" parent="."]
103-
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
103+
transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, -0.5, 0)
104104

105105
[node name="Base" type="MeshInstance3D" parent="model"]
106106
mesh = SubResource("ArrayMesh_fu5l0")
@@ -111,16 +111,16 @@ mesh = SubResource("ArrayMesh_4krtv")
111111
skeleton = NodePath("")
112112

113113
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
114-
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0693365, 0)
114+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.014044, -0.0622085, -0.014258)
115115
shape = SubResource("BoxShape3D_col7d")
116116

117117
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
118118
replication_config = SubResource("SceneReplicationConfig_0g4ia")
119119

120120
[node name="OmniLight3D" type="OmniLight3D" parent="."]
121-
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.07579, 0)
121+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.57579, 0)
122122
light_color = Color(1, 0.694118, 0, 1)
123-
light_energy = 5.0
123+
light_energy = 4.0
124124
light_size = 16.0
125125
light_specular = 0.0
126126
omni_range = 16.3436

GameContent/Items/Bulb/ItemBulb.tscn

Lines changed: 8 additions & 78 deletions
Large diffs are not rendered by default.

GameContent/Items/Cube/Cube.tres

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ itemScene = ExtResource("1_q23lb")
1010
itemID = "cube"
1111
itemIcon = ExtResource("1_7un7m")
1212
itemName = "Cube"
13-
usageCooldown = 0.013
14-
raycastRange = 15.0
13+
usageCooldown = 0.1

GameContent/Items/Cube/ItemCube.tscn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
[node name="ItemCube" instance=ExtResource("1_jtm4k")]
88
buildingScene = ExtResource("2_nxowp")
9+
snapRange = 0.5
910

1011
[node name="HandItem" parent="." index="0"]
1112
mesh = ExtResource("3_ghdtp")
13+
14+
[connection signal="body_entered" from="PreviewCollider" to="PreviewCollider" method="_on_body_entered"]
15+
[connection signal="body_exited" from="PreviewCollider" to="PreviewCollider" method="_on_body_exited"]

GameContent/Items/ExplosionStaff/ExplosionStaff.tres

Lines changed: 0 additions & 13 deletions
This file was deleted.

GameContent/Items/ExplosionStaff/ItemExplosionStaff.tscn

Lines changed: 0 additions & 9 deletions
This file was deleted.

GameContent/Items/Nut/ItemNut.tscn

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)