From 566ebc118d6cf2860a8842c270edec402e0a302b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 9 Jan 2023 01:53:52 +0100 Subject: [PATCH] Fix misc things --- island/CropTile.tscn | 10 +++++----- island/Pineapple.tscn | 4 ++-- player/OnHand.gd | 10 +++------- player/Player.tscn | 6 +----- player/onhand/BaseWeapon.gd | 1 - player/onhand/peashooter_model.tscn | 9 ++------- project.godot | 2 +- 7 files changed, 14 insertions(+), 28 deletions(-) diff --git a/island/CropTile.tscn b/island/CropTile.tscn index c6f2440..a4b71fb 100644 --- a/island/CropTile.tscn +++ b/island/CropTile.tscn @@ -6,10 +6,10 @@ [ext_resource type="AudioStream" uid="uid://lkftwgdun745" path="res://assets/pop.wav" id="3_gur2a"] [ext_resource type="Script" path="res://island/Pop.gd" id="4_5e7wk"] -[sub_resource type="BoxShape3D" id="BoxShape3D_370jp"] +[sub_resource type="BoxShape3D" id="BoxShape3D_b16fk"] size = Vector3(1, 0.1, 1) -[sub_resource type="ArrayMesh" id="ArrayMesh_i27yi"] +[sub_resource type="ArrayMesh" id="ArrayMesh_phpc3"] _surfaces = [{ "aabb": AABB(-0.5, 0, -0.5, 1.00001, 1.00001, 1), "attribute_data": PackedByteArray(143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 31, 133, 107, 63, 183, 109, 91, 63, 143, 194, 117, 63, 219, 182, 109, 63, 143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 143, 194, 117, 63, 219, 182, 109, 63, 143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 143, 194, 117, 63, 219, 182, 109, 63, 143, 194, 117, 63, 183, 109, 91, 63, 31, 133, 107, 63, 183, 109, 91, 63, 31, 133, 107, 63, 219, 182, 109, 63, 143, 194, 117, 63, 219, 182, 109, 63), @@ -37,15 +37,15 @@ collision_mask = 0 [node name="PlantableArea" type="CollisionShape3D" parent="Plant"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0) -shape = SubResource("BoxShape3D_370jp") +shape = SubResource("BoxShape3D_b16fk") [node name="Sprout" type="MeshInstance3D" parent="Plant"] transform = Transform3D(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) -mesh = SubResource("ArrayMesh_i27yi") +mesh = SubResource("ArrayMesh_phpc3") skeleton = NodePath("../../..") [node name="GrowthTimer" type="Timer" parent="."] -wait_time = 2.0 +wait_time = 30.0 one_shot = true [node name="Pop" type="AudioStreamPlayer3D" parent="."] diff --git a/island/Pineapple.tscn b/island/Pineapple.tscn index d00529c..5647e46 100644 --- a/island/Pineapple.tscn +++ b/island/Pineapple.tscn @@ -8,7 +8,7 @@ [ext_resource type="PackedScene" uid="uid://ci0hy0d4d1476" path="res://island/CollectibleByPlayer.tscn" id="5_yps0c"] [ext_resource type="PackedScene" uid="uid://bj4d3a0jxgvpu" path="res://island/CanSplash.tscn" id="7_3mgie"] -[sub_resource type="CylinderShape3D" id="CylinderShape3D_e5jtb"] +[sub_resource type="CylinderShape3D" id="CylinderShape3D_q83gf"] height = 0.9 radius = 0.3 @@ -21,7 +21,7 @@ script = ExtResource("1_sbec5") [node name="Shape" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.45, 0) -shape = SubResource("CylinderShape3D_e5jtb") +shape = SubResource("CylinderShape3D_q83gf") [node name="PineappleMesh" parent="." instance=ExtResource("1_ndmmp")] diff --git a/player/OnHand.gd b/player/OnHand.gd index 4b79a54..3dd491b 100644 --- a/player/OnHand.gd +++ b/player/OnHand.gd @@ -15,7 +15,8 @@ var player: Player: return player set(p): player = p - self._on_player_set(p) + for weapon in weapons: + weapon.player = player var weapons: Array = [ @@ -29,11 +30,6 @@ func _ready() -> void: self._switch_weapon(BaseWeapon.WeaponSlot.ONE) -func _on_player_set(player: Player) -> void: - for weapon in weapons: - weapon.player = player - - func _input(_event: InputEvent) -> void: if Input.is_action_just_pressed("slot1"): _switch_weapon(BaseWeapon.WeaponSlot.ONE) @@ -51,7 +47,7 @@ func _switch_weapon(slot: BaseWeapon.WeaponSlot): # Remove active weapon if active_weapon: active_weapon.on_switch_out() - remove_child(active_weapon) + remove_child(active_weapon) # Add new weapon add_child(weapon) diff --git a/player/Player.tscn b/player/Player.tscn index a0af876..53a99f7 100644 --- a/player/Player.tscn +++ b/player/Player.tscn @@ -27,7 +27,7 @@ script/source = "extends Camera3D @export var MainCamera: Camera3D -func _process(delta): +func _process(_delta): if not MainCamera: return @@ -79,7 +79,6 @@ grow_horizontal = 2 grow_vertical = 2 [node name="CameraViewportContainer" type="SubViewportContainer" parent="Head/Viewport"] -layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -119,7 +118,6 @@ theme = SubResource("Theme_smyke") [node name="SubViewportContainer" type="SubViewportContainer" parent="HUD"] show_behind_parent = true -layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -149,7 +147,6 @@ scale = Vector2(1.65, 1) metadata/_edit_lock_ = true [node name="AmmoLabel" type="Label" parent="HUD"] -layout_mode = 1 anchors_preset = 3 anchor_left = 1.0 anchor_top = 1.0 @@ -169,7 +166,6 @@ vertical_alignment = 2 [node name="Crosshair" type="ColorRect" parent="HUD"] material = SubResource("ShaderMaterial_2p6rt") -layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 diff --git a/player/onhand/BaseWeapon.gd b/player/onhand/BaseWeapon.gd index ba00d5b..76a840c 100644 --- a/player/onhand/BaseWeapon.gd +++ b/player/onhand/BaseWeapon.gd @@ -47,6 +47,5 @@ func bob_weapon(node: Node3D, delta: float): func _input(event: InputEvent) -> void: if event is InputEventMouseMotion: - var vec = event.relative self.last_mouse_movement = event.relative diff --git a/player/onhand/peashooter_model.tscn b/player/onhand/peashooter_model.tscn index b666b29..6c0656b 100644 --- a/player/onhand/peashooter_model.tscn +++ b/player/onhand/peashooter_model.tscn @@ -11,14 +11,9 @@ script/source = "extends Node3D func _ready() -> void: var mesh = self.get_child(0) as MeshInstance3D var mat = mesh.get_active_material(0) as BaseMaterial3D -# mat.texture_filter = BaseMaterial3D.TEXTURE_FILTER_NEAREST - mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED + mat.texture_filter = BaseMaterial3D.TEXTURE_FILTER_NEAREST +# mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED # mat.ao_enabled = true - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass " [sub_resource type="Image" id="Image_435th"] diff --git a/project.godot b/project.godot index 5cf9c91..451bb9d 100644 --- a/project.godot +++ b/project.godot @@ -9,7 +9,7 @@ config_version=5 _global_script_classes=[{ -"base": "Node", +"base": "Node3D", "class": &"BaseWeapon", "language": &"GDScript", "path": "res://player/onhand/BaseWeapon.gd"