Browse Source

fix negative oxygen

Henrik
Pixdigit 3 months ago
parent
commit
91587bc7f8
8 changed files with 101 additions and 128 deletions
  1. +0
    -76
      Demo.tscn
  2. +0
    -19
      LICENSE.txt
  3. +0
    -32
      README.md
  4. BIN
     
  5. BIN
     
  6. BIN
     
  7. +100
    -0
      export_presets.cfg
  8. +1
    -1
      src/State.gd

+ 0
- 76
Demo.tscn View File

@@ -1,76 +0,0 @@
[gd_scene load_steps=15 format=2]

[ext_resource path="res://sound_effects/walking_character8.wav" type="AudioStream" id=1]
[ext_resource path="res://sound_effects/walking_character7.wav" type="AudioStream" id=2]
[ext_resource path="res://sound_effects/walking_character2.wav" type="AudioStream" id=3]
[ext_resource path="res://sound_effects/walking_character4.wav" type="AudioStream" id=4]
[ext_resource path="res://sound_effects/walking_character3.wav" type="AudioStream" id=5]
[ext_resource path="res://sound_effects/walking_character5.wav" type="AudioStream" id=6]
[ext_resource path="res://sound_effects/walking_character1.wav" type="AudioStream" id=7]
[ext_resource path="res://sound_effects/walking_character6.wav" type="AudioStream" id=8]
[ext_resource path="res://addons/randomAudioStreamPlayer/random_audio_stream_player_3D.gd" type="Script" id=12]

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

onready var soundPlayer3D = get_node(\"Orbit/Sphere/RandomAudioStreamPlayer3D\")

func _process(delta):
if not soundPlayer3D.is_playing():
soundPlayer3D.play()
"

[sub_resource type="SphereMesh" id=2]

[sub_resource type="Animation" id=3]
resource_name = "Orbit"
length = 5.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, 5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ]
}

[sub_resource type="ProceduralSky" id=4]

[sub_resource type="Environment" id=5]
background_mode = 2
background_sky = SubResource( 4 )

[node name="Spatial" type="Spatial"]
script = SubResource( 1 )

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

[node name="Sphere" type="MeshInstance" parent="Orbit"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, 0 )
mesh = SubResource( 2 )
material/0 = null

[node name="RandomAudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Orbit/Sphere"]
script = ExtResource( 12 )
streams = [ ExtResource( 7 ), ExtResource( 3 ), ExtResource( 5 ), ExtResource( 4 ), ExtResource( 6 ), ExtResource( 8 ), ExtResource( 2 ), ExtResource( 1 ) ]
random_strategy = 2
randomize_volume = true
volume_max = 24.0
randomize_pitch = true
pitch_min = 0.5
pitch_max = 1.5

[node name="AnimationPlayer" type="AnimationPlayer" parent="Orbit"]
autoplay = "Orbit"
anims/Orbit = SubResource( 3 )

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 5 )

[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.965926, 0.258819, 0, -0.258819, 0.965926, 0, 5, 15 )

+ 0
- 19
LICENSE.txt View File

@@ -1,19 +0,0 @@
Copyright (c) 2020 Tim Krief.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

+ 0
- 32
README.md View File

@@ -1,32 +0,0 @@
# Random Audio Stream Player Nodes for Godot Engine

![Random Audio Stream Player Icon](icon.png "Random Audio Stream Player Icon")

This plugin will add Random Audio Stream Player Nodes (standard, 2D and 3D)
that can be used as normal Audio Stream Player Nodes with the added ability to
play randomly audio from an array of audio streams with the possibility to
choose the random strategy and to randomize the volume and the pitch.


# Install

This is a Godot Engine project that can be imported in godot and features a
demo using a Random Audio Stream Player 3D to play randomly walking sound
effects from an array of 8 possible sounds. (Sounds are made by me, Tim Krief
and are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike
4.0 International License.)

To use the plugin in your own project you can all the files in `addons/` to the
`addons/` folder of your project and enable the plugin in Godot. Complete
instructions are available here: [Installing plugins (GodotDocs)](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html)

# Notes

Made for the great [Godot Engine](https://godotengine.org/):

> Godot provides a huge set of common tools, so you can just focus on making your game without reinventing the wheel.
> Godot is completely free and open-source under the very permissive MIT license. No strings attached, no royalties, nothing. Your game is yours, down to the last line of engine code.

Tested on Godot Engine v3.2.1.stable.official

Icons are derived from the [AudioStreamPlayer](https://github.com/godotengine/godot/blob/3.2.1-stable/editor/icons/icon_audio_stream_player.svg), [AudioStreamPlayer2D](https://github.com/godotengine/godot/blob/3.2.1-stable/editor/icons/icon_audio_stream_player_2_d.svg) and [AudioStreamPlayer3D](https://github.com/godotengine/godot/blob/3.2.1-stable/editor/icons/icon_audio_stream_player_3_d.svg) icons from Godot Engine

BIN
View File


BIN
View File


BIN
View File


+ 100
- 0
export_presets.cfg View File

@@ -0,0 +1,100 @@
[preset.0]

name="Windows Desktop"
platform="Windows Desktop"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../ppp_win.exe"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.0.options]

texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=true
custom_template/release=""
custom_template/debug=""
codesign/enable=false
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

[preset.1]

name="Mac OSX"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../ppp_mac.zip"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.1.options]

custom_template/debug=""
custom_template/release=""
application/name=""
application/info="Made with Godot Engine"
application/icon=""
application/identifier=""
application/signature=""
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false

[preset.2]

name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../ppp_lin.x86_64"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.2.options]

texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=true
custom_template/release=""
custom_template/debug=""

+ 1
- 1
src/State.gd View File

@@ -60,4 +60,4 @@ func _input(_event):

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

Loading…
Cancel
Save