Compare commits

8 Commits

125 changed files with 1234 additions and 440 deletions

Binary file not shown.

View 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": "" }

View File

@@ -0,0 +1 @@
uid://xa5gtvqdowmw

View 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.

Binary file not shown.

Binary file not shown.

View 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.

View File

@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/main_menu.ogg-45c6ef59eabdc081ad36ff5114035b6
[params]
loop=true
loop_offset=0
bpm=0
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

View File

@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/forest_phase_1.ogg-6fd2e255642e47e98a5560b5a2
[params]
loop=true
loop_offset=0
bpm=0
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

View File

@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/forest_phase_2.ogg-1497e4a80f7f2adb0670888710
[params]
loop=true
loop_offset=0
bpm=0
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

View File

@@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/forest_waiting.ogg-b3b1041d32126973edfe0a5259
[params]
loop=true
loop_offset=0
bpm=0
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

View File

@@ -20,6 +20,7 @@
[ext_resource type="AudioStream" uid="uid://dgkdcq4j6fe3o" path="res://common/audio_manager/assets/sfx/harvest/harvest_2.wav" id="14_b5bgj"]
[ext_resource type="AudioStream" uid="uid://eh3dbuxu5qtw" path="res://common/audio_manager/assets/sfx/harvest/harvest_3.wav" id="15_ynvb4"]
[ext_resource type="AudioStream" uid="uid://bown4yipeef8l" path="res://common/audio_manager/assets/sfx/harvest/harvest_4.wav" id="16_obeji"]
[ext_resource type="AudioStream" uid="uid://delq7gsdeqjq2" path="res://common/audio_manager/assets/sfx/respawn/respawn.wav" id="16_xmumj"]
[ext_resource type="AudioStream" uid="uid://cbo4ld2yypmte" path="res://common/audio_manager/assets/sfx/harvest/harvest_5.wav" id="17_6w0re"]
[ext_resource type="AudioStream" uid="uid://c5nfoa6v3r5f7" path="res://common/audio_manager/assets/sfx/harvest/harvest_6.wav" id="18_o4guq"]
[ext_resource type="AudioStream" uid="uid://bjind1iji0gt7" path="res://common/audio_manager/assets/sfx/pick_up/pick_up_1.wav" id="20_pu6t4"]
@@ -45,15 +46,6 @@ stream_0 = ExtResource("2_tuvql")
stream_1 = ExtResource("3_7uv4r")
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_1w04j"]
@@ -92,31 +84,53 @@ stream_7/stream = ExtResource("36_4sa2t")
process_mode = 3
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
[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
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
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
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
stream = ExtResource("7_spekb")
[node name="Musics" type="Node" parent="." unique_id=1450527710]
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
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]
unique_name_in_owner = true
@@ -134,6 +148,9 @@ unique_name_in_owner = true
[node name="Dig" type="AudioStreamPlayer" parent="Sfx" unique_id=486042600]
stream = SubResource("AudioStreamRandomizer_kfbah")
[node name="Respawn" type="AudioStreamPlayer" parent="Sfx" unique_id=1902559716]
stream = ExtResource("16_xmumj")
[node name="Drop" type="AudioStreamPlayer" parent="Sfx" unique_id=1391500830]
stream = SubResource("AudioStreamRandomizer_1w04j")
@@ -157,7 +174,7 @@ stream = ExtResource("27_0rjel")
[node name="Phone_call" type="AudioStreamPlayer" parent="Sfx" unique_id=1668278453]
stream = ExtResource("28_3dfjn")
[node name="Plant_point" type="AudioStreamPlayer" parent="Sfx" unique_id=2044025024]
[node name="PlantPoint" type="AudioStreamPlayer" parent="Sfx" unique_id=2044025024]
stream = SubResource("AudioStreamRandomizer_qog4c")
[node name="Ship_reveal" type="AudioStreamPlayer" parent="Sfx" unique_id=1121632306]

View File

@@ -1,19 +1,207 @@
extends Node
class_name AudioManagerInstance
const MIN_VOLUME = -60.
const MAX_VOLUME = 24.
const DEFAULT_FADE_TIME : float = 2
const REGION_FIRST_PHASE = [
"RegionForestPhase1",
"RegionForestPhase2",
"RegionMinePhase1",
"RegionMinePhase2"
]
const REGION_LOOP_PHASE = [
"RegionForestLoop",
"RegionForestLoop",
"RegionMineLoop",
"RegionMineLoop"
]
@onready var settings : SettingsData = GameInfo.settings_data
var music_action : AudioAction
var ambiance_action : AudioAction
var playing_music : AudioStreamPlayer = null
var playing_ambiance : AudioStreamPlayer = null
var music_actions : Array[AudioAction]
var ambiance_actions : Array[AudioAction]
var playing_musics : Array[String] = []
var playing_ambiances : Array[String] = []
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():
for player in get_all_players():
player.stop()
@@ -28,114 +216,36 @@ func _ready():
Dialogic.timeline_ended.connect(_on_timeline_ended)
func _process(_d):
if music_action:
playing_music = process_audio_action(
music_action,
%Musics,
playing_music
)
music_action = null
if len(music_actions) > 0:
playing_musics = process_audio_actions_for_node(music_actions, %Musics, playing_musics)
music_actions = []
if ambiance_action:
playing_ambiance = process_audio_action(
ambiance_action,
%Ambiance,
playing_ambiance
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
)
ambiance_action = null
return players
func process_audio_action(
audio_action : AudioAction,
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)
func get_player_from_node(player_name : String, parent_node : Node) -> AudioStreamPlayer:
var player = parent_node.find_child(player_name)
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
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
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()
play_ambiance("Astra")
"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")
"demeter_outro":
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():
var all_players := get_all_players()
@@ -148,7 +258,7 @@ func setup_players_bus():
player.bus = (AudioServer.get_bus_name(SettingsData.MUSIC_BUS_ID))
elif player.get_parent() == %Sfx:
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))
func get_volume(player : AudioStreamPlayer) -> float:
@@ -157,12 +267,12 @@ func get_volume(player : AudioStreamPlayer) -> float:
func get_all_players() -> Array[AudioStreamPlayer]:
var players : Array[AudioStreamPlayer] = []
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))
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] = []
for c in node.get_children():
@@ -197,31 +307,108 @@ func stop_player(player : AudioStreamPlayer, fade_time = DEFAULT_FADE_TIME):
func reset_volume(player : AudioStreamPlayer):
player.volume_db = get_volume(player)
func play_sfx(sfx_name : String):
print(sfx_name)
var player := %Sfx.find_child(sfx_name) as AudioStreamPlayer
if player:
player.play()
else:
printerr("Sfx %s not found" % sfx_name)
@abstract class AudioAction:
class AudioAction:
pass
@abstract func process(
manager: AudioManagerInstance,
parent_node : Node,
current_players : Array[String]
) -> Array[String]
class AudioLaunch extends AudioAction:
var player_name : String
var from_random_time : bool
var fade_time : float
var alone : bool
func _init(
_player_name : String,
_from_random_time := false,
_fade_time := DEFAULT_FADE_TIME,
_alone := true,
):
player_name = _player_name
from_random_time = _from_random_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:
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

View File

@@ -48,11 +48,10 @@ func give_up():
func start_tutorial():
current_region_data = RegionData.new(
RegionParameter.new(
10,
3,
0,
tr("TUTORIAL"),
["tutorial"],
0,
[],
randi()
)
)
)

View File

@@ -5,13 +5,13 @@ enum State {STARTED, IN_PROGRESS, FINISHED}
const RUN_POINT_POSITION_DERIVATION = 100
const DIFFICULTY_INCREASE_BY_LEVEL = 3
const RUN_POINTS_NEXT_NUMBER :Array[int] = [2]
const RUN_POINT_MAX_LEVEL = 0 # TODO
const RUN_POINTS_NEXT_NUMBER : int = 2
const RUN_POINT_MAX_LEVEL = 2 # TODO
signal current_run_point_changed
var run_seed = randi()
@export var next_run_points : Array[RunPoint] = [generate_first_run_point()]
@export var next_run_points : Array[RunPoint] = generate_next_run_points()
@export var current_run_point : RunPoint = null :
set(v):
current_run_point = v
@@ -20,65 +20,28 @@ var run_seed = randi()
#region ------------------ Generation ------------------
func generate_first_run_point() -> RunPoint:
return RunPoint.new(0, RegionParameter.new())
func generate_next_run_points(run_point : RunPoint) -> Array[RunPoint]:
var nb_next_run_points = RUN_POINTS_NEXT_NUMBER.pick_random()
if run_point.level == RUN_POINT_MAX_LEVEL - 1 or run_point.level == -1:
nb_next_run_points = 1
elif run_point.level == RUN_POINT_MAX_LEVEL:
nb_next_run_points = 0
func generate_next_run_points(level = 0) -> Array[RunPoint]:
next_run_points = []
for i in range(nb_next_run_points):
for i in range(RUN_POINTS_NEXT_NUMBER):
next_run_points.append(
generate_next_run_point(run_point)
generate_next_run_point(level)
)
return next_run_points
func generate_next_run_point(run_point : RunPoint) -> RunPoint:
var level = run_point.level + 1
func generate_next_run_point(level = 0) -> RunPoint:
var region_parameter = RegionParameter.new()
region_parameter.level = level
region_parameter.flags = get_region_flags(region_parameter)
region_parameter.region_flags = get_region_flags(region_parameter)
return RunPoint.new(
level,
generate_difficulty_increased_region_parameter(region_parameter, DIFFICULTY_INCREASE_BY_LEVEL * level),
(run_point.position + randi_range(-RUN_POINT_POSITION_DERIVATION, RUN_POINT_POSITION_DERIVATION)) % 360
region_parameter
)
func generate_difficulty_increased_region_parameter(
region_parameter : RegionParameter,
difficulty : int = 1
) -> RegionParameter:
var i_diff := difficulty
var new_region_parameter = RegionParameter.new(
region_parameter.charges,
region_parameter.objective
)
while i_diff > 0:
var available_difficulty_modifier = [
DifficultyDecreaseCharge.new(),
DifficultyIncreaseObjective.new()
].filter(
func (mod : DifficultyModifier):
return mod.get_difficulty_cost() <= i_diff and mod.can_modifiy(new_region_parameter)
)
var selected_difficulty_modifier = available_difficulty_modifier.pick_random()
selected_difficulty_modifier.modify(new_region_parameter)
i_diff -= max(1,selected_difficulty_modifier.get_difficulty_cost())
return new_region_parameter
#endregion
func get_state() -> State:
@@ -99,13 +62,12 @@ func choose_next_run_point(run_point : RunPoint) -> RunPoint:
visited_run_points.append(current_run_point)
current_run_point = run_point
GameInfo.game_data.start_region(run_point.region_parameter)
next_run_points = generate_next_run_points(current_run_point)
next_run_points = generate_next_run_points(current_run_point.level + 1)
return current_run_point
func get_region_flags(region_parameter : RegionParameter) -> Array[String]:
var flags : Array[String] = []
print(region_parameter.level)
if region_parameter.level == RUN_POINT_MAX_LEVEL:
flags.append("borea")
@@ -130,4 +92,4 @@ class DifficultyDecreaseCharge extends DifficultyModifier:
region_parameter.charges -= 1
func can_modifiy(region_parameter : RegionParameter) -> bool:
return region_parameter.charges >= 3
return region_parameter.charges >= 3

View File

@@ -11,12 +11,12 @@ const CHARGE_ICON = preload("res://common/icons/bolt.svg")
@export var region_parameter : RegionParameter = RegionParameter.new() :
set(v):
region_parameter = v
@export var position : int = 0 # Y pos along the planet, 0 to 360
@export var position : float = 0
func _init(
_level : int = 0,
_region_parameter : RegionParameter = RegionParameter.new(),
_position : int = randi_range(0,360),
_position : float = randf_range(0.,1.),
):
level = _level
region_parameter = _region_parameter
@@ -24,7 +24,7 @@ func _init(
position = _position
func card_info() -> CardInfo:
var info = CardInfo.new(region_parameter.name)
var info = CardInfo.new(region_parameter.region_name)
info.important_stat_icon = DANGER_ICON
info.important_stat_text = "%d" % level

View 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

View File

@@ -0,0 +1 @@
uid://bq12bubjof2mo

View File

@@ -0,0 +1,38 @@
audio "res://common/audio_manager/assets/sfx/dialogs/sfx/incoming_transmission.wav"
join demeter center [animation="Bounce In" length="1.0"]
demeter: Hi ![pause=0.3] Phew,[pause=0.2] I thought no one would reply.[pause=0.3] Are you [color=#FFA617]Orchid[/color] ?[pause=0.3] You may not be familiar with this name but you must have seen it in your memory.
- Uh... Who are you ?
demeter: Oh sorry ![pause=0.3] I cannot send you my IDs for now,[pause=0.2] you are too far away from me.
- Where am I ?
demeter: Don't worry,[pause=0.2] you are in a subterranean base,[pause=0.2] but you will get to the surface very soon.
- Wait ! Who am I ?
demeter: Hmmm.[pause=0.4].[pause=0.4].[pause=0.4] Interesting question.[pause=0.3] I elaborated your system but I don't know in which frame you are currently in.[pause=0.3] We'll find out !
demeter: I'm glad you are finally awake ![pause=0.3] To be honest,[pause=0.2] I wasn't sure I would be able to make you function normally.[pause=0.5] Your frame has remained here for millennia without any maintenance.
- Did you create me ?
demeter: Sort of ![pause=0.3] I didn't manufactured your body,[pause=0.2] I borrowed it,[pause=0.2] but I designed your cognitive system.[pause=0.3] Be forgiving,[pause=0.2] it won't be perfect,[pause=0.2] I was designed to manage,[pause=0.2] not to create.
- Why did you awake me ?
demeter: To be honest,[pause=0.2] I don't really know.[pause=0.3].[pause=0.3].[pause=0.3] I mean,[pause=0.2] there are a lot of reasons,[pause=0.2] but I'll tell you more about it later.
- What are you ?
demeter: I'm the same as you.[pause=0.3] The same as all the sentient beings remaining on this planet.[pause=0.3] Robot,[pause=0.2] artificial intelligence,[pause=0.2] machine.[pause=0.2].[pause=0.2].[pause=0.2] Our creators gave us many titles.
demeter: Ok,[pause=0.2] no more questions for now,[pause=0.2] listen to me carefully.
demeter: A long time ago,[pause=0.2] this planet was full of life.[pause=0.3] Plants were thriving on mountains,[pause=0.2] under seas and across plains.
demeter: Now,[pause=0.2] this world is a wasteland.[pause=0.3] You'll see it as soon as you leave this base.
demeter: Something happened a year ago.[pause=0.3].[pause=0.3].[pause=0.3]. The [color=#119758][b]Talion[/b][/color],[pause=0.2] a unique element giving birth to new life forms when shattered,[pause=0.2] reappeared.
demeter: With the [color=#119758][b]Talion[/b][/color] back on the surface,[pause=0.2] we can bring this planet back to life.
demeter: But first things first,[pause=0.2] you have to learn how everything is working up here,[pause=0.2] and how to use the [color=#119758][b]Talion[/b][/color] to plant seeds.
demeter: [b]Just remember the following[/b]
label explanations
demeter: When you'll emerge from this building,[pause=0.2] you will reach a little yellowish zone.[pause=0.3] It's a [b]fertile zone[/b],[pause=0.2] brought back by the [color=#119758][b]Talion's[/b][/color] power.[pause=0.3] You can only plant [b]seeds[/b] in this zone.
demeter: Then,[pause=0.2] you have to get [b]seeds[/b].[pause=0.3] To do so,[pause=0.2] just take your shovel and smash some stones ![pause=0.3] Focus on those having yellow crystals on it,[pause=0.2] these are [color=#119758][b]Talion veins[/b][/color].
demeter: Each time you use a tool like the shovel or plant a seed,[pause=0.2] you will spend one [b]energy[/b] charge.[pause=0.3] When you are out of it,[pause=0.2] just go recharge it at the [b]recharge station[/b].[pause=0.3] You will find it near the entrance of the base.
demeter: Each time you recharge,[pause=0.2] a day will pass,[pause=0.2] your batteries are very inefficient.[pause=0.3] While the day is passing,[pause=0.2] plants will grow !
demeter: To complete you training,[pause=0.2] obtain enough [b]plant points[/b].[pause=0.3] Each plant give one or more [b]plant points[/b] when mature.
demeter: Oh ! [pause=0.3] I almost forgot,[pause=0.2] some plants can [b]mutate[/b].[pause=0.3] These [b]mutations[/b] affect points and behavior of the plant affected.[pause=0.3] [b]Mutations[/b] can appear while [b]harvesting[/b] mature plants and even become more powerful if you [b]harvest[/b] an already mutated one.
- That's a lot of informations, can you repeat ?
demeter: Ok,[pause=0.2] listen carefully.
jump explanations
- Ok, now I have more questions !
demeter: Sorry,[pause=0.2] we'll speak more after this.[pause=0.3] I send you an elevator,[pause=0.2] good luck [color=#FFA617]Orchid[/color] !
audio "res://common/audio_manager/assets/sfx/dialogs/sfx/closing_transmission.wav"
[wait time="2.0"]
[end_timeline]

View File

@@ -0,0 +1 @@
uid://cirxf28unnjlg

View File

@@ -1 +1,3 @@
demeter: Welcome to [color=#E30022]Borea[/color],[pause=0.2] [color=#FFA617]{orchidName}[/color],[pause=0.3] it is the first step of your journey on this planet. #id:50
[wait time="1.5"]
join demeter center [animation="Bounce In" length="1.0"]
demeter: Welcome to [color=#E30022]Borea[/color],[pause=0.2] [color=#FFA617]{orchidName}[/color],[pause=0.3] it is the first step of your journey on this planet. #id:50

View File

@@ -13,6 +13,6 @@ label suite_dialogue #id:42
jump suite_dialogue
- Wake up #id:49
Overseeing \\: serial number and system name.[pause=0.5].[pause=0.5].[pause=0.5] Strange.[pause=0.5] Serial number is empty.[pause=0.5] Must be an error.[pause=0.5] System name is,[pause=0.5] [color=#FFA617]Orchid[/color].[pause=0.5] That is enough for now. #id:4a
audio "res://common/audio_manager/assets/sfx/respawn/respawn.wav"
Starting engines,[pause=0.3] fans and daemons,[pause=0.3] let's see what is to see. #id:4b
[end_timeline]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bfyafiewcrjln"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_enq8o"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_enq8o"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_10bgv"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://d2vdf2sth2xjm"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_p8ox4"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_p8ox4"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_3h2vf"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://clruuysx80pnn"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_03in3"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_03in3"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_108r1"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://brmd6d3l8trqs"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_mvsqc"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_mvsqc"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_oqbgr"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://cfr33014u7ig5"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_14sjf"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_14sjf"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_ud5ex"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://cf70m1us8mfqp"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_xplyn"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_xplyn"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_uj75q"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://ctlmah4ohqp25"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_tv8sf"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_tv8sf"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_srnvv"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://b8o4q0hsm84ov"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_5lgql"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_5lgql"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_0b6yj"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bb33v756anesy"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_gcphf"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_gcphf"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_tnhr7"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://cbqrl72y0d1yg"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_k38pp"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_k38pp"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_cwsfe"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://dwppani7gyjl5"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_2m37y"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_2m37y"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_pyvr6"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://dkta1u1u0efxk"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_2r1e2"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_2r1e2"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_tv2v3"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://7hrdkl6bf3o4"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_peh48"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_peh48"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_o5tro"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://d2y7o2hc6ffei"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_wnxgs"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_wnxgs"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_smg8i"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://civ4gr1c2pq7g"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_1cr0i"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_1cr0i"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_h0d20"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bqfocs6f0iypo"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_p4qfr"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_p4qfr"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_iibe2"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://drml5dm8i3j3a"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_5xrel"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_5xrel"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_0v6u4"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://b1t5nfwcln5vo"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_0mgvf"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_0mgvf"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_k1p2k"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://b4s58a600q2rn"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_l4nmf"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_l4nmf"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_ifu40"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://dspugxsjw2aea"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_gpxi3"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_gpxi3"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_e0an0"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://cnt38l2fmg8d7"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_wmuv5"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_wmuv5"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_4klgd"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://ceisi5yyie7to"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_1eil5"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_1eil5"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_h27ow"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://cxiu8frk04b5i"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_qrhlr"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_qrhlr"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_4au1t"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://53p5g07e3pb4"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_tu2er"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_tu2er"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_2wu38"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://crmvc77bqax1y"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_3u7fo"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_3u7fo"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_23bbh"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://c0hr7icfkjkoi"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_bcreq"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_bcreq"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_af12b"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://clkoc1iccts2w"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_vlome"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_vlome"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_157wb"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bd8yapi1pokj6"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_0uwmh"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_0uwmh"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_h3coc"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://cxgw1vgket0fw"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_ajsfl"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_ajsfl"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_nif4i"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://c5gqwck2p5h5n"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_205mu"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_205mu"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_nlpf8"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://c5fj1cw0f4mu6"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_nyyxg"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_nyyxg"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_y2fie"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://dce788f0adauv"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_eaujg"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_eaujg"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_lsafj"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://dd34dikqoynp3"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_faxmp"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_faxmp"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_0me46"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bynje6g2wvuvl"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_55x88"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_55x88"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_dmctu"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bd2op6q1masjt"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_uhia7"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_uhia7"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_atmi3"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bvajuw0r47edw"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_761dd"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_761dd"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_3rcv4"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://qb6bftgq0n6y"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_b4uc1"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_b4uc1"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_dc8tr"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://ft112n57di0e"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_sabo0"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_sabo0"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_uvvih"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://dwjj6qmcjhn68"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_fvj4t"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_fvj4t"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_akiip"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://bkr70mstyf8pp"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_07tkv"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_07tkv"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_uotjj"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://dcuwupmqt34ju"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_m3t4k"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_m3t4k"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_qfabu"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://djmidq7yq452i"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_jg4cg"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_jg4cg"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_chdp7"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://wxqxm6d5twdh"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_1f2ok"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_1f2ok"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_pu3mc"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="PlantPart" format=3 uid="uid://uoikjpno37bi"]
[ext_resource type="Script" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_g38jy"]
[ext_resource type="Script" uid="uid://b3jwglylqdqtw" path="res://entities/plants/scripts/texture_builder/plant_part.gd" id="1_g38jy"]
[ext_resource type="Texture2D" uid="uid://doo2cxxa2p70a" path="res://entities/plants/assets/sprites/plante-teste.png" id="2_unpmr"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mypt2"]

View File

@@ -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

View File

@@ -1 +0,0 @@
uid://by1m5q6q53xxp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

View 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

View File

@@ -33,7 +33,7 @@ func can_use(_player : Player, zone : Player.ActionZone) -> bool:
return false
func use(player : Player, zone : Player.ActionZone) -> bool:
AudioManager.play_sfx("Pickaxe")
AudioManager.play_sfx("Dig")
for area in zone.get_affected_areas():
if area and area is Plant:
harvest(area, player)

View File

@@ -15,6 +15,7 @@ var signals : Array[DetectorSignalIndividual] = []
func _init(region : Region, pos : Vector2):
for e in region.entity_container.get_children():
if e.visible:
if e is TruckRecharge:
signals.append(
DetectorSignalIndividual.new(
@@ -22,7 +23,7 @@ func _init(region : Region, pos : Vector2):
ENERGY_ICON
)
)
if e is Door and e.available and e.visible:
if e is Door and e.available:
signals.append(
DetectorSignalIndividual.new(
(pos - e.global_position).normalized().angle(),

View File

@@ -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="Texture2D" uid="uid://c7ff87jniga5m" path="res://entities/player/assets/sprites/robot.png" id="1_symyc"]
[ext_resource type="Texture2D" uid="uid://bf6nw4onkhavr" path="res://common/icons/shovel.svg" id="3_yqrof"]
[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://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"]
radius = 27.0
@@ -10,44 +11,156 @@ radius = 27.0
[sub_resource type="CircleShape2D" id="CircleShape2D_abrql"]
radius = 40.0
[sub_resource type="Gradient" id="Gradient_yqrof"]
colors = PackedColorArray(0.145098, 0.423529, 0.635294, 1, 0.12549, 0.294118, 0.545098, 1)
[sub_resource type="Curve" id="Curve_fkugw"]
_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"]
gradient = SubResource("Gradient_yqrof")
fill = 1
fill_from = Vector2(0.5, 0.380342)
fill_to = Vector2(1, 0.0726496)
[sub_resource type="Gradient" id="Gradient_bls4j"]
offsets = PackedFloat32Array(0, 0.77729255, 1)
colors = PackedColorArray(0.5803922, 0.7058824, 0.8862745, 1, 0.5785, 0.70829165, 0.89, 1, 0.5785, 0.70829165, 0.89, 0)
[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")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-2, -18)
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=414557251]
position = Vector2(0, -17)
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)
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractArea2D" unique_id=1242017003]
shape = SubResource("CircleShape2D_abrql")
[node name="Sprite" type="Sprite2D" parent="."]
position = Vector2(0, -46)
scale = Vector2(0.08, 0.08)
texture = ExtResource("1_symyc")
[node name="CPUParticles2D" type="CPUParticles2D" parent="InteractArea2D" unique_id=1489736082]
position = Vector2(-8.4703295e-22, 12)
scale = Vector2(0.22803418, 0.22803418)
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
visible = false
position = Vector2(8.125, -26.195)
scale = Vector2(0.347656, 0.253906)
texture = SubResource("GradientTexture2D_3wlsy")
position = Vector2(0.99999994, -17)
scale = Vector2(0.0656168, 0.065616846)
sprite_frames = SubResource("SpriteFrames_a1qjk")
animation = &"back"
[node name="ItemSprite" type="Sprite2D" parent="."]
unique_name_in_owner = true
visible = false
modulate = Color(0.164706, 0.898039, 0.984314, 1)
position = Vector2(8.25, -27.32)
scale = Vector2(0.403333, 0.403333)
texture = ExtResource("3_yqrof")
[node name="FloatAnimationPlayer" type="AnimationPlayer" parent="." unique_id=929823261]
[node name="AnimationTree" type="AnimationTree" parent="." unique_id=563415659]
tree_root = SubResource("AnimationNodeStateMachine_fkugw")

View File

@@ -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 MAX_REACH = 100
const HOLDING_ITEM_SPRITE_SIZE = 20.
const TURN_ANIMATION_MINIMUM_THRESHOLD = 0.2
signal player_updated(player: Player)
signal upgraded
@@ -73,19 +74,8 @@ func _process(delta):
func _on_inventory_updated(_inventory: Inventory):
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)
func calculate_direction():
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)
velocity = input_direction * speed
if input_direction.x:
flip_character(input_direction.x > 0)
turn_animate(input_direction)
func flip_character(face_right = true):
$Sprite.flip_h = not face_right
%ItemSprite.position.x = abs(%ItemSprite.position.x) * (1 if face_right else -1)
%HideEyes.position.x = abs(%ItemSprite.position.x) * (1 if face_right else -1)
func turn_animate(input_direction):
if input_direction.x > TURN_ANIMATION_MINIMUM_THRESHOLD:
if input_direction.y > TURN_ANIMATION_MINIMUM_THRESHOLD:
%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):
return interactable.can_interact(self)

View File

@@ -22,8 +22,9 @@ layer = 99
[node name="ColorRect" type="ColorRect" parent="." unique_id=2001966466]
material = SubResource("ShaderMaterial_67c4d")
offset_right = 1152.0
offset_bottom = 648.0
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.0352941, 0.0196078, 0.12549, 0.705882)

View File

@@ -4,8 +4,10 @@
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_nq5i2"]
[ext_resource type="PackedScene" uid="uid://brfsapvj2quxm" path="res://gui/game/energy_info/energy_info.tscn" id="4_2wykm"]
[ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_h6540"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="6_2wykm"]
[ext_resource type="PackedScene" uid="uid://df0eop555wfj5" path="res://gui/game/objective_progress_bar/objective_progress_bar.tscn" id="6_dr1y2"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="6_h6540"]
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="6_id0t5"]
[ext_resource type="Texture2D" uid="uid://b43thuq8piv18" path="res://common/icons/skull.svg" id="7_dr1y2"]
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"]
@@ -19,6 +21,10 @@ gradient = SubResource("Gradient_id0t5")
fill_to = Vector2(1, 1)
repeat = 1
[sub_resource type="LabelSettings" id="LabelSettings_id0t5"]
font = ExtResource("6_2wykm")
font_size = 40
[sub_resource type="Animation" id="Animation_2wykm"]
resource_name = "NoRechargeAppear"
length = 0.5
@@ -155,7 +161,24 @@ layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
[node name="RechargesLeftLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1961035876]
[node name="SimplePlantPointScore" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=973032799]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 0
alignment = 1
[node name="TextureRect" type="TextureRect" parent="MarginContainer/VBoxContainer/SimplePlantPointScore" unique_id=534916675]
layout_mode = 2
texture = ExtResource("6_id0t5")
[node name="SimplePlantPointScoreLabel" type="Label" parent="MarginContainer/VBoxContainer/SimplePlantPointScore" unique_id=1961035876]
unique_name_in_owner = true
layout_mode = 2
text = "0 Plant Point"
label_settings = SubResource("LabelSettings_id0t5")
horizontal_alignment = 1
[node name="RechargesLeftLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1254074923]
unique_name_in_owner = true
layout_mode = 2
text = "9 charges left"

Binary file not shown.

View 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

Some files were not shown because too many files have changed in this diff Show More