6 Commits

Author SHA1 Message Date
  Pixdigit 6d0728d30b Merge branch 'max' into Henrik 3 months ago
  Pixdigit 4ec7c86cbe fixes 3 months ago
  Pixdigit de09fd4a1c Merge branch 'Henrik' into max 3 months ago
  Pixdigit 292f6fa0b1 MOAR STUFF 3 months ago
  Pixdigit 506fece58b added plants 3 months ago
  Pixdigit cdc12d57a8 Merge branch 'Henrik' into max 3 months ago
5 changed files with 177 additions and 49 deletions
Split View
  1. +83
    -22
      scenes/Ship.tscn
  2. +12
    -1
      scenes/sub_scenes/OxygenBubble.tscn
  3. +5
    -5
      scenes/sub_scenes/player.tscn
  4. +70
    -20
      scenes/sub_scenes/satzkasten.tscn
  5. +7
    -1
      src/State.gd

+ 83
- 22
scenes/Ship.tscn View File

@@ -127,7 +127,7 @@ func _on_steer_body_exited(body):

[sub_resource type="Curve3D" id=20]
_data = {
"points": PoolVector3Array( 2.89339, -5.11357, 18.9823, -2.89339, 5.11357, -18.9823, 16.1517, 29.7389, 24.163, 0, 0, 0, 0, 0, 0, -0.164474, 254.772, 3.75325 ),
"points": PoolVector3Array( 2.89339, -5.11357, 18.9823, -2.89339, 5.11357, -18.9823, 16.1517, 29.7389, 24.163, 0, 0, 0, 0, 0, 0, -0.23999, 109.07, 3.75325 ),
"tilts": PoolRealArray( 0, 0 )
}

@@ -176,15 +176,22 @@ height = 0.1
[sub_resource type="BoxShape" id=25]
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="Animation" id=34]
resource_name = "New Anim"
length = 10.0
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, 10 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ]
}

[sub_resource type="GDScript" id=27]
script/source = "extends Area
@@ -417,10 +424,10 @@ __meta__ = {
}

[node name="PathFollow" type="PathFollow" parent="AnimationPlayer/CameraPath"]
transform = Transform( 0.670962, 0.445052, 0.593066, 0.609955, -0.786076, -0.100168, 0.421623, 0.428955, -0.798889, 16.1517, 29.7389, 24.163 )
transform = Transform( 0.657749, 0.444549, 0.608051, 0.654843, -0.736401, -0.16997, 0.372217, 0.509978, -0.775479, 16.1517, 29.7389, 24.163 )

[node name="Camera" type="Camera" parent="AnimationPlayer/CameraPath/PathFollow"]
transform = Transform( 0.367442, 0.138072, 0.919741, 0.168566, -0.982425, 0.0801399, 0.914642, 0.12559, -0.38426, 0, 0, 0 )
transform = Transform( 0.380903, 0.202422, 0.902186, 0.127339, -0.977926, 0.165654, 0.915803, 0.0517854, -0.398273, 0, 0, 0 )
current = true
far = 300.0
script = SubResource( 21 )
@@ -431,7 +438,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 100, 0, 0 )
amount = 1000
lifetime = 20.0
preprocess = 20.0
visibility_aabb = AABB( -201.095, -100.1, -99.9444, 202.151, 200.179, 199.996 )
visibility_aabb = AABB( -201.087, -40.0732, -59.9773, 202.177, 80.1695, 120.026 )
process_material = SubResource( 22 )
draw_pass_1 = SubResource( 24 )

@@ -447,12 +454,14 @@ transform = Transform( 1, 0, 0, 0, -0.416456, -0.909156, 0, 0.909156, -0.416456,
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( 26 )
speed = 0.0
transform = Transform( -0.747961, 0, 0.663739, 0, 1, 0, -0.663739, 0, -0.747961, 0, 30, 0 )

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

[node name="AnimationPlayer2" type="AnimationPlayer" parent="SeagullOrbit"]
autoplay = "New Anim"
"anims/New Anim" = SubResource( 34 )

[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( 27 )
@@ -488,11 +497,6 @@ shape = SubResource( 32 )
stream = ExtResource( 12 )
bus = "getSeed"

[node name="SeagullOrbit" type="Spatial" parent="."]
transform = Transform( 0.998575, 0, 0.0533729, 0, 1, 0, -0.0533729, 0, 0.998575, 0, 30, 0 )
script = SubResource( 26 )
speed = 0.5

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

@@ -513,6 +517,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="."]

@@ -529,18 +540,68 @@ transform = Transform( -1.62921e-07, 0, -1, 0, 1, 0, 1, 0, -1.62921e-07, 11.2304
type = 3

[node name="Quad" type="Spatial" parent="Plants"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.69396, 10.9869, 13.4172 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -7, 8, 4.221 )

[node name="satzkasten" parent="Plants/Quad" instance=ExtResource( 4 )]

[node name="satzkasten2" parent="Plants/Quad" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.5 )
type = 4

[node name="satzkasten3" parent="Plants/Quad" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 2.5 )
type = 4

[node name="satzkasten4" parent="Plants/Quad" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 0 )

[node name="Quad2" type="Spatial" parent="Plants"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 8, 4.221 )

[node name="satzkasten" parent="Plants/Quad2" instance=ExtResource( 4 )]

[node name="satzkasten2" parent="Plants/Quad2" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.5 )
type = 4

[node name="satzkasten3" parent="Plants/Quad2" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 2.5 )
type = 4

[node name="satzkasten4" parent="Plants/Quad2" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 0 )

[node name="Quad3" type="Spatial" parent="Plants"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -7, 8, -7.277 )

[node name="satzkasten" parent="Plants/Quad3" instance=ExtResource( 4 )]
type = 4

[node name="satzkasten2" parent="Plants/Quad3" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.5 )

[node name="satzkasten3" parent="Plants/Quad3" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 2.5 )

[node name="satzkasten4" parent="Plants/Quad3" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 0 )
type = 4

[node name="Quad4" type="Spatial" parent="Plants"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 8, -7.277 )

[node name="satzkasten" parent="Plants/Quad4" instance=ExtResource( 4 )]
type = 4

[node name="satzkasten2" parent="Plants/Quad4" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.5 )

[node name="satzkasten3" parent="Plants/Quad4" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 2.5 )

[node name="satzkasten4" parent="Plants/Quad4" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 0 )
type = 4
[connection signal="body_entered" from="AnimationPlayer/Area" to="AnimationPlayer" method="_on_steer_body_entered"]
[connection signal="body_exited" from="AnimationPlayer/Area" to="AnimationPlayer" method="_on_steer_body_exited"]
[connection signal="body_entered" from="WaterDetector" to="WaterDetector" method="_on_body_entered"]


+ 12
- 1
scenes/sub_scenes/OxygenBubble.tscn View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=2]
[gd_scene load_steps=21 format=2]

[sub_resource type="SphereMesh" id=1]

@@ -157,8 +157,19 @@ nodes/fragment/connections = PoolIntArray( 10, 0, 11, 0, 11, 0, 2, 3, 15, 0, 10,
shader = SubResource( 18 )
shader_param/Color = Color( 0.4, 0.827451, 1, 1 )

[sub_resource type="GDScript" id=20]
script/source = "extends MeshInstance

func _ready():
pass

func _process(_delta):
scale = State.o2 * Vector3(1, 1, 1)
"

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

[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
material/0 = SubResource( 19 )
script = SubResource( 20 )

+ 5
- 5
scenes/sub_scenes/player.tscn View File

@@ -20,6 +20,7 @@ var gravity : Vector3 = Vector3(0,-0.9,0)

onready var audio = get_node(\"RandomAudioStreamPlayer3D\")
onready var stepTimer = get_node(\"Timer\")
onready var mesh = get_node(\"MeshInstance\")
onready var fertilizer_logo = get_node(\"FertilizerLogo\")
onready var water_logo = get_node(\"WaterLogo\")
#onready var seed_logo = get_node(\"SeedLogo\")
@@ -90,8 +91,8 @@ func _on_Timer_timeout():


func smoothRotating(rot : float):
var targetRotation = lerp_angle(deg2rad(rotation_degrees.y), deg2rad(rot), 0.2)
rotation_degrees.y = rad2deg(targetRotation)
var targetRotation = lerp_angle(deg2rad(mesh.rotation_degrees.y), deg2rad(rot), 0.2)
mesh.rotation_degrees.y = rad2deg(targetRotation)
"

[sub_resource type="CapsuleMesh" id=2]
@@ -128,9 +129,6 @@ material/0 = SubResource( 5 )
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0 )
shape = SubResource( 6 )

[node name="Listener" type="Listener" parent="."]
current = true

[node name="Timer" type="Timer" parent="."]
wait_time = 0.3
autostart = true
@@ -160,4 +158,6 @@ visible = false

[node name="AnimationPlayer2" type="AnimationPlayer" parent="WaterLogo"]
autoplay = "rotate"

[node name="Listener" type="Listener" parent="."]
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]

+ 70
- 20
scenes/sub_scenes/satzkasten.tscn
File diff suppressed because it is too large
View File


+ 7
- 1
src/State.gd View File

@@ -30,7 +30,9 @@ enum ITEM {

var rng: RandomNumberGenerator = RandomNumberGenerator.new()

var o2: float = 0
var o2: float = 1
var o2_drain: float = 0.005
var o2_gain: float = 0.001

var selected_plant: Spatial = null
var player_inventory: int = ITEM.EMPTY setget set_item
@@ -55,3 +57,7 @@ func _input(_event):
if Input.is_action_just_pressed("Interact"):
if selected_plant != null:
selected_plant.interact()

func _process(delta):
var net_gain = plant_amounts[PLANT_TYPE.O2] * o2_gain - o2_drain
o2 = min(o2 + net_gain * delta, 1)

Loading…
Cancel
Save