Compare commits
3 Commits
e767e776f2
...
58fcdc9111
| Author | SHA1 | Date | |
|---|---|---|---|
| 58fcdc9111 | |||
| e92d350dad | |||
| b4c21c037d |
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/androidarm64/libsteam_api.so
Normal file
BIN
addons/godotsteam/androidarm64/libsteam_api.so
Normal file
Binary file not shown.
28
addons/godotsteam/godotsteam.gdextension
Normal file
28
addons/godotsteam/godotsteam.gdextension
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
[configuration]
|
||||||
|
entry_symbol = "godotsteam_init"
|
||||||
|
compatibility_minimum = "4.4"
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
android.debug.arm64 = "res://addons/godotsteam/androidarm64/libgodotsteam.android.template_debug.arm64.so"
|
||||||
|
android.release.arm64 = "res://addons/godotsteam/androidarm64/libgodotsteam.android.template_release.arm64.so"
|
||||||
|
linux.debug.arm64 = "res://addons/godotsteam/linuxarm64/libgodotsteam.linux.template_debug.arm64.so"
|
||||||
|
linux.debug.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_debug.x86_64.so"
|
||||||
|
linux.debug.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_debug.x86_32.so"
|
||||||
|
linux.release.arm64 = "res://addons/godotsteam/linuxarm64/libgodotsteam.linux.template_release.arm64.so"
|
||||||
|
linux.release.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_release.x86_64.so"
|
||||||
|
linux.release.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_release.x86_32.so"
|
||||||
|
macos.debug = "res://addons/godotsteam/osx/libgodotsteam.macos.template_debug.dylib"
|
||||||
|
macos.release = "res://addons/godotsteam/osx/libgodotsteam.macos.template_release.dylib"
|
||||||
|
windows.debug.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_debug.x86_64.dll"
|
||||||
|
windows.debug.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_debug.x86_32.dll"
|
||||||
|
windows.release.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_release.x86_64.dll"
|
||||||
|
windows.release.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_release.x86_32.dll"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
android.arm64 = { "res://addons/godotsteam/androidarm64/libsteam_api.so": "" }
|
||||||
|
linux.arm64 = { "res://addons/godotsteam/linuxarm64/libsteam_api.so": "" }
|
||||||
|
linux.x86_64 = { "res://addons/godotsteam/linux64/libsteam_api.so": "" }
|
||||||
|
linux.x86_32 = { "res://addons/godotsteam/linux32/libsteam_api.so": "" }
|
||||||
|
macos.universal = { "res://addons/godotsteam/osx/libsteam_api.dylib": "" }
|
||||||
|
windows.x86_64 = { "res://addons/godotsteam/win64/steam_api64.dll": "" }
|
||||||
|
windows.x86_32 = { "res://addons/godotsteam/win32/steam_api.dll": "" }
|
||||||
1
addons/godotsteam/godotsteam.gdextension.uid
Normal file
1
addons/godotsteam/godotsteam.gdextension.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://xa5gtvqdowmw
|
||||||
23
addons/godotsteam/license.md
Normal file
23
addons/godotsteam/license.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2015-Current | GP Garcia, Chris Ridenour, and Contributors
|
||||||
|
|
||||||
|
View all contributors at https://godotsteam.com/contribute/contributors/
|
||||||
|
|
||||||
|
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.
|
||||||
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/linux32/libsteam_api.so
Normal file
BIN
addons/godotsteam/linux32/libsteam_api.so
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/linux64/libsteam_api.so
Normal file
BIN
addons/godotsteam/linux64/libsteam_api.so
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/linuxarm64/libsteam_api.so
Normal file
BIN
addons/godotsteam/linuxarm64/libsteam_api.so
Normal file
Binary file not shown.
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_debug.dylib
Normal file
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_debug.dylib
Normal file
Binary file not shown.
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_release.dylib
Normal file
BIN
addons/godotsteam/osx/libgodotsteam.macos.template_release.dylib
Normal file
Binary file not shown.
BIN
addons/godotsteam/osx/libsteam_api.dylib
Normal file
BIN
addons/godotsteam/osx/libsteam_api.dylib
Normal file
Binary file not shown.
87
addons/godotsteam/readme.md
Normal file
87
addons/godotsteam/readme.md
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
# GodotSteam for GDExtension | Community Edition
|
||||||
|
An ecosystem of tools for [Godot Engine](https://godotengine.org) and [Valve's Steam](https://store.steampowered.com). For the Windows, Linux, and Mac platforms.
|
||||||
|
|
||||||
|
|
||||||
|
Additional Flavors
|
||||||
|
---
|
||||||
|
Standard Module | Standard Plug-ins | Server Module | Server Plug-ins | Examples
|
||||||
|
--- | --- | --- | --- | ---
|
||||||
|
[Godot 2.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot2) | [GDNative](https://codeberg.org/godotsteam/godotsteam/src/branch/gdnative) | [Server 3.x](https://codeberg.org/godotsteam/godotsteam-server/src/branch/godot3) | [GDNative](https://codeberg.org/godotsteam/godotsteam-server/src/branch/gdnative) | [Skillet](https://codeberg.org/godotsteam/skillet)
|
||||||
|
[Godot 3.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot3) | [GDExtension](https://codeberg.org/godotsteam/godotsteam/src/branch/gdextension) | [Server 4.x](https://codeberg.org/godotsteam/godotsteam-server/src/branch/godot4) | [GDExtension](https://codeberg.org/godotsteam/godotsteam-server/src/branch/gdextension) | [Skillet UGC Editor](https://codeberg.org/godotsteam/skillet/src/branch/ugc_editor)
|
||||||
|
[Godot 4.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot4) | --- | --- | --- | ---
|
||||||
|
[MultiplayerPeer](https://codeberg.org/godotsteam/multiplayerpeer)| --- | --- | --- | ---
|
||||||
|
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
---
|
||||||
|
[Documentation is available here](https://godotsteam.com/). You can also check out the Search Help section inside Godot Engine. [To start, try checking out our tutorial on initializing Steam.](https://godotsteam.com/tutorials/initializing/) There are additional tutorials, with more in the works. You can also [check out additional Godot and Steam related videos, text, additional tools, plug-ins, etc. here.](https://godotsteam.com/resources/external/)
|
||||||
|
|
||||||
|
Feel free to chat with us about GodotSteam or ask for assistance on the [Stoat server](https://stt.gg/9DxQ3Dcd) or [IRC on Libera Chat](irc://irc.libera.chat/#godotsteam).
|
||||||
|
|
||||||
|
|
||||||
|
Donate
|
||||||
|
---
|
||||||
|
Pull-requests are the best way to help the project out but you can also donate through [Github Sponsors](https://github.com/sponsors/Gramps) or [LiberaPay](https://liberapay.com/godotsteam/donate)! [You can read more about donor perks here.](https://godotsteam.com/contribute/donations/) [You can also view all our awesome donors here.](https://godotsteam.com/contribute/donors/)
|
||||||
|
|
||||||
|
|
||||||
|
Current Build
|
||||||
|
---
|
||||||
|
You can [download pre-compiled versions of this repo here](https://codeberg.org/godotsteam/godotsteam/releases).
|
||||||
|
|
||||||
|
**Version 4.17.1 Changes**
|
||||||
|
|
||||||
|
- Changed: SCsub and config.py for ARM64 and Android
|
||||||
|
- Fixed: potential crash in disconnect_peer; thanks to ***bearlikelion***
|
||||||
|
|
||||||
|
[You can read more change-logs here](https://godotsteam.com/changelog/gdextension/).
|
||||||
|
|
||||||
|
|
||||||
|
Compatibility
|
||||||
|
---
|
||||||
|
While rare, sometimes Steamworks SDK updates will break compatilibity with older GodotSteam versions. Any compatability breaks are noted below. Newer API files (dll, so, dylib) _should_ still work for older versions.
|
||||||
|
|
||||||
|
Steamworks SDK Version | GodotSteam Version
|
||||||
|
---|---
|
||||||
|
1.63 or newer | 4.17
|
||||||
|
1.62 | 4.14 or 4.16.2
|
||||||
|
1.61 | 4.12 to 4.13
|
||||||
|
1.60 | 4.6 to 4.11
|
||||||
|
1.59 | 4.6 to 4.8
|
||||||
|
1.58a or older | 4.5.4 or older
|
||||||
|
|
||||||
|
Versions of GodotSteam that have compatibility breaks introduced.
|
||||||
|
|
||||||
|
GodotSteam Version | Broken Compatibility
|
||||||
|
---|---
|
||||||
|
4.8 | Networking identity system removed, replaced with Steam IDs
|
||||||
|
4.9 | sendMessages returns an Array
|
||||||
|
4.11 | setLeaderboardDetailsMax removed
|
||||||
|
4.13 | getItemDefinitionProperty return a dictionary, html_needs_paint key 'bgra' changed to 'rbga'
|
||||||
|
4.14 | Removed first argument for stat request in steamInit and steamInitEx, steamInit returns intended bool value
|
||||||
|
4.16 | Variety of small break points, refer to [4.16 changelog for details](https://godotsteam.com/changelog/godot4/)
|
||||||
|
4.17 | Windows projects using Steam SDK 1.63 are meant to work with Proton 11 or Experimental on Linux / Steam Deck.
|
||||||
|
|
||||||
|
|
||||||
|
Known Issues
|
||||||
|
---
|
||||||
|
- GDExtension for 4.4 is **not** compatible with 4.3.x or lower. Please check the versions you are using.
|
||||||
|
- Overlay will not work in the editor but will work in export projects when uploaded to Steam. This seems to a limitation with Vulkan currently.
|
||||||
|
|
||||||
|
|
||||||
|
Quick How-To
|
||||||
|
---
|
||||||
|
For complete instructions on how to build the GDExtension version of GodotSteam, [please refer to our documentation's 'How-To GDExtension' section.](https://godotsteam.com/howto/gdextension/) It will have the most up-to-date information.
|
||||||
|
|
||||||
|
Alternatively, you can just [download the pre-compiled versions in our Releases section](https://codeberg.org/godotsteam/godotsteam/releases) or [from the Godot Asset Library](https://godotengine.org/asset-library/asset/2445) and skip compiling it yourself!
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
---
|
||||||
|
Do not use the GDExtension version of GodotSteam with any of the module versions whether it be our pre-compiled versions or ones you compile. They are not compatible with each other.
|
||||||
|
|
||||||
|
When exporting with the GDExtension version, please use the normal Godot Engine templates instead of our GodotSteam templates or you will have a lot of issues.
|
||||||
|
|
||||||
|
|
||||||
|
License
|
||||||
|
---
|
||||||
|
MIT license
|
||||||
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/win32/steam_api.dll
Normal file
BIN
addons/godotsteam/win32/steam_api.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
addons/godotsteam/win64/steam_api64.dll
Normal file
BIN
addons/godotsteam/win64/steam_api64.dll
Normal file
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/main_menu.ogg-45c6ef59eabdc081ad36ff5114035b6
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
loop=true
|
loop=true
|
||||||
loop_offset=0
|
loop_offset=0.0
|
||||||
bpm=0
|
bpm=0.0
|
||||||
beat_count=0
|
beat_count=0
|
||||||
bar_beats=4
|
bar_beats=4
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/forest_phase_1.ogg-6fd2e255642e47e98a5560b5a2
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
loop=true
|
loop=true
|
||||||
loop_offset=0
|
loop_offset=0.0
|
||||||
bpm=0
|
bpm=0.0
|
||||||
beat_count=0
|
beat_count=0
|
||||||
bar_beats=4
|
bar_beats=4
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/forest_phase_2.ogg-1497e4a80f7f2adb0670888710
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
loop=true
|
loop=true
|
||||||
loop_offset=0
|
loop_offset=0.0
|
||||||
bpm=0
|
bpm=0.0
|
||||||
beat_count=0
|
beat_count=0
|
||||||
bar_beats=4
|
bar_beats=4
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/forest_waiting.ogg-b3b1041d32126973edfe0a5259
|
|||||||
[params]
|
[params]
|
||||||
|
|
||||||
loop=true
|
loop=true
|
||||||
loop_offset=0
|
loop_offset=0.0
|
||||||
bpm=0
|
bpm=0.0
|
||||||
beat_count=0
|
beat_count=0
|
||||||
bar_beats=4
|
bar_beats=4
|
||||||
|
|||||||
@@ -46,15 +46,6 @@ stream_0 = ExtResource("2_tuvql")
|
|||||||
stream_1 = ExtResource("3_7uv4r")
|
stream_1 = ExtResource("3_7uv4r")
|
||||||
stream_2 = ExtResource("4_tuvql")
|
stream_2 = ExtResource("4_tuvql")
|
||||||
|
|
||||||
[sub_resource type="AudioStreamPlaylist" id="AudioStreamPlaylist_ajci6"]
|
|
||||||
stream_count = 6
|
|
||||||
stream_0 = ExtResource("5_ajci6")
|
|
||||||
stream_1 = ExtResource("4_2fduo")
|
|
||||||
stream_2 = ExtResource("11_ngi21")
|
|
||||||
stream_3 = ExtResource("9_am7i4")
|
|
||||||
stream_4 = ExtResource("10_tq535")
|
|
||||||
stream_5 = ExtResource("12_xmumj")
|
|
||||||
|
|
||||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_kfbah"]
|
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_kfbah"]
|
||||||
|
|
||||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_1w04j"]
|
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_1w04j"]
|
||||||
@@ -93,31 +84,53 @@ stream_7/stream = ExtResource("36_4sa2t")
|
|||||||
process_mode = 3
|
process_mode = 3
|
||||||
script = ExtResource("1_0tvca")
|
script = ExtResource("1_0tvca")
|
||||||
|
|
||||||
[node name="Ambiance" type="Node" parent="." unique_id=1989991562]
|
[node name="Ambiances" type="Node" parent="." unique_id=1989991562]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
||||||
[node name="Exterior" type="AudioStreamPlayer" parent="Ambiance" unique_id=1405716780]
|
[node name="Exterior" type="AudioStreamPlayer" parent="Ambiances" unique_id=1405716780]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
stream = SubResource("AudioStreamPlaylist_8204s")
|
stream = SubResource("AudioStreamPlaylist_8204s")
|
||||||
|
|
||||||
[node name="Astra" type="AudioStreamPlayer" parent="Ambiance" unique_id=1244577212]
|
[node name="Astra" type="AudioStreamPlayer" parent="Ambiances" unique_id=1244577212]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
stream = ExtResource("5_8204s")
|
stream = ExtResource("5_8204s")
|
||||||
|
|
||||||
[node name="Demeter" type="AudioStreamPlayer" parent="Ambiance" unique_id=351918026]
|
[node name="Demeter" type="AudioStreamPlayer" parent="Ambiances" unique_id=351918026]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
stream = ExtResource("6_8204s")
|
stream = ExtResource("6_8204s")
|
||||||
|
|
||||||
[node name="Borea" type="AudioStreamPlayer" parent="Ambiance" unique_id=1857904648]
|
[node name="Borea" type="AudioStreamPlayer" parent="Ambiances" unique_id=1857904648]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
stream = ExtResource("7_spekb")
|
stream = ExtResource("7_spekb")
|
||||||
|
|
||||||
[node name="Musics" type="Node" parent="." unique_id=1450527710]
|
[node name="Musics" type="Node" parent="." unique_id=1450527710]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
||||||
[node name="Region" type="AudioStreamPlayer" parent="Musics" unique_id=1029114070]
|
[node name="RegionForestPhase1" type="AudioStreamPlayer" parent="Musics" unique_id=1029114070]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
stream = SubResource("AudioStreamPlaylist_ajci6")
|
stream = ExtResource("9_am7i4")
|
||||||
|
|
||||||
|
[node name="RegionForestPhase2" type="AudioStreamPlayer" parent="Musics" unique_id=417543634]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
stream = ExtResource("10_tq535")
|
||||||
|
|
||||||
|
[node name="RegionMinePhase1" type="AudioStreamPlayer" parent="Musics" unique_id=152032267]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
stream = ExtResource("5_ajci6")
|
||||||
|
|
||||||
|
[node name="RegionMinePhase2" type="AudioStreamPlayer" parent="Musics" unique_id=348001141]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
stream = ExtResource("4_2fduo")
|
||||||
|
|
||||||
|
[node name="RegionForestLoop" type="AudioStreamPlayer" parent="Musics" unique_id=482654512]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
stream = ExtResource("12_xmumj")
|
||||||
|
bus = &"Music"
|
||||||
|
|
||||||
|
[node name="RegionMineLoop" type="AudioStreamPlayer" parent="Musics" unique_id=814165127]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
stream = ExtResource("11_ngi21")
|
||||||
|
bus = &"Music"
|
||||||
|
|
||||||
[node name="Title" type="AudioStreamPlayer" parent="Musics" unique_id=2105759422]
|
[node name="Title" type="AudioStreamPlayer" parent="Musics" unique_id=2105759422]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
@@ -1,19 +1,207 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
class_name AudioManagerInstance
|
||||||
|
|
||||||
const MIN_VOLUME = -60.
|
const MIN_VOLUME = -60.
|
||||||
const MAX_VOLUME = 24.
|
const MAX_VOLUME = 24.
|
||||||
|
|
||||||
const DEFAULT_FADE_TIME : float = 0.5
|
const DEFAULT_FADE_TIME : float = 0.5
|
||||||
|
|
||||||
|
const REGION_FIRST_PHASE = [
|
||||||
|
"RegionForestPhase1",
|
||||||
|
"RegionForestPhase2",
|
||||||
|
"RegionMinePhase1",
|
||||||
|
"RegionMinePhase2"
|
||||||
|
]
|
||||||
|
|
||||||
|
const REGION_LOOP_PHASE = [
|
||||||
|
"RegionForestLoop",
|
||||||
|
"RegionForestLoop",
|
||||||
|
"RegionMineLoop",
|
||||||
|
"RegionMineLoop"
|
||||||
|
]
|
||||||
|
|
||||||
@onready var settings : SettingsData = GameInfo.settings_data
|
@onready var settings : SettingsData = GameInfo.settings_data
|
||||||
|
|
||||||
var music_action : AudioAction
|
var music_actions : Array[AudioAction]
|
||||||
var ambiance_action : AudioAction
|
var ambiance_actions : Array[AudioAction]
|
||||||
var playing_music : AudioStreamPlayer = null
|
var playing_musics : Array[String] = []
|
||||||
var playing_ambiance : AudioStreamPlayer = null
|
var playing_ambiances : Array[String] = []
|
||||||
|
|
||||||
var default_volumes := {}
|
var default_volumes := {}
|
||||||
|
|
||||||
|
# ----------------- Partie Fonctionnelle ----------------
|
||||||
|
|
||||||
|
# Fonction s'exécutant à chaque changement de scène
|
||||||
|
func _on_change_scene(scene : Scene):
|
||||||
|
stop_all_ambiances()
|
||||||
|
|
||||||
|
match scene.scene_id:
|
||||||
|
"TITLE":
|
||||||
|
play_music_alone("Title", false, 0.0)
|
||||||
|
"INTRO":
|
||||||
|
stop_all_musics()
|
||||||
|
"REGION":
|
||||||
|
play_ambiance("Exterior")
|
||||||
|
var region_level = GameInfo.game_data.current_region_data.region_level
|
||||||
|
var first_phase = REGION_FIRST_PHASE[region_level % len(REGION_FIRST_PHASE)]
|
||||||
|
var loop_phase = REGION_LOOP_PHASE[region_level % len(REGION_LOOP_PHASE)]
|
||||||
|
print(first_phase)
|
||||||
|
play_music_alone(first_phase)
|
||||||
|
queue_music(loop_phase, first_phase)
|
||||||
|
"COCKPIT":
|
||||||
|
play_music_alone("Ship", true)
|
||||||
|
"ASTRA":
|
||||||
|
stop_all_musics()
|
||||||
|
play_ambiance_alone("Astra")
|
||||||
|
"GARAGE":
|
||||||
|
stop_all_musics()
|
||||||
|
"BOREA":
|
||||||
|
stop_all_musics()
|
||||||
|
play_ambiance_alone("Borea")
|
||||||
|
|
||||||
|
# Fonction s'exécutant à chaque début de timeline
|
||||||
|
func _on_timeline_started():
|
||||||
|
var timeline_name = Dialogic.current_timeline.resource_path.split("/")[-1].trim_suffix(".dtl")
|
||||||
|
change_ambiances_volume(-10)
|
||||||
|
|
||||||
|
match timeline_name:
|
||||||
|
"demeter_astra_failed":
|
||||||
|
play_ambiance("Demeter")
|
||||||
|
"demeter_ship_presentation":
|
||||||
|
play_ambiance("Demeter")
|
||||||
|
"demeter_intro":
|
||||||
|
play_ambiance("Demeter")
|
||||||
|
"demeter_post_tutorial":
|
||||||
|
play_ambiance("Demeter")
|
||||||
|
"failure":
|
||||||
|
play_ambiance("Demeter")
|
||||||
|
|
||||||
|
# Fonction s'exécutant à chaque fin de timeline
|
||||||
|
func _on_timeline_ended():
|
||||||
|
if SceneManager.actual_scene:
|
||||||
|
change_ambiances_volume()
|
||||||
|
_on_change_scene(SceneManager.actual_scene)
|
||||||
|
|
||||||
|
# Joue la musique définie par player_name, arrête toute les autres musiques immédiatement
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot sous la node Musics à jouer
|
||||||
|
# - from_random_time : joue depuis un temps aléatoire (true) ou non (false)
|
||||||
|
# - fade_time : durée du fondu d'arrivée
|
||||||
|
func play_music_alone(
|
||||||
|
player_name : String = "",
|
||||||
|
from_random_time := false,
|
||||||
|
fade_time := DEFAULT_FADE_TIME
|
||||||
|
):
|
||||||
|
stop_all_musics()
|
||||||
|
play_music(player_name,from_random_time,fade_time)
|
||||||
|
|
||||||
|
# Joue la musique définie par player_name
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot sous la node Musics à jouer
|
||||||
|
# - from_random_time : joue depuis un temps aléatoire (true) ou non (false)
|
||||||
|
# - fade_time : durée du fondu d'arrivée
|
||||||
|
func play_music(
|
||||||
|
player_name : String = "",
|
||||||
|
from_random_time := false,
|
||||||
|
fade_time := DEFAULT_FADE_TIME
|
||||||
|
):
|
||||||
|
music_actions.append(AudioLaunch.new(
|
||||||
|
player_name,
|
||||||
|
from_random_time,
|
||||||
|
fade_time
|
||||||
|
))
|
||||||
|
|
||||||
|
# Joue la musique définie par player_name juste après la fin de la musique after_player_name, stoppe cette dernière à ce moment
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot sous la node Musics à jouer
|
||||||
|
# - after_player_name : Nom de la Node dans la scène Godot à attendre, puis à stopper
|
||||||
|
# - from_random_time : joue depuis un temps aléatoire (true) ou non (false)
|
||||||
|
# - fade_time : durée du fondu d'arrivée
|
||||||
|
func queue_music(
|
||||||
|
player_name : String,
|
||||||
|
after_player_name : String,
|
||||||
|
from_random_time := false,
|
||||||
|
fade_time := DEFAULT_FADE_TIME
|
||||||
|
):
|
||||||
|
var player : AudioStreamPlayer = get_player_from_node(after_player_name, %Musics)
|
||||||
|
if player:
|
||||||
|
await player.finished
|
||||||
|
music_actions.append(AudioStop.new(after_player_name))
|
||||||
|
music_actions.append(AudioLaunch.new(
|
||||||
|
player_name,
|
||||||
|
from_random_time,
|
||||||
|
fade_time
|
||||||
|
))
|
||||||
|
|
||||||
|
# Stoppe la musique définie par player_name
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot sous la node Musics à jouer
|
||||||
|
# - fade_time : durée du fondu de départ
|
||||||
|
func stop_music(player_name : String, fade := DEFAULT_FADE_TIME):
|
||||||
|
music_actions.append(AudioStop.new(player_name, fade))
|
||||||
|
|
||||||
|
# Stoppe toutes les musiques
|
||||||
|
# - fade_time : durée du fondu de départ
|
||||||
|
func stop_all_musics(fade := DEFAULT_FADE_TIME):
|
||||||
|
music_actions.append(AudioStopAll.new(fade))
|
||||||
|
|
||||||
|
# Joue l'ambiance définie par player_name, arrête toute les autres musiques immédiatement
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot sous la node Ambiances à jouer
|
||||||
|
# - from_random_time : joue depuis un temps aléatoire (true) ou non (false)
|
||||||
|
# - fade_time : durée du fondu d'arrivée
|
||||||
|
func play_ambiance_alone(
|
||||||
|
player_name : String = "",
|
||||||
|
from_random_time := false,
|
||||||
|
fade_time := DEFAULT_FADE_TIME
|
||||||
|
):
|
||||||
|
stop_all_ambiances()
|
||||||
|
play_ambiance(player_name,from_random_time,fade_time)
|
||||||
|
|
||||||
|
# Joue l'ambiance définie par player_name
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot sous la node Ambiances à jouer
|
||||||
|
# - from_random_time : joue depuis un temps aléatoire (true) ou non (false)
|
||||||
|
# - fade_time : durée du fondu d'arrivée
|
||||||
|
func play_ambiance(
|
||||||
|
player_name : String = "",
|
||||||
|
from_random_time := false,
|
||||||
|
fade_time := DEFAULT_FADE_TIME
|
||||||
|
):
|
||||||
|
ambiance_actions.append(AudioLaunch.new(
|
||||||
|
player_name,
|
||||||
|
from_random_time,
|
||||||
|
fade_time
|
||||||
|
))
|
||||||
|
|
||||||
|
# Stoppe l'ambiance définie par player_name
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot sous la node Ambiances à jouer
|
||||||
|
# - fade_time : durée du fondu de départ
|
||||||
|
func stop_ambiance(player_name : String, fade := DEFAULT_FADE_TIME):
|
||||||
|
ambiance_actions.append(AudioStop.new(player_name, fade))
|
||||||
|
|
||||||
|
# Stoppe toutes les ambiances
|
||||||
|
# - fade_time : durée du fondu de départ
|
||||||
|
func stop_all_ambiances(fade := DEFAULT_FADE_TIME):
|
||||||
|
ambiance_actions.append(AudioStopAll.new(fade))
|
||||||
|
|
||||||
|
# Change le volume de toutes les ambiances qui jouent
|
||||||
|
# - db_change : changement du volume en décibel, mettre à 0 pour reset le volume
|
||||||
|
# - fade_time : durée du fondu de départ
|
||||||
|
func change_ambiances_volume(db_change := 0., fade := DEFAULT_FADE_TIME):
|
||||||
|
ambiance_actions.append(
|
||||||
|
AudioChangeVolumeAll.new(
|
||||||
|
db_change,
|
||||||
|
fade
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Joue un
|
||||||
|
# - player_name : Nom de la Node dans la scène Godot à jouer
|
||||||
|
func play_sfx(sfx_name : String):
|
||||||
|
var player := %Sfx.find_child(sfx_name) as AudioStreamPlayer
|
||||||
|
if player:
|
||||||
|
player.play()
|
||||||
|
else:
|
||||||
|
printerr("Sfx %s not found" % sfx_name)
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------- Partie Technique (pas touche Nils ;D) ----------------
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
for player in get_all_players():
|
for player in get_all_players():
|
||||||
player.stop()
|
player.stop()
|
||||||
@@ -28,113 +216,36 @@ func _ready():
|
|||||||
Dialogic.timeline_ended.connect(_on_timeline_ended)
|
Dialogic.timeline_ended.connect(_on_timeline_ended)
|
||||||
|
|
||||||
func _process(_d):
|
func _process(_d):
|
||||||
if music_action:
|
if len(music_actions) > 0:
|
||||||
playing_music = process_audio_action(
|
playing_musics = process_audio_actions_for_node(music_actions, %Musics, playing_musics)
|
||||||
music_action,
|
music_actions = []
|
||||||
%Musics,
|
|
||||||
playing_music
|
if len(ambiance_actions) > 0:
|
||||||
|
playing_ambiances = process_audio_actions_for_node(ambiance_actions, %Ambiances, playing_ambiances)
|
||||||
|
ambiance_actions = []
|
||||||
|
|
||||||
|
func process_audio_actions_for_node(
|
||||||
|
audio_actions : Array[AudioAction],
|
||||||
|
parent_node : Node,
|
||||||
|
current_players: Array[String]
|
||||||
|
):
|
||||||
|
var players : Array[String] = current_players.duplicate()
|
||||||
|
for audio_action in audio_actions:
|
||||||
|
players = audio_action.process(
|
||||||
|
self,
|
||||||
|
parent_node,
|
||||||
|
players
|
||||||
)
|
)
|
||||||
music_action = null
|
return players
|
||||||
|
|
||||||
if ambiance_action:
|
|
||||||
playing_ambiance = process_audio_action(
|
|
||||||
ambiance_action,
|
|
||||||
%Ambiance,
|
|
||||||
playing_ambiance
|
|
||||||
)
|
|
||||||
ambiance_action = null
|
|
||||||
|
|
||||||
func process_audio_action(
|
func get_player_from_node(player_name : String, parent_node : Node) -> AudioStreamPlayer:
|
||||||
audio_action : AudioAction,
|
var player = parent_node.find_child(player_name)
|
||||||
player_search_node: Node,
|
|
||||||
current_player: AudioStreamPlayer = null
|
|
||||||
) -> AudioStreamPlayer:
|
|
||||||
if audio_action is AudioLaunch:
|
|
||||||
return process_audio_launch(audio_action, player_search_node, current_player)
|
|
||||||
elif audio_action is AudioStop and current_player and current_player.playing:
|
|
||||||
stop_player(current_player)
|
|
||||||
|
|
||||||
return null
|
|
||||||
|
|
||||||
func process_audio_launch(
|
|
||||||
audio_launch : AudioLaunch,
|
|
||||||
player_search_node: Node,
|
|
||||||
current_player: AudioStreamPlayer = null,
|
|
||||||
) -> AudioStreamPlayer:
|
|
||||||
var player = player_search_node.find_child(audio_launch.player_name)
|
|
||||||
if not player:
|
if not player:
|
||||||
printerr("Player %s not found in category %s" % [audio_launch.player_name, player_search_node.name])
|
printerr("Player %s not found in category %s" % [player_name, parent_node.name])
|
||||||
return null
|
return null
|
||||||
if current_player and current_player.playing and current_player.name == audio_launch.player_name:
|
|
||||||
return current_player
|
|
||||||
elif current_player:
|
|
||||||
stop_player(current_player)
|
|
||||||
|
|
||||||
start_player(player, audio_launch.from_random_time, audio_launch.fade_time)
|
|
||||||
return player
|
return player
|
||||||
|
|
||||||
func _on_change_scene(scene : Scene):
|
|
||||||
stop_ambiance()
|
|
||||||
|
|
||||||
match scene.scene_id:
|
|
||||||
"TITLE":
|
|
||||||
play_music("Title", false, 0.0)
|
|
||||||
"INTRO":
|
|
||||||
stop_music()
|
|
||||||
"REGION":
|
|
||||||
play_music("Region", true)
|
|
||||||
play_ambiance("Exterior")
|
|
||||||
"COCKPIT":
|
|
||||||
play_music("Ship")
|
|
||||||
"ASTRA":
|
|
||||||
stop_music()
|
|
||||||
play_ambiance("Astra")
|
|
||||||
"GARAGE":
|
|
||||||
stop_music()
|
|
||||||
"BOREA":
|
|
||||||
stop_music()
|
|
||||||
play_ambiance("Borea")
|
|
||||||
|
|
||||||
func _on_timeline_started():
|
|
||||||
var timeline_name = Dialogic.current_timeline.resource_path.split("/")[-1].trim_suffix(".dtl")
|
|
||||||
stop_ambiance()
|
|
||||||
|
|
||||||
match timeline_name:
|
|
||||||
"demeter_astra_failed":
|
|
||||||
play_ambiance("Demeter")
|
|
||||||
"demeter_ship_presentation":
|
|
||||||
play_ambiance("Demeter")
|
|
||||||
"demeter_intro":
|
|
||||||
play_ambiance("Demeter")
|
|
||||||
"demeter_post_tutorial":
|
|
||||||
play_ambiance("Demeter")
|
|
||||||
"failure":
|
|
||||||
play_ambiance("Demeter")
|
|
||||||
|
|
||||||
func _on_timeline_ended():
|
|
||||||
if SceneManager.actual_scene:
|
|
||||||
_on_change_scene(SceneManager.actual_scene)
|
|
||||||
|
|
||||||
func play_music(player_name : String = "", from_random_time := false, fade_time := DEFAULT_FADE_TIME):
|
|
||||||
music_action = AudioLaunch.new(
|
|
||||||
player_name,
|
|
||||||
from_random_time,
|
|
||||||
fade_time
|
|
||||||
)
|
|
||||||
|
|
||||||
func stop_music():
|
|
||||||
music_action = AudioStop.new()
|
|
||||||
|
|
||||||
func play_ambiance(player_name : String = "", from_random_time := false, fade_time := DEFAULT_FADE_TIME):
|
|
||||||
ambiance_action = AudioLaunch.new(
|
|
||||||
player_name,
|
|
||||||
from_random_time,
|
|
||||||
fade_time
|
|
||||||
)
|
|
||||||
|
|
||||||
func stop_ambiance():
|
|
||||||
ambiance_action = AudioStop.new()
|
|
||||||
|
|
||||||
func fetch_default_volumes():
|
func fetch_default_volumes():
|
||||||
var all_players := get_all_players()
|
var all_players := get_all_players()
|
||||||
|
|
||||||
@@ -147,7 +258,7 @@ func setup_players_bus():
|
|||||||
player.bus = (AudioServer.get_bus_name(SettingsData.MUSIC_BUS_ID))
|
player.bus = (AudioServer.get_bus_name(SettingsData.MUSIC_BUS_ID))
|
||||||
elif player.get_parent() == %Sfx:
|
elif player.get_parent() == %Sfx:
|
||||||
player.bus = (AudioServer.get_bus_name(SettingsData.SFX_BUS_ID))
|
player.bus = (AudioServer.get_bus_name(SettingsData.SFX_BUS_ID))
|
||||||
elif player.get_parent() == %Ambiance:
|
elif player.get_parent() == %Ambiances:
|
||||||
player.bus = (AudioServer.get_bus_name(SettingsData.AMBIANCE_BUS_ID))
|
player.bus = (AudioServer.get_bus_name(SettingsData.AMBIANCE_BUS_ID))
|
||||||
|
|
||||||
func get_volume(player : AudioStreamPlayer) -> float:
|
func get_volume(player : AudioStreamPlayer) -> float:
|
||||||
@@ -156,12 +267,12 @@ func get_volume(player : AudioStreamPlayer) -> float:
|
|||||||
func get_all_players() -> Array[AudioStreamPlayer]:
|
func get_all_players() -> Array[AudioStreamPlayer]:
|
||||||
var players : Array[AudioStreamPlayer] = []
|
var players : Array[AudioStreamPlayer] = []
|
||||||
players.append_array(get_players_from_node(%Musics))
|
players.append_array(get_players_from_node(%Musics))
|
||||||
players.append_array(get_players_from_node(%Ambiance))
|
players.append_array(get_players_from_node(%Ambiances))
|
||||||
players.append_array(get_players_from_node(%Sfx))
|
players.append_array(get_players_from_node(%Sfx))
|
||||||
|
|
||||||
return players
|
return players
|
||||||
|
|
||||||
func get_players_from_node(node : Node) -> Array[AudioStreamPlayer]:
|
static func get_players_from_node(node : Node) -> Array[AudioStreamPlayer]:
|
||||||
var streams : Array[AudioStreamPlayer] = []
|
var streams : Array[AudioStreamPlayer] = []
|
||||||
|
|
||||||
for c in node.get_children():
|
for c in node.get_children():
|
||||||
@@ -196,31 +307,108 @@ func stop_player(player : AudioStreamPlayer, fade_time = DEFAULT_FADE_TIME):
|
|||||||
func reset_volume(player : AudioStreamPlayer):
|
func reset_volume(player : AudioStreamPlayer):
|
||||||
player.volume_db = get_volume(player)
|
player.volume_db = get_volume(player)
|
||||||
|
|
||||||
func play_sfx(sfx_name : String):
|
@abstract class AudioAction:
|
||||||
print(sfx_name)
|
|
||||||
var player := %Sfx.find_child(sfx_name) as AudioStreamPlayer
|
|
||||||
if player:
|
|
||||||
player.play()
|
|
||||||
else:
|
|
||||||
printerr("Sfx %s not found" % sfx_name)
|
|
||||||
|
|
||||||
class AudioAction:
|
@abstract func process(
|
||||||
pass
|
manager: AudioManagerInstance,
|
||||||
|
parent_node : Node,
|
||||||
|
current_players : Array[String]
|
||||||
|
) -> Array[String]
|
||||||
|
|
||||||
class AudioLaunch extends AudioAction:
|
class AudioLaunch extends AudioAction:
|
||||||
var player_name : String
|
var player_name : String
|
||||||
var from_random_time : bool
|
var from_random_time : bool
|
||||||
var fade_time : float
|
var fade_time : float
|
||||||
|
var alone : bool
|
||||||
|
|
||||||
func _init(
|
func _init(
|
||||||
_player_name : String,
|
_player_name : String,
|
||||||
_from_random_time := false,
|
_from_random_time := false,
|
||||||
_fade_time := DEFAULT_FADE_TIME,
|
_fade_time := DEFAULT_FADE_TIME,
|
||||||
|
_alone := true,
|
||||||
):
|
):
|
||||||
player_name = _player_name
|
player_name = _player_name
|
||||||
from_random_time = _from_random_time
|
from_random_time = _from_random_time
|
||||||
fade_time = _fade_time
|
fade_time = _fade_time
|
||||||
|
|
||||||
|
func process(
|
||||||
|
manager: AudioManagerInstance,
|
||||||
|
parent_node : Node,
|
||||||
|
current_players : Array[String]
|
||||||
|
) -> Array[String]:
|
||||||
|
print("%s Launching %s" % [parent_node.name, player_name])
|
||||||
|
var player = manager.get_player_from_node(player_name,parent_node)
|
||||||
|
if player and not player in current_players:
|
||||||
|
manager.start_player(player, from_random_time, fade_time)
|
||||||
|
current_players.append(player_name)
|
||||||
|
return current_players
|
||||||
|
|
||||||
class AudioStop extends AudioAction:
|
class AudioStop extends AudioAction:
|
||||||
pass
|
var player_name : String
|
||||||
|
var fade_time : float
|
||||||
|
|
||||||
|
func _init(
|
||||||
|
_player_name : String,
|
||||||
|
_fade_time := DEFAULT_FADE_TIME,
|
||||||
|
):
|
||||||
|
player_name = _player_name
|
||||||
|
fade_time = fade_time
|
||||||
|
|
||||||
|
func process(
|
||||||
|
manager: AudioManagerInstance,
|
||||||
|
parent_node : Node,
|
||||||
|
current_players : Array[String]
|
||||||
|
) -> Array[String]:
|
||||||
|
print("%s Stopping %s" % [parent_node.name, player_name])
|
||||||
|
var player = manager.get_player_from_node(player_name,parent_node)
|
||||||
|
if player and player in current_players:
|
||||||
|
manager.stop_player(player, fade_time)
|
||||||
|
current_players.erase(player_name)
|
||||||
|
return current_players
|
||||||
|
|
||||||
|
class AudioStopAll extends AudioAction:
|
||||||
|
var fade_time : float
|
||||||
|
|
||||||
|
func _init(
|
||||||
|
_fade_time := DEFAULT_FADE_TIME,
|
||||||
|
):
|
||||||
|
fade_time = fade_time
|
||||||
|
|
||||||
|
func process(
|
||||||
|
manager: AudioManagerInstance,
|
||||||
|
parent_node : Node,
|
||||||
|
current_players : Array[String]
|
||||||
|
) -> Array[String]:
|
||||||
|
print("%s Stopping All" % parent_node.name)
|
||||||
|
for player_name in current_players:
|
||||||
|
var player := manager.get_player_from_node(player_name,parent_node)
|
||||||
|
if player:
|
||||||
|
manager.stop_player(player, fade_time)
|
||||||
|
return []
|
||||||
|
|
||||||
|
class AudioChangeVolumeAll extends AudioAction:
|
||||||
|
var db_change : float
|
||||||
|
var fade_time : float
|
||||||
|
|
||||||
|
func _init(
|
||||||
|
_db_change := 1.0,
|
||||||
|
_fade_time := DEFAULT_FADE_TIME,
|
||||||
|
):
|
||||||
|
db_change = _db_change
|
||||||
|
fade_time = fade_time
|
||||||
|
|
||||||
|
func process(
|
||||||
|
manager: AudioManagerInstance,
|
||||||
|
parent_node : Node,
|
||||||
|
current_players : Array[String]
|
||||||
|
) -> Array[String]:
|
||||||
|
print("%d Change volume all" % parent_node.name)
|
||||||
|
for player_name in current_players:
|
||||||
|
var player := manager.get_player_from_node(player_name,parent_node)
|
||||||
|
if player:
|
||||||
|
manager.set_volume(
|
||||||
|
player,
|
||||||
|
manager.get_volume(player) + db_change,
|
||||||
|
fade_time
|
||||||
|
)
|
||||||
|
return current_players
|
||||||
|
|||||||
16
common/steam_connection/steam_connection.gd
Normal file
16
common/steam_connection/steam_connection.gd
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
const APP_ID = "4452760"
|
||||||
|
|
||||||
|
func _init():
|
||||||
|
OS.set_environment("SteamAppID", APP_ID)
|
||||||
|
OS.set_environment("SteamGameID", APP_ID)
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
Steam.steamInit()
|
||||||
|
|
||||||
|
var is_running = Steam.isSteamRunning()
|
||||||
|
|
||||||
|
if !is_running:
|
||||||
|
printerr("Steam is not running")
|
||||||
|
return
|
||||||
1
common/steam_connection/steam_connection.gd.uid
Normal file
1
common/steam_connection/steam_connection.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bq12bubjof2mo
|
||||||
@@ -11,12 +11,12 @@ demeter: I found you a new body, and a new ship is waiting you outside, but I'm
|
|||||||
demeter: Do you need some advices ? #id:26
|
demeter: Do you need some advices ? #id:26
|
||||||
- No I'm ok ! #id:27
|
- No I'm ok ! #id:27
|
||||||
- Can I have back some explanations on how all of this works ? #id:28
|
- Can I have back some explanations on how all of this works ? #id:28
|
||||||
demeter: When you emerge from this building, you'll arrive in a little yellow zone. Its a [b]fertile zone[/b], created by the return of the Talion. This is in this zone and only there were you can plant. #id:29
|
demeter: When you emerge from this building, you'll arrive in a little yellow zone. Its a [b]fertile zone[/b], created by the return of the Talion. This is in this zone and only there where you can plant. #id:29
|
||||||
demeter: Then you'll have to get seeds. For that, nothing more simple, you take your shovel tool, and you smash some stones ! Preferably those with yellow cristals on it, it's the [b]Talion veins[/b] . #id:2a
|
demeter: Then you'll have to get seeds. For that, nothing more simple, you take your shovel tool, and you smash some stones ! Preferably those with yellow cristals on it, it's the [b]Talion veins[/b] . #id:2a
|
||||||
demeter: Each time you use a tool or plant a seed, you'll spend an [b]energy[/b]. When your out of it, you can just go recharge on the [b]recharge station[/b] you'll find near the entrance. Each time you recharge, time will pass. One day in fact (yes, you don't have a good battery), and the plants will grow ! #id:2b
|
demeter: Each time you use a tool or plant a seed, you'll spend an [b]energy[/b]. When your out of it, you can just go recharge on the [b]recharge station[/b] you'll find near the entrance. Each time you recharge, time will pass. One day in fact (yes, you don't have a good battery), and the plants will grow ! #id:2b
|
||||||
demeter: You have to obtain enough [b]plant points[/b]. Each plant give one or more [b]plant points[/b] when mature. #id:2c
|
demeter: You have to obtain enough [b]plant points[/b]. Each plant give one or more [b]plant points[/b] when mature. #id:2c
|
||||||
demeter: And yes, I almost forgot ! Some plants gain [b]mutations[/b] that can affect their points or behavior. You can get these mutations on new seeds by harvesting, and gain better ones ! But you'll have to wait the plants to die, or smashing them with your shovel when mature. #id:2d
|
demeter: And yes, I almost forgot ! Some plants gain [b]mutations[/b] that can affect their points or behavior. You can get these mutations on new seeds by harvesting, and gain better ones ! But you'll have to wait the plants to die, or smashing them with your shovel when mature. #id:2d
|
||||||
demeter: Hope I helped ! #id:2e
|
demeter: Hope I helped ! #id:2e
|
||||||
demeter: I send you the elevator, see you soon ! #id:2f
|
demeter: I sent you the elevator, see you soon ! #id:2f
|
||||||
audio "res://common/audio_manager/assets/sfx/dialogs/sfx/closing_transmission.wav"
|
audio "res://common/audio_manager/assets/sfx/dialogs/sfx/closing_transmission.wav"
|
||||||
[wait time="2.0"]
|
[wait time="2.0"]
|
||||||
@@ -24,7 +24,7 @@ demeter: Humans had one big problem. Together, they built great things, but some
|
|||||||
demeter: I prefer not talk about that for now... But don't worry, they can't wound this planet anymore. #id:75
|
demeter: I prefer not talk about that for now... But don't worry, they can't wound this planet anymore. #id:75
|
||||||
- What happened ? #id:76
|
- What happened ? #id:76
|
||||||
demeter: Sorry my child, I'm not ready to talk about that for now... You'll have your answers when you meet me. #id:77
|
demeter: Sorry my child, I'm not ready to talk about that for now... You'll have your answers when you meet me. #id:77
|
||||||
- Can I now what is this shiny engine just in front of me ? #id:78
|
- Can I know what is this shiny engine just in front of me ? #id:78
|
||||||
demeter: This machine in front of you is a planetary ship ! The model's name is the [color=#FFA617]Internode[/color], and I tweaked it to recharge on vegetal energy ! However, as you may know, this energy isn't very present around this planet. But let's continue on board, shall we ? #id:79
|
demeter: This machine in front of you is a planetary ship ! The model's name is the [color=#FFA617]Internode[/color], and I tweaked it to recharge on vegetal energy ! However, as you may know, this energy isn't very present around this planet. But let's continue on board, shall we ? #id:79
|
||||||
audio "res://common/audio_manager/assets/sfx/dialogs/sfx/closing_transmission.wav"
|
audio "res://common/audio_manager/assets/sfx/dialogs/sfx/closing_transmission.wav"
|
||||||
[wait time="2.0"]
|
[wait time="2.0"]
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
@tool
|
|
||||||
extends Node2D
|
|
||||||
|
|
||||||
|
|
||||||
@export var color_1_texture : Texture
|
|
||||||
@export var color_2_texture : Texture
|
|
||||||
@export var outline_texture : Texture
|
|
||||||
|
|
||||||
@export_tool_button("Redraw", "Callable") var redraw_action = func(): create_image()
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
create_image()
|
|
||||||
|
|
||||||
func create_image():
|
|
||||||
|
|
||||||
var image := Image.create(TEXTURE_SIZE,TEXTURE_SIZE, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if color_2_texture:
|
|
||||||
var color_2_image = color_2_texture.get_image()
|
|
||||||
color_2_image.resize(TEXTURE_SIZE,TEXTURE_SIZE)
|
|
||||||
|
|
||||||
image.blend_rect(
|
|
||||||
modulated_image(color_2_image, COLOR_PALETTE.pick_random()),
|
|
||||||
Rect2i(0,0,TEXTURE_SIZE,TEXTURE_SIZE),
|
|
||||||
Vector2i.ZERO
|
|
||||||
)
|
|
||||||
if color_1_texture:
|
|
||||||
var color_1_image = color_1_texture.get_image()
|
|
||||||
color_1_image.resize(TEXTURE_SIZE,TEXTURE_SIZE)
|
|
||||||
image.blend_rect(
|
|
||||||
modulated_image(color_1_image, COLOR_PALETTE.pick_random()),
|
|
||||||
Rect2i(0,0,TEXTURE_SIZE,TEXTURE_SIZE),
|
|
||||||
Vector2i.ZERO
|
|
||||||
)
|
|
||||||
if outline_texture:
|
|
||||||
var outline_image = outline_texture.get_image()
|
|
||||||
outline_image.resize(TEXTURE_SIZE,TEXTURE_SIZE)
|
|
||||||
image.blend_rect(outline_image, Rect2i(0,0,TEXTURE_SIZE,TEXTURE_SIZE),Vector2i.ZERO)
|
|
||||||
|
|
||||||
ImageTexture.create_from_image(image)
|
|
||||||
|
|
||||||
func modulated_image(i : Image, color : Color) -> Image:
|
|
||||||
var ret = i.duplicate()
|
|
||||||
for x in i.get_size().x:
|
|
||||||
for y in i.get_size().y:
|
|
||||||
ret.set_pixel(x,y, i.get_pixel(x,y)*color)
|
|
||||||
return ret
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://by1m5q6q53xxp
|
|
||||||
BIN
entities/player/assets/sprites/movement_particles.png
Normal file
BIN
entities/player/assets/sprites/movement_particles.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
40
entities/player/assets/sprites/movement_particles.png.import
Normal file
40
entities/player/assets/sprites/movement_particles.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dompaj451gklw"
|
||||||
|
path="res://.godot/imported/movement_particles.png-73ae8918518d662da464b8dc83b128a2.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://entities/player/assets/sprites/movement_particles.png"
|
||||||
|
dest_files=["res://.godot/imported/movement_particles.png-73ae8918518d662da464b8dc83b128a2.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 850 KiB After Width: | Height: | Size: 1.4 MiB |
BIN
entities/player/assets/sprites/shadow.png
Normal file
BIN
entities/player/assets/sprites/shadow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 980 B |
40
entities/player/assets/sprites/shadow.png.import
Normal file
40
entities/player/assets/sprites/shadow.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://ys5fis3gsnoy"
|
||||||
|
path="res://.godot/imported/shadow.png-2953b62e89f155ac07f4529236b51b5f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://entities/player/assets/sprites/shadow.png"
|
||||||
|
dest_files=["res://.godot/imported/shadow.png-2953b62e89f155ac07f4529236b51b5f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
[gd_scene load_steps=8 format=3 uid="uid://bgvbgeq46wee2"]
|
[gd_scene format=3 uid="uid://bgvbgeq46wee2"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://das7twcy5153p" path="res://entities/player/scripts/player.gd" id="1_abrql"]
|
[ext_resource type="Script" uid="uid://das7twcy5153p" path="res://entities/player/scripts/player.gd" id="1_abrql"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c7ff87jniga5m" path="res://entities/player/assets/sprites/robot.png" id="1_symyc"]
|
[ext_resource type="Texture2D" uid="uid://dompaj451gklw" path="res://entities/player/assets/sprites/movement_particles.png" id="2_bls4j"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bf6nw4onkhavr" path="res://common/icons/shovel.svg" id="3_yqrof"]
|
[ext_resource type="Texture2D" uid="uid://ys5fis3gsnoy" path="res://entities/player/assets/sprites/shadow.png" id="2_fkugw"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c7ff87jniga5m" path="res://entities/player/assets/sprites/robot.png" id="4_bls4j"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_sglur"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_sglur"]
|
||||||
radius = 27.0
|
radius = 27.0
|
||||||
@@ -10,44 +11,156 @@ radius = 27.0
|
|||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_abrql"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_abrql"]
|
||||||
radius = 40.0
|
radius = 40.0
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_yqrof"]
|
[sub_resource type="Curve" id="Curve_fkugw"]
|
||||||
colors = PackedColorArray(0.145098, 0.423529, 0.635294, 1, 0.12549, 0.294118, 0.545098, 1)
|
_data = [Vector2(0, 0.14473677), 0.0, 0.0, 0, 0, Vector2(0.972549, 0.2654798), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 2
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_3wlsy"]
|
[sub_resource type="Gradient" id="Gradient_bls4j"]
|
||||||
gradient = SubResource("Gradient_yqrof")
|
offsets = PackedFloat32Array(0, 0.77729255, 1)
|
||||||
fill = 1
|
colors = PackedColorArray(0.5803922, 0.7058824, 0.8862745, 1, 0.5785, 0.70829165, 0.89, 1, 0.5785, 0.70829165, 0.89, 0)
|
||||||
fill_from = Vector2(0.5, 0.380342)
|
|
||||||
fill_to = Vector2(1, 0.0726496)
|
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_fkugw"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(3048, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_8fjmc"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(3810, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_qiwj3"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(2286, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_26q78"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(0, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_bectd"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(5334, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_wvtmh"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(762, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_7thud"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(4572, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_a1qjk"]
|
||||||
|
atlas = ExtResource("4_bls4j")
|
||||||
|
region = Rect2(1524, 0, 762, 1080)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_a1qjk"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_fkugw")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"back",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_8fjmc")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"back_left",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_qiwj3")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"back_right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_26q78")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"front",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_bectd")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"front_left",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_wvtmh")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"front_right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_7thud")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"left",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_a1qjk")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"right",
|
||||||
|
"speed": 5.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_bls4j"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_fkugw"]
|
||||||
|
states/StateMachine/node = SubResource("AnimationNodeStateMachine_bls4j")
|
||||||
|
states/StateMachine/position = Vector2(386, 91)
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody2D" unique_id=447849413]
|
||||||
script = ExtResource("1_abrql")
|
script = ExtResource("1_abrql")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=414557251]
|
||||||
position = Vector2(-2, -18)
|
position = Vector2(0, -17)
|
||||||
shape = SubResource("CircleShape2D_sglur")
|
shape = SubResource("CircleShape2D_sglur")
|
||||||
|
|
||||||
[node name="InteractArea2D" type="Area2D" parent="."]
|
[node name="Shadow" type="Sprite2D" parent="." unique_id=875064259]
|
||||||
|
modulate = Color(0, 0, 0, 0.60784316)
|
||||||
|
position = Vector2(-1, 13)
|
||||||
|
scale = Vector2(0.35897446, 0.3589744)
|
||||||
|
texture = ExtResource("2_fkugw")
|
||||||
|
|
||||||
|
[node name="InteractArea2D" type="Area2D" parent="." unique_id=1048722411]
|
||||||
position = Vector2(0, -12)
|
position = Vector2(0, -12)
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D" unique_id=1242017003]
|
||||||
shape = SubResource("CircleShape2D_abrql")
|
shape = SubResource("CircleShape2D_abrql")
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite2D" parent="."]
|
[node name="CPUParticles2D" type="CPUParticles2D" parent="InteractArea2D" unique_id=1489736082]
|
||||||
position = Vector2(0, -46)
|
position = Vector2(-8.4703295e-22, 12)
|
||||||
scale = Vector2(0.08, 0.08)
|
scale = Vector2(0.22803418, 0.22803418)
|
||||||
texture = ExtResource("1_symyc")
|
amount = 3
|
||||||
|
texture = ExtResource("2_bls4j")
|
||||||
|
lifetime = 0.4
|
||||||
|
gravity = Vector2(0, 100)
|
||||||
|
scale_amount_curve = SubResource("Curve_fkugw")
|
||||||
|
color_ramp = SubResource("Gradient_bls4j")
|
||||||
|
|
||||||
[node name="HideEyes" type="Sprite2D" parent="."]
|
[node name="Sprite" type="AnimatedSprite2D" parent="." unique_id=638545037]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
position = Vector2(0.99999994, -17)
|
||||||
position = Vector2(8.125, -26.195)
|
scale = Vector2(0.0656168, 0.065616846)
|
||||||
scale = Vector2(0.347656, 0.253906)
|
sprite_frames = SubResource("SpriteFrames_a1qjk")
|
||||||
texture = SubResource("GradientTexture2D_3wlsy")
|
animation = &"back"
|
||||||
|
|
||||||
[node name="ItemSprite" type="Sprite2D" parent="."]
|
[node name="FloatAnimationPlayer" type="AnimationPlayer" parent="." unique_id=929823261]
|
||||||
unique_name_in_owner = true
|
|
||||||
visible = false
|
[node name="AnimationTree" type="AnimationTree" parent="." unique_id=563415659]
|
||||||
modulate = Color(0.164706, 0.898039, 0.984314, 1)
|
tree_root = SubResource("AnimationNodeStateMachine_fkugw")
|
||||||
position = Vector2(8.25, -27.32)
|
|
||||||
scale = Vector2(0.403333, 0.403333)
|
|
||||||
texture = ExtResource("3_yqrof")
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class_name Player
|
|||||||
const ACTION_AREA_UPDATE_TIME=0.05 # When creating an action_zone, we make sure that the area setup correctly by waiting a little
|
const ACTION_AREA_UPDATE_TIME=0.05 # When creating an action_zone, we make sure that the area setup correctly by waiting a little
|
||||||
const MAX_REACH = 100
|
const MAX_REACH = 100
|
||||||
const HOLDING_ITEM_SPRITE_SIZE = 20.
|
const HOLDING_ITEM_SPRITE_SIZE = 20.
|
||||||
|
const TURN_ANIMATION_MINIMUM_THRESHOLD = 0.2
|
||||||
|
|
||||||
signal player_updated(player: Player)
|
signal player_updated(player: Player)
|
||||||
signal upgraded
|
signal upgraded
|
||||||
@@ -73,19 +74,8 @@ func _process(delta):
|
|||||||
|
|
||||||
func _on_inventory_updated(_inventory: Inventory):
|
func _on_inventory_updated(_inventory: Inventory):
|
||||||
setup_preview_zone(data.inventory.get_item())
|
setup_preview_zone(data.inventory.get_item())
|
||||||
var item : Item = data.inventory.get_item()
|
|
||||||
if item:
|
|
||||||
var item_texture = item.icon
|
|
||||||
%ItemSprite.texture = item_texture
|
|
||||||
%ItemSprite.scale = Vector2(
|
|
||||||
1./(item_texture.get_width()/HOLDING_ITEM_SPRITE_SIZE),
|
|
||||||
1./(item_texture.get_height()/HOLDING_ITEM_SPRITE_SIZE)
|
|
||||||
)
|
|
||||||
%HideEyes.visible = item != null
|
|
||||||
%ItemSprite.visible = item != null
|
|
||||||
emit_signal("player_updated", self)
|
emit_signal("player_updated", self)
|
||||||
|
|
||||||
|
|
||||||
func calculate_direction():
|
func calculate_direction():
|
||||||
var input_direction: Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
var input_direction: Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||||
|
|
||||||
@@ -102,14 +92,32 @@ func calculate_direction():
|
|||||||
input_direction = self.global_position.direction_to(instruction.position)
|
input_direction = self.global_position.direction_to(instruction.position)
|
||||||
|
|
||||||
velocity = input_direction * speed
|
velocity = input_direction * speed
|
||||||
if input_direction.x:
|
|
||||||
flip_character(input_direction.x > 0)
|
turn_animate(input_direction)
|
||||||
|
|
||||||
|
|
||||||
func flip_character(face_right = true):
|
func turn_animate(input_direction):
|
||||||
$Sprite.flip_h = not face_right
|
if input_direction.x > TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
%ItemSprite.position.x = abs(%ItemSprite.position.x) * (1 if face_right else -1)
|
if input_direction.y > TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
%HideEyes.position.x = abs(%ItemSprite.position.x) * (1 if face_right else -1)
|
%Sprite.play("front_right")
|
||||||
|
elif input_direction.y < -TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
|
%Sprite.play("back_right")
|
||||||
|
else:
|
||||||
|
%Sprite.play("right")
|
||||||
|
elif input_direction.x < -TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
|
if input_direction.y > TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
|
%Sprite.play("front_left")
|
||||||
|
elif input_direction.y < -TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
|
%Sprite.play("back_left")
|
||||||
|
else:
|
||||||
|
%Sprite.play("left")
|
||||||
|
else:
|
||||||
|
if input_direction.y > TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
|
%Sprite.play("front")
|
||||||
|
elif input_direction.y < -TURN_ANIMATION_MINIMUM_THRESHOLD:
|
||||||
|
%Sprite.play("back")
|
||||||
|
else:
|
||||||
|
%Sprite.play("front")
|
||||||
|
|
||||||
func can_interact(interactable : Interactable):
|
func can_interact(interactable : Interactable):
|
||||||
return interactable.can_interact(self)
|
return interactable.can_interact(self)
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ layer = 99
|
|||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=2001966466]
|
[node name="ColorRect" type="ColorRect" parent="." unique_id=2001966466]
|
||||||
material = SubResource("ShaderMaterial_67c4d")
|
material = SubResource("ShaderMaterial_67c4d")
|
||||||
offset_right = 1152.0
|
anchors_preset = 15
|
||||||
offset_bottom = 648.0
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
color = Color(0.0352941, 0.0196078, 0.12549, 0.705882)
|
color = Color(0.0352941, 0.0196078, 0.12549, 0.705882)
|
||||||
|
|||||||
BIN
gui/game/inventory_gui/assets/3d/item_screen.blend
Normal file
BIN
gui/game/inventory_gui/assets/3d/item_screen.blend
Normal file
Binary file not shown.
60
gui/game/inventory_gui/assets/3d/item_screen.blend.import
Normal file
60
gui/game/inventory_gui/assets/3d/item_screen.blend.import
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="scene"
|
||||||
|
importer_version=1
|
||||||
|
type="PackedScene"
|
||||||
|
uid="uid://oktd71knql00"
|
||||||
|
path="res://.godot/imported/item_screen.blend-680308346425c8f7362481f314c364d4.scn"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://gui/game/inventory_gui/assets/3d/item_screen.blend"
|
||||||
|
dest_files=["res://.godot/imported/item_screen.blend-680308346425c8f7362481f314c364d4.scn"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
nodes/root_type=""
|
||||||
|
nodes/root_name=""
|
||||||
|
nodes/root_script=null
|
||||||
|
nodes/apply_root_scale=true
|
||||||
|
nodes/root_scale=1.0
|
||||||
|
nodes/import_as_skeleton_bones=false
|
||||||
|
nodes/use_name_suffixes=true
|
||||||
|
nodes/use_node_type_suffixes=true
|
||||||
|
meshes/ensure_tangents=true
|
||||||
|
meshes/generate_lods=true
|
||||||
|
meshes/create_shadow_meshes=true
|
||||||
|
meshes/light_baking=1
|
||||||
|
meshes/lightmap_texel_size=0.2
|
||||||
|
meshes/force_disable_compression=false
|
||||||
|
skins/use_named_skins=true
|
||||||
|
animation/import=true
|
||||||
|
animation/fps=30
|
||||||
|
animation/trimming=false
|
||||||
|
animation/remove_immutable_tracks=true
|
||||||
|
animation/import_rest_as_RESET=false
|
||||||
|
import_script/path=""
|
||||||
|
materials/extract=0
|
||||||
|
materials/extract_format=0
|
||||||
|
materials/extract_path=""
|
||||||
|
_subresources={}
|
||||||
|
blender/nodes/visible=0
|
||||||
|
blender/nodes/active_collection_only=false
|
||||||
|
blender/nodes/punctual_lights=true
|
||||||
|
blender/nodes/cameras=true
|
||||||
|
blender/nodes/custom_properties=true
|
||||||
|
blender/nodes/modifiers=1
|
||||||
|
blender/meshes/colors=false
|
||||||
|
blender/meshes/uvs=true
|
||||||
|
blender/meshes/normals=true
|
||||||
|
blender/meshes/export_geometry_nodes_instances=false
|
||||||
|
blender/meshes/gpu_instances=false
|
||||||
|
blender/meshes/tangents=true
|
||||||
|
blender/meshes/skins=2
|
||||||
|
blender/meshes/export_bones_deforming_mesh_only=false
|
||||||
|
blender/materials/unpack_enabled=true
|
||||||
|
blender/materials/export_materials=1
|
||||||
|
blender/animation/limit_playback=true
|
||||||
|
blender/animation/always_sample=true
|
||||||
|
blender/animation/group_tracks=true
|
||||||
|
gltf/naming_version=2
|
||||||
@@ -35,6 +35,7 @@ Pause="*res://gui/pause/pause.tscn"
|
|||||||
Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd"
|
Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd"
|
||||||
LoadingScreen="*res://gui/loading_screen/loading_screen.tscn"
|
LoadingScreen="*res://gui/loading_screen/loading_screen.tscn"
|
||||||
SceneManager="*res://common/scene_manager/scene_manager.tscn"
|
SceneManager="*res://common/scene_manager/scene_manager.tscn"
|
||||||
|
SteamConnection="*uid://bq12bubjof2mo"
|
||||||
|
|
||||||
[dialogic]
|
[dialogic]
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ directories/dch_directory={
|
|||||||
directories/dtl_directory={
|
directories/dtl_directory={
|
||||||
"demeter_astra_failed": "res://dialogs/timelines/gameplay_related/demeter_astra_failed.dtl",
|
"demeter_astra_failed": "res://dialogs/timelines/gameplay_related/demeter_astra_failed.dtl",
|
||||||
"demeter_intro": "res://dialogs/timelines/story/demeter_intro.dtl",
|
"demeter_intro": "res://dialogs/timelines/story/demeter_intro.dtl",
|
||||||
|
"demeter_introV2": "res://dialogs/timelines/story/demeter_introV2.dtl",
|
||||||
"demeter_midrun": "res://dialogs/timelines/story/demeter_post_tutorial.dtl",
|
"demeter_midrun": "res://dialogs/timelines/story/demeter_post_tutorial.dtl",
|
||||||
"demeter_outro": "res://dialogs/timelines/story/demeter_outro.dtl",
|
"demeter_outro": "res://dialogs/timelines/story/demeter_outro.dtl",
|
||||||
"demeter_ship_presentation": "res://dialogs/timelines/story/demeter_ship_presentation.dtl",
|
"demeter_ship_presentation": "res://dialogs/timelines/story/demeter_ship_presentation.dtl",
|
||||||
@@ -237,3 +239,10 @@ locale/test="fr"
|
|||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
environment/defaults/default_clear_color=Color(0.0617213, 0.0605653, 0.169189, 1)
|
environment/defaults/default_clear_color=Color(0.0617213, 0.0605653, 0.169189, 1)
|
||||||
|
|
||||||
|
[steam]
|
||||||
|
|
||||||
|
initialization/app_id=0
|
||||||
|
initialization/initialize_on_startup=false
|
||||||
|
initialization/embed_callbacks=false
|
||||||
|
multiplayer_peer/max_channels=4
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ func _ready():
|
|||||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||||
%Credits.show()
|
%Credits.show()
|
||||||
AudioManager.play_music("Title")
|
AudioManager.play_music("Title")
|
||||||
AudioManager.stop_ambiance()
|
AudioManager.stop_all_ambiances()
|
||||||
|
|
||||||
func _on_ambiance_change_detector_body_entered(body: Node3D):
|
func _on_ambiance_change_detector_body_entered(body: Node3D):
|
||||||
if body is Player3D:
|
if body is Player3D:
|
||||||
AudioManager.stop_ambiance()
|
AudioManager.stop_all_ambiances()
|
||||||
AudioManager.play_music("Title")
|
AudioManager.play_music("Title")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user