Browse Source

small fixes

Henrik
Pixdigit 3 months ago
parent
commit
87be7f7d37
3 changed files with 46 additions and 68 deletions
  1. +35
    -28
      scenes/Ship.tscn
  2. +5
    -0
      scenes/sub_scenes/Seagull.tscn
  3. +6
    -40
      scenes/sub_scenes/player.tscn

+ 35
- 28
scenes/Ship.tscn View File

@@ -174,6 +174,16 @@ height = 0.1
extents = Vector3( 0.8, 2.16543, 0.8 )

[sub_resource type="GDScript" id=26]
script/source = "tool
extends Spatial

export var speed: float

func _physics_process(delta):
rotation.y += speed * delta
"

[sub_resource type="GDScript" id=27]
script/source = "extends Area

func _ready():
@@ -185,10 +195,10 @@ func _on_body_entered(body):
State.player_inventory = State.ITEM.WATER
"

[sub_resource type="BoxShape" id=27]
[sub_resource type="BoxShape" id=28]
extents = Vector3( 1.17384, 2.64489, 1.23621 )

[sub_resource type="GDScript" id=28]
[sub_resource type="GDScript" id=29]
script/source = "extends Area

func _ready():
@@ -200,10 +210,10 @@ func _on_body_entered(body):
State.player_inventory = State.ITEM.FERTILIZER
"

[sub_resource type="BoxShape" id=29]
[sub_resource type="BoxShape" id=30]
extents = Vector3( 1.47223, 2.50833, 2.55238 )

[sub_resource type="GDScript" id=30]
[sub_resource type="GDScript" id=31]
script/source = "extends Area

func _ready():
@@ -214,19 +224,9 @@ func _on_body_entered(body):
State.player_inventory = State.ITEM.SEED
"

[sub_resource type="BoxShape" id=31]
[sub_resource type="BoxShape" id=32]
extents = Vector3( 1.47223, 2.27452, 1.36382 )

[sub_resource type="GDScript" id=32]
script/source = "tool
extends Spatial

export var speed: float

func _physics_process(delta):
rotation.y += speed * delta
"

[node name="Ship" type="Spatial"]

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
@@ -422,38 +422,39 @@ light_energy = 0.2

[node name="SeagullOrbit" type="Spatial" parent="."]
transform = Transform( -0.963966, 0, 0.266016, 0, 1, 0, -0.266016, 0, -0.963966, 0, 30, 0 )
script = SubResource( 32 )
script = SubResource( 26 )
speed = 0.0

[node name="Gull Dummy" parent="SeagullOrbit" instance=ExtResource( 3 )]

[node name="WaterDetector" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -9.99335, 9.65661, -0.110578 )
script = SubResource( 26 )
script = SubResource( 27 )

[node name="CollisionShape" type="CollisionShape" parent="WaterDetector"]
shape = SubResource( 27 )
shape = SubResource( 28 )

[node name="FertilizerDetector" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.71211, -4.76837e-07, 3.47488 )
script = SubResource( 28 )
script = SubResource( 29 )

[node name="CollisionShape" type="CollisionShape" parent="FertilizerDetector"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -10.3587, 8.62152, 1.31896 )
shape = SubResource( 29 )
shape = SubResource( 30 )

[node name="SeedDetector" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 19.853, 11.718, 0.149496 )
script = SubResource( 30 )
script = SubResource( 31 )

[node name="CollisionShape" type="CollisionShape" parent="SeedDetector"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0787144, 0.580219, -0.135435 )
shape = SubResource( 31 )
shape = SubResource( 32 )

[node name="SeagullOrbit" type="Spatial" parent="."]
transform = Transform( -0.265779, 0, -0.964034, 0, 1, 0, 0.964034, 0, -0.265779, 0, 30, 0 )
script = SubResource( 32 )
transform = Transform( 0.874581, 0, -0.48488, 0, 1, 0, 0.48488, 0, 0.874581, 0, 30, 0 )
script = SubResource( 26 )
speed = 0.5

[node name="Gull Dummy" parent="SeagullOrbit" instance=ExtResource( 3 )]

[node name="Bubble" parent="." instance=ExtResource( 5 )]
transform = Transform( 30, 0, 0, 0, 25, 0, 0, 0, 25, -2.66053, 15.0877, 0 )

@@ -463,7 +464,7 @@ autoplay = true
bus = "Music"

[node name="CreakSound" type="Spatial" parent="."]
script = SubResource( 27 )
script = SubResource( 28 )

[node name="Timer" type="Timer" parent="CreakSound"]
wait_time = 5.0
@@ -474,6 +475,13 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.19563, 8.60105, 0 )
bus = "Creaks"
script = ExtResource( 6 )
streams = [ ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ) ]
random_strategy = 0
randomize_volume = false
volume_min = 0.0
volume_max = 0.0
randomize_pitch = false
pitch_min = 1.0
pitch_max = 1.0

[node name="Plants" type="Spatial" parent="."]

@@ -507,4 +515,3 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 0 )
[connection signal="body_entered" from="WaterDetector" to="WaterDetector" method="_on_body_entered"]
[connection signal="body_entered" from="FertilizerDetector" to="FertilizerDetector" method="_on_body_entered"]
[connection signal="body_entered" from="SeedDetector" to="SeedDetector" method="_on_body_entered"]
[connection signal="timeout" from="CreakSound/Timer" to="CreakSound" method="_on_Timer_timeout"]

+ 5
- 0
scenes/sub_scenes/Seagull.tscn View File

@@ -36,6 +36,11 @@ script = SubResource( 2 )
bus = "Seagull"
script = ExtResource( 5 )
streams = [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 4 ), ExtResource( 1 ) ]
random_strategy = 0
randomize_volume = false
volume_min = 10.0
volume_max = 10.0
randomize_pitch = false
pitch_min = 1.0
pitch_max = 1.0
[connection signal="timeout" from="Timer" to="Timer" method="_on_timeout"]

+ 6
- 40
scenes/sub_scenes/player.tscn View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=2]
[gd_scene load_steps=13 format=2]

[ext_resource path="res://addons/randomAudioStreamPlayer/random_audio_stream_player_3D.gd" type="Script" id=1]
[ext_resource path="res://assets/sound/Steps/Metal_Footstep_02_mono.ogg" type="AudioStream" id=2]
@@ -22,7 +22,7 @@ onready var audio = get_node(\"RandomAudioStreamPlayer3D\")
onready var stepTimer = get_node(\"Timer\")
onready var fertilizer_logo = get_node(\"FertilizerLogo\")
onready var water_logo = get_node(\"WaterLogo\")
onready var seed_logo = get_node(\"SeedLogo\")
#onready var seed_logo = get_node(\"SeedLogo\")

func _ready():
var err = State.connect(\"item_changed\", self, \"_on_item_changed\")
@@ -37,7 +37,7 @@ func _on_item_changed():
elif State.player_inventory == State.ITEM.FERTILIZER:
fertilizer_logo.visible = true
elif State.player_inventory == State.ITEM.SEED:
seed_logo.visible = true
pass # TODO seed_logo.visible = true

func _physics_process(_delta):
@@ -90,8 +90,6 @@ func _on_Timer_timeout():


func smoothRotating(rot : float):
print_debug(deg2rad(rotation_degrees.y) as String + \"to\" + deg2rad(rot) as String)
var targetRotation = lerp_angle(deg2rad(rotation_degrees.y), deg2rad(rot), 0.2)
rotation_degrees.y = rad2deg(targetRotation)
"
@@ -110,38 +108,6 @@ albedo_color = Color( 0.968627, 0.282353, 0.282353, 1 )
[sub_resource type="CapsuleShape" id=6]
height = 2.0

[sub_resource type="Animation" id=4]
resource_name = "rotate"
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ]
}

[sub_resource type="Animation" id=5]
resource_name = "rotate"
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ]
}

[node name="Player" type="KinematicBody"]
script = SubResource( 1 )
__meta__ = {
@@ -177,6 +143,9 @@ random_strategy = 2
randomize_volume = true
volume_min = -80.0
volume_max = -80.0
randomize_pitch = false
pitch_min = 1.0
pitch_max = 1.0

[node name="FertilizerLogo" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.41941, 0, 0.907797, 0, 1, 0, -0.907797, 0, 0.41941, 0, 3, 0 )
@@ -184,7 +153,6 @@ visible = false

[node name="AnimationPlayer" type="AnimationPlayer" parent="FertilizerLogo"]
autoplay = "rotate"
anims/rotate = SubResource( 4 )

[node name="WaterLogo" parent="." instance=ExtResource( 6 )]
transform = Transform( 0.901675, 0, -0.432413, 0, 1, 0, 0.432413, 0, 0.901675, 0, 3, 0 )
@@ -192,6 +160,4 @@ visible = false

[node name="AnimationPlayer2" type="AnimationPlayer" parent="WaterLogo"]
autoplay = "rotate"
anims/rotate = SubResource( 5 )

[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]

Loading…
Cancel
Save