fix post-proto
* ajout d'un fondu de musique au changement de phase * résolution de bugs en tout genre
This commit is contained in:
parent
d3ea21e212
commit
dbe8f03531
@ -57,7 +57,7 @@ PRODUCE_%s_SEEDS,Produce %s seeds,Produit %s graines
|
||||
DAY_%d,Day [b]%d[/b],Jour [b]%d[/b]
|
||||
MATURE_ON_DAY_%d,Mature on day [b]%d[/b],Mature au jour [b]%d[/b]
|
||||
%d_SCORE_WHEN_MATURE,Grants [b]%d[/b] garden points when mature,Donne [b]%d[/b] points de jardin une fois mature
|
||||
ABSURD,[rainbow]Absurd[/rainbow],[rainbow]Absurde[rainbow]
|
||||
ABSURD,[rainbow]Absurd[/rainbow],[rainbow]Absurde[/rainbow]
|
||||
GROW_IN_%d,Grow in [b]%d[/b] days,Mature dans [b]%d[/b] jours
|
||||
%s_SCORE_WHEN_MATURE,Grants [b]%s[/b] garden points when mature,Donne [b]%s[/b] points de jardin une fois mature
|
||||
DISCOVER_%s,Discover %s,Découvre %s
|
||||
@ -82,7 +82,7 @@ QUICK_EFFECT_TEXT_LEVEL_%d,Reduce the growing time by %d,Réduit le temps de mat
|
||||
SOCIABLE,Outgoing,Sociable
|
||||
SOCIABLE_EFFECT_TEXT_LEVEL_%d,"When mature, grants [b]%d[/b] garden points if it is nearby %d other plants","Une fois mature, donne [b]%d[/b] points de jardin si elle est à côté de %d autres plantes"
|
||||
STRONG,Strong,Fort
|
||||
STRONG_EFFECT_TEXT_LEVEL_%d,Plus [b]%d[/b] % of the score,Augmente le score de [b]%d[/b] %
|
||||
STRONG_EFFECT_TEXT_LEVEL_%d,Plus [b]%d[/b]%% of the score,Augmente le score de [b]%d[/b]%%
|
||||
COST_%d_ENERGY,Cost %d energy,Coûte %d d’énergie
|
||||
ONE_TIME_USE,Single use,Usage unique
|
||||
BUILD_%s,Build %s,Construit %s
|
||||
|
||||
|
@ -36,7 +36,7 @@ stream_0/volume = -60.0
|
||||
process_mode = 3
|
||||
script = ExtResource("1_ji160")
|
||||
ambiance_volume = -3.0
|
||||
garden_phases_scores = Array[int]([0, 10, 30])
|
||||
garden_phases_scores = Array[int]([0, 1, 30])
|
||||
playing_ambiances = [NodePath("Ambiance/Default")]
|
||||
|
||||
[node name="Ambiance" type="Node" parent="."]
|
||||
|
||||
@ -27,32 +27,41 @@ func _ready():
|
||||
is_ready = true
|
||||
|
||||
func setup_volume():
|
||||
for c in %Ambiance.get_children():
|
||||
var player = c as AudioStreamPlayer
|
||||
player.volume_db = ambiance_volume if playing_ambiances.find(player) != -1 else MIN_VOLUME
|
||||
|
||||
for c in %Musics.get_children():
|
||||
var player = c as AudioStreamPlayer
|
||||
player.volume_db = music_volume if playing_musics.find(player) != -1 else MIN_VOLUME
|
||||
|
||||
for player in get_all_audio_stream():
|
||||
for player in get_all_audio_streams():
|
||||
player.volume_db = get_volume_from_parent(player) if playing_ambiances.find(player) != -1 else MIN_VOLUME
|
||||
player.play()
|
||||
setup_phase(player)
|
||||
|
||||
func get_volume_from_parent(player : AudioStreamPlayer) -> float:
|
||||
if player.get_parent() == %Ambiance:
|
||||
return ambiance_volume
|
||||
return music_volume
|
||||
|
||||
func update_phase():
|
||||
for player in get_all_audio_stream():
|
||||
for player in get_all_audio_streams():
|
||||
var playing : bool = player.volume_db != MIN_VOLUME
|
||||
if playing:
|
||||
await set_volume(player, MIN_VOLUME).finished
|
||||
setup_phase(player)
|
||||
if playing:
|
||||
set_volume(player, get_volume_from_parent(player))
|
||||
|
||||
func get_all_audio_stream() -> Array[AudioStreamPlayer]:
|
||||
func get_all_audio_streams() -> Array[AudioStreamPlayer]:
|
||||
var all_audio_stream : Array[AudioStreamPlayer] = []
|
||||
var all_children = %Ambiance.get_children()
|
||||
all_children.append_array(%Musics.get_children())
|
||||
all_audio_stream.append_array(get_audio_streams_from_node(%Musics))
|
||||
all_audio_stream.append_array(get_audio_streams_from_node(%Ambiance))
|
||||
|
||||
for c in all_children:
|
||||
if c is AudioStreamPlayer:
|
||||
all_audio_stream.append(c)
|
||||
return all_audio_stream
|
||||
|
||||
func get_audio_streams_from_node(node : Node) -> Array[AudioStreamPlayer]:
|
||||
var streams : Array[AudioStreamPlayer] = []
|
||||
|
||||
for c in node.get_children():
|
||||
if c is AudioStreamPlayer:
|
||||
streams.append(c)
|
||||
return streams
|
||||
|
||||
|
||||
func _on_current_planet_data_updated(planet_data : PlanetData):
|
||||
if planet_data:
|
||||
update_garden_phase(planet_data)
|
||||
@ -64,7 +73,8 @@ func update_garden_phase(planet_data : PlanetData):
|
||||
if planet_data.garden_score >= garden_phases_scores[i] and i > garden_phase:
|
||||
phase = i
|
||||
|
||||
update_phase()
|
||||
if garden_phase != phase:
|
||||
update_phase()
|
||||
|
||||
garden_phase = phase
|
||||
|
||||
@ -95,7 +105,6 @@ func setup_phase(music : AudioStreamPlayer):
|
||||
0. if i == phase_stream_id else MIN_VOLUME
|
||||
)
|
||||
|
||||
|
||||
func set_volume(music : AudioStreamPlayer, to : float, fade_time = default_fade_time) -> Tween:
|
||||
var fade_tween : Tween = get_tree().create_tween()
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ colors = PackedColorArray(1, 1, 1, 0.65882355, 1, 1, 1, 0.72156864, 1, 1, 1, 0)
|
||||
[node name="Particles" type="CPUParticles2D"]
|
||||
amount = 1
|
||||
texture = ExtResource("1_88fy1")
|
||||
randomness = 0.3
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 30.0
|
||||
gravity = Vector2(0, -20)
|
||||
|
||||
@ -54,9 +54,12 @@ func pointer_text() -> String:
|
||||
return plant_type.name
|
||||
|
||||
func inspect(is_inspected : bool = true):
|
||||
modulate = MODULATE_INSPECTED_COLOR if is_inspected else default_modulate
|
||||
plant_sprite.modulate = MODULATE_INSPECTED_COLOR if is_inspected else default_modulate
|
||||
influence_zone.show_influence = is_inspected
|
||||
|
||||
func affect_preview(is_affected : bool = true):
|
||||
plant_sprite.modulate = MODULATE_AFFECTED_COLOR if is_affected else default_modulate
|
||||
|
||||
func generate_sprite() -> PlantSprite:
|
||||
var sprite_object : PlantSprite = SPRITE_SCENE.instantiate()
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ func _ready():
|
||||
sprite.radius = 100
|
||||
sprite.fill = false
|
||||
sprite.width = 1
|
||||
sprite.opacity = 0.2
|
||||
sprite.opacity = 0.5
|
||||
sprite.visible = show_influence
|
||||
add_child(sprite)
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ static func get_rarity_text(rarity) -> String:
|
||||
if rarity < len(rarity_text):
|
||||
return rarity_text[rarity]
|
||||
else :
|
||||
return rarity_text[len(rarity_text) - 1] + " " + str(rarity - len(rarity_text) + 2)
|
||||
return rarity_text[len(rarity_text) - 1]
|
||||
|
||||
static func get_rarity_color(rarity : int) -> Color:
|
||||
var rarity_colors : Array[Color] = [
|
||||
|
||||
@ -19,7 +19,6 @@ func mutate_score(plant_state : Plant.State, plant : Plant, score) -> int:
|
||||
if plant_state != Plant.State.MATURE:
|
||||
return score
|
||||
var plant_count = 0
|
||||
|
||||
for area in plant.influence_zone.get_overlapping_areas():
|
||||
if area is Plant and area != plant and area.plant_type.name == plant.plant_type.name:
|
||||
plant_count += 1
|
||||
|
||||
@ -11,7 +11,7 @@ func get_mutation_name() -> String:
|
||||
return tr("STRONG")
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("STRONG_EFFECT_TEXT_LEVEL_%d") % roundi(get_score_multiplier() * 100)
|
||||
return tr("STRONG_EFFECT_TEXT_LEVEL_%d") % [roundi(get_score_multiplier() * 100)]
|
||||
|
||||
func get_score_multiplier():
|
||||
return float(level)/2.
|
||||
|
||||
@ -26,7 +26,7 @@ func get_icon() -> Texture2D:
|
||||
|
||||
func use_text() -> String:
|
||||
if machine_type:
|
||||
return tr("BUILD_%s") % machine_type.name
|
||||
return tr("BUILD_%s") % tr(machine_type.name)
|
||||
return ""
|
||||
|
||||
func is_one_time_use():
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
extends CharacterBody2D
|
||||
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.
|
||||
|
||||
@ -12,9 +13,8 @@ var planet : Planet :
|
||||
get(): return terrain if terrain is Planet else null
|
||||
@export var speed = 350
|
||||
|
||||
var has_just_received_instruction : bool = false # pour récupérer les zones dans les action_area, une frame doit être passée depuis la création de la zone
|
||||
|
||||
var data : PlayerData
|
||||
var last_action_area_movement_timer : float = 100.
|
||||
|
||||
var controlling_player : bool = true :
|
||||
set(v):
|
||||
@ -54,18 +54,20 @@ func _pass_day():
|
||||
func _end_pass_day():
|
||||
controlling_player = true
|
||||
|
||||
func _process(_delta):
|
||||
func _process(delta):
|
||||
last_action_area_movement_timer += delta
|
||||
if controlling_player:
|
||||
var old_velocity=velocity
|
||||
calculate_direction()
|
||||
|
||||
if instruction and instruction.can_be_done(self) and not has_just_received_instruction:
|
||||
if (
|
||||
last_action_area_movement_timer >= ACTION_AREA_UPDATE_TIME
|
||||
and instruction and instruction.can_be_done(self)
|
||||
):
|
||||
instruction.do(self)
|
||||
instruction = null
|
||||
move_preview_zone(get_global_mouse_position())
|
||||
|
||||
has_just_received_instruction = false
|
||||
|
||||
# Sound
|
||||
if old_velocity.length()==0 and velocity.length()!=0:
|
||||
play_sfx("move")
|
||||
@ -94,7 +96,7 @@ func calculate_direction():
|
||||
if input_direction.length() != 0:
|
||||
instruction = null
|
||||
|
||||
if instruction:
|
||||
if instruction and instruction.position.distance_to(global_position) > (MAX_REACH - 1.):
|
||||
input_direction = self.global_position.direction_to(instruction.position)
|
||||
|
||||
velocity = input_direction * speed
|
||||
@ -112,7 +114,6 @@ func can_interact(interactable : Interactable):
|
||||
|
||||
func try_interact(interactable : Interactable):
|
||||
if interactable:
|
||||
has_just_received_instruction = true
|
||||
instruction = InteractableInstruction.new(
|
||||
interactable
|
||||
)
|
||||
@ -148,7 +149,6 @@ func delete_item(item: Item):
|
||||
data.inventory.remove_item(item)
|
||||
|
||||
func try_use_item(item : Item, use_position : Vector2):
|
||||
has_just_received_instruction = true
|
||||
setup_action_zone(use_position, item)
|
||||
instruction = ItemActionInstruction.new(
|
||||
use_position,
|
||||
@ -224,6 +224,7 @@ func setup_action_zone(zone_position : Vector2, item: Item) -> ActionZone:
|
||||
action_zone.destroy()
|
||||
action_zone = generate_action_zone(item)
|
||||
action_zone.move_to_position(zone_position)
|
||||
last_action_area_movement_timer = 0.
|
||||
return action_zone
|
||||
|
||||
func move_preview_zone(zone_position : Vector2):
|
||||
@ -251,7 +252,7 @@ class Instruction:
|
||||
position = _pos
|
||||
|
||||
func can_be_done(player : Player):
|
||||
return player.global_position.distance_to(position) < 10
|
||||
return player.global_position.distance_to(position) < player.MAX_REACH
|
||||
|
||||
func do(_player : Player):
|
||||
pass
|
||||
@ -267,7 +268,9 @@ class ItemActionInstruction extends Instruction:
|
||||
item = _item
|
||||
|
||||
func can_be_done(player : Player):
|
||||
return player.global_position.distance_to(position) < player.MAX_REACH
|
||||
return (
|
||||
player.global_position.distance_to(position) < player.MAX_REACH
|
||||
)
|
||||
|
||||
func do(player : Player):
|
||||
player.use_item(item)
|
||||
|
||||
@ -43,3 +43,71 @@ progressive_web_app/icon_512x512=""
|
||||
progressive_web_app/background_color=Color(0, 0, 0, 1)
|
||||
threads/emscripten_pool_size=8
|
||||
threads/godot_pool_size=4
|
||||
|
||||
[preset.1]
|
||||
|
||||
name="Windows Desktop"
|
||||
platform="Windows Desktop"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=".export/win/stw.exe"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.1.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
shader_baker/enabled=false
|
||||
binary_format/architecture="x86_64"
|
||||
codesign/enable=false
|
||||
codesign/timestamp=true
|
||||
codesign/timestamp_server_url=""
|
||||
codesign/digest_algorithm=1
|
||||
codesign/description=""
|
||||
codesign/custom_options=PackedStringArray()
|
||||
application/modify_resources=true
|
||||
application/icon=""
|
||||
application/console_wrapper_icon=""
|
||||
application/icon_interpolation=4
|
||||
application/file_version=""
|
||||
application/product_version=""
|
||||
application/company_name=""
|
||||
application/product_name=""
|
||||
application/file_description=""
|
||||
application/copyright=""
|
||||
application/trademarks=""
|
||||
application/export_angle=0
|
||||
application/export_d3d12=0
|
||||
application/d3d12_agility_sdk_multiarch=true
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
ssh_remote_deploy/extra_args_ssh=""
|
||||
ssh_remote_deploy/extra_args_scp=""
|
||||
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
|
||||
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
|
||||
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
|
||||
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
|
||||
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
|
||||
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
|
||||
Start-ScheduledTask -TaskName godot_remote_debug
|
||||
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
|
||||
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
||||
Remove-Item -Recurse -Force '{temp_dir}'"
|
||||
|
||||
@ -1,60 +1,55 @@
|
||||
[gd_scene load_steps=22 format=3 uid="uid://3ss8pvhsackj"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://3ss8pvhsackj"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://753270jjxmfg" path="res://gui/game/card/card.tscn" id="1_we78f"]
|
||||
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="1_x54se"]
|
||||
[ext_resource type="Texture2D" uid="uid://0hbdgalf04e" path="res://common/icons/wood.svg" id="2_bw03i"]
|
||||
[ext_resource type="Script" uid="uid://dj5pld5ragrjp" path="res://gui/game/card/scripts/card_visualiser.gd" id="2_ntbk8"]
|
||||
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="3_5yk1o"]
|
||||
[ext_resource type="Texture2D" uid="uid://bd6qddv5ihkjr" path="res://common/icons/bucket.svg" id="3_r0jrf"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="4_7xkgc"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="5_1et8x"]
|
||||
[ext_resource type="Texture2D" uid="uid://cgefjpkvs8noj" path="res://common/icons/copy.svg" id="5_lj1tr"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="7_1et8x"]
|
||||
[ext_resource type="Texture2D" uid="uid://df0y0s666ui4h" path="res://icon.png" id="7_6vah0"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_r0jrf"]
|
||||
shader = ExtResource("1_x54se")
|
||||
shader_parameter/fov = 90.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = -6e-45
|
||||
shader_parameter/x_rot = -6e-45
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_r0jrf"]
|
||||
script = ExtResource("4_7xkgc")
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6vah0"]
|
||||
script = ExtResource("4_7xkgc")
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jjqcm"]
|
||||
script = ExtResource("4_7xkgc")
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lj1tr"]
|
||||
script = ExtResource("4_7xkgc")
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vabmf"]
|
||||
script = ExtResource("4_7xkgc")
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1vjtn"]
|
||||
script = ExtResource("4_7xkgc")
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="7_vabmf"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="8_1vjtn"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_l3vvu"]
|
||||
script = ExtResource("4_7xkgc")
|
||||
title_text = "Very nice section"
|
||||
title_icon = ExtResource("5_lj1tr")
|
||||
text = "It's a very nice section with a very nice text"
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_bw03i"]
|
||||
[sub_resource type="Resource" id="Resource_biqg7"]
|
||||
script = ExtResource("5_1et8x")
|
||||
text = "Dna"
|
||||
icon = ExtResource("7_vabmf")
|
||||
metadata/_custom_type_script = "uid://b4tkium34c831"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_gskac"]
|
||||
script = ExtResource("5_1et8x")
|
||||
text = "Growth"
|
||||
icon = ExtResource("8_1vjtn")
|
||||
metadata/_custom_type_script = "uid://b4tkium34c831"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_eb1v6"]
|
||||
script = ExtResource("3_5yk1o")
|
||||
title = "Hello"
|
||||
texture = ExtResource("7_6vah0")
|
||||
important_stat_text = "6"
|
||||
important_stat_icon = ExtResource("3_r0jrf")
|
||||
sections = Array[ExtResource("4_7xkgc")]([SubResource("Resource_r0jrf"), SubResource("Resource_6vah0"), SubResource("Resource_jjqcm"), SubResource("Resource_lj1tr"), SubResource("Resource_vabmf"), SubResource("Resource_1vjtn"), SubResource("Resource_l3vvu")])
|
||||
important_stat_text = "5"
|
||||
important_stat_icon = ExtResource("2_bw03i")
|
||||
stats = Array[ExtResource("5_1et8x")]([SubResource("Resource_biqg7"), SubResource("Resource_gskac")])
|
||||
sections = Array[ExtResource("4_7xkgc")]([SubResource("Resource_l3vvu")])
|
||||
metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bw03i"]
|
||||
shader = ExtResource("1_x54se")
|
||||
shader_parameter/fov = 90.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = 0.00018062632
|
||||
shader_parameter/x_rot = -0.00042293756
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1et8x"]
|
||||
length = 0.3
|
||||
|
||||
@ -68,27 +63,35 @@ _data = {
|
||||
&"appear": SubResource("Animation_7xkgc")
|
||||
}
|
||||
|
||||
[node name="CardVisualiser" type="SubViewportContainer"]
|
||||
material = SubResource("ShaderMaterial_r0jrf")
|
||||
[node name="CardVisualiser" type="MarginContainer"]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -246.0
|
||||
offset_top = -134.0
|
||||
offset_right = 54.0
|
||||
offset_bottom = -24.0
|
||||
offset_left = -125.0
|
||||
offset_top = -30.0
|
||||
offset_right = 125.0
|
||||
offset_bottom = 30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(1.0000002, 1.0000002)
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 2
|
||||
theme_override_constants/margin_left = -25
|
||||
theme_override_constants/margin_top = -25
|
||||
theme_override_constants/margin_right = -25
|
||||
theme_override_constants/margin_bottom = -25
|
||||
script = ExtResource("2_ntbk8")
|
||||
card_info = SubResource("Resource_bw03i")
|
||||
card_info = SubResource("Resource_eb1v6")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="."]
|
||||
[node name="SubViewportContainer" type="SubViewportContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
material = SubResource("ShaderMaterial_bw03i")
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"]
|
||||
unique_name_in_owner = true
|
||||
transparent_bg = true
|
||||
handle_input_locally = false
|
||||
@ -96,7 +99,7 @@ size = Vector2i(300, 110)
|
||||
size_2d_override_stretch = true
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="CardContainer" type="MarginContainer" parent="SubViewport"]
|
||||
[node name="CardContainer" type="MarginContainer" parent="SubViewportContainer/SubViewport"]
|
||||
unique_name_in_owner = true
|
||||
offset_right = 300.0
|
||||
offset_bottom = 110.0
|
||||
@ -105,15 +108,14 @@ theme_override_constants/margin_top = 25
|
||||
theme_override_constants/margin_right = 25
|
||||
theme_override_constants/margin_bottom = 25
|
||||
|
||||
[node name="Card" parent="SubViewport/CardContainer" instance=ExtResource("1_we78f")]
|
||||
[node name="Card" parent="SubViewportContainer/SubViewport/CardContainer" instance=ExtResource("1_we78f")]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
mouse_filter = 2
|
||||
small_mode = true
|
||||
down_arrow = true
|
||||
info = SubResource("Resource_bw03i")
|
||||
info = SubResource("Resource_eb1v6")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
@tool
|
||||
extends SubViewportContainer
|
||||
extends MarginContainer
|
||||
class_name CardVisualiser
|
||||
|
||||
signal clicked(c: CardVisualiser)
|
||||
@ -7,6 +7,8 @@ signal clicked(c: CardVisualiser)
|
||||
const MAX_ROT = 15
|
||||
const ZOOM_SCALE = 1.2
|
||||
|
||||
const MARGIN = 25
|
||||
|
||||
var wanted_rot : Vector2 = Vector2.ZERO
|
||||
var real_rot : Vector2 = Vector2.ZERO
|
||||
|
||||
@ -51,7 +53,7 @@ func _input(event):
|
||||
clicked.emit(self)
|
||||
|
||||
func _ready():
|
||||
material = material.duplicate()
|
||||
%SubViewportContainer.material = %SubViewportContainer.material.duplicate()
|
||||
update()
|
||||
is_ready = true
|
||||
|
||||
@ -69,13 +71,14 @@ func _process(_d):
|
||||
|
||||
real_rot = real_rot.lerp(wanted_rot, 0.1)
|
||||
|
||||
material.set_shader_parameter("y_rot", - real_rot.x)
|
||||
material.set_shader_parameter("x_rot", real_rot.y)
|
||||
%SubViewportContainer.material.set_shader_parameter("y_rot", - real_rot.x)
|
||||
%SubViewportContainer.material.set_shader_parameter("x_rot", real_rot.y)
|
||||
|
||||
%Card.custom_minimum_size.x = card_width
|
||||
%CardContainer.size.y = 0
|
||||
%CardContainer.size = Vector2.ZERO
|
||||
%SubViewport.size = %CardContainer.size
|
||||
size = %SubViewport.size
|
||||
%SubViewportContainer.size = %SubViewport.size
|
||||
size = %SubViewportContainer.size - (Vector2.ONE * MARGIN * 2)
|
||||
|
||||
|
||||
func is_mouse_over() -> bool:
|
||||
|
||||
@ -165,6 +165,19 @@ texture = ExtResource("3_m0ja8")
|
||||
expand_mode = 1
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ParticleTexture2" type="TextureRect" parent="CenterContainer/ItemTexture"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -22.0
|
||||
offset_right = 22.0
|
||||
grow_vertical = 0
|
||||
texture = ExtResource("3_m0ja8")
|
||||
expand_mode = 1
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="BottomSpace" type="Control" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
|
||||
@ -39,12 +39,16 @@ func update(_item: Item, selected : bool):
|
||||
if item and item.icon:
|
||||
%ItemTexture.texture = item.icon
|
||||
var particles = item.get_particles()
|
||||
if len(particles):
|
||||
if len(particles) > 0:
|
||||
%ParticleTexture.texture = particles[0].texture
|
||||
%ParticleTexture.modulate = particles[0].color
|
||||
if len(particles) > 1:
|
||||
%ParticleTexture2.texture = particles[1].texture
|
||||
%ParticleTexture2.modulate = particles[1].color
|
||||
%ItemTexture.visible = item != null
|
||||
%NoItemTextureRect.visible = item == null
|
||||
%ParticleTexture.visible = item and len(item.get_particles())
|
||||
%ParticleTexture.visible = item and len(item.get_particles())>0
|
||||
%ParticleTexture2.visible = item and len(item.get_particles())>1
|
||||
|
||||
|
||||
current_item = item
|
||||
|
||||
@ -15,10 +15,12 @@ func _ready():
|
||||
|
||||
func show_rewards():
|
||||
showing_rewards = true
|
||||
get_tree().paused = true
|
||||
%AnimationPlayer.play("show")
|
||||
|
||||
func hide_rewards():
|
||||
showing_rewards = false
|
||||
get_tree().paused = false
|
||||
%AnimationPlayer.play_backwards("show")
|
||||
|
||||
func generate_rewards(nb : int = 3):
|
||||
|
||||
@ -70,7 +70,7 @@ func _on_plant_gaining_score(plant: Plant, amount : int):
|
||||
0.8
|
||||
)
|
||||
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
await get_tree().create_timer(0.3 / max(1,i)).timeout
|
||||
|
||||
func spawn_score_particle(
|
||||
from_position,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
extends Control
|
||||
|
||||
const PLANET_RUN_SCENE = preload("res://stages/planet_run/planet_run.tscn")
|
||||
@export_file var game_scene_path : String
|
||||
|
||||
func _ready():
|
||||
visible = false
|
||||
@ -13,7 +13,7 @@ func win(planet : Planet):
|
||||
func _on_restart_pressed():
|
||||
GameInfo.game_data.reset_all()
|
||||
get_tree().paused = false
|
||||
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
|
||||
get_tree().change_scene_to_file(game_scene_path)
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
@ -27,6 +27,7 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_sehw2")
|
||||
game_scene_path = "uid://d28cp7a21kwou"
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
material = SubResource("ShaderMaterial_8p3aj")
|
||||
|
||||
@ -1 +1,48 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#ffffff" class="icon icon-tabler icons-tabler-filled icon-tabler-pointer"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3.039 4.277l3.904 13.563c.185 .837 .92 1.516 1.831 1.642l.17 .016a2.2 2.2 0 0 0 1.982 -1.006l.045 -.078l1.4 -2.072l4.05 4.05a2.067 2.067 0 0 0 2.924 0l1.047 -1.047c.388 -.388 .606 -.913 .606 -1.461l-.008 -.182a2.067 2.067 0 0 0 -.598 -1.28l-4.047 -4.048l2.103 -1.412c.726 -.385 1.18 -1.278 1.053 -2.189a2.2 2.2 0 0 0 -1.701 -1.845l-13.524 -3.89a1 1 0 0 0 -1.236 1.24z" /></svg>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="#ffffff"
|
||||
class="icon icon-tabler icons-tabler-filled icon-tabler-pointer"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
sodipodi:docname="pointer.svg"
|
||||
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="namedview2"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:zoom="16"
|
||||
inkscape:cx="7.84375"
|
||||
inkscape:cy="20.3125"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1009"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<path
|
||||
stroke="none"
|
||||
d="M0 0h24v24H0z"
|
||||
fill="none"
|
||||
id="path1" />
|
||||
<path
|
||||
d="m 3.0398163,7.2791792 3.904,13.5629998 c 0.185,0.837 0.92,1.516 1.831,1.642 l 0.17,0.016 a 2.2,2.2 0 0 0 1.9819997,-1.006 l 0.045,-0.078 1.4,-2.072 4.05,4.05 a 2.067,2.067 0 0 0 2.924,0 l 1.047,-1.047 c 0.388,-0.388 0.606,-0.913 0.606,-1.461 l -0.008,-0.182 a 2.067,2.067 0 0 0 -0.598,-1.28 l -4.047,-4.048 2.103,-1.412 c 0.726,-0.385 1.18,-1.278 1.053,-2.189 a 2.2,2.2 0 0 0 -1.701,-1.8449997 L 4.2768163,6.0401792 a 1,1 0 0 0 -1.236,1.24 z"
|
||||
id="path3"
|
||||
style="fill:#000000;fill-opacity:0.286567" />
|
||||
<path
|
||||
d="M3.039 4.277l3.904 13.563c.185 .837 .92 1.516 1.831 1.642l.17 .016a2.2 2.2 0 0 0 1.982 -1.006l.045 -.078l1.4 -2.072l4.05 4.05a2.067 2.067 0 0 0 2.924 0l1.047 -1.047c.388 -.388 .606 -.913 .606 -1.461l-.008 -.182a2.067 2.067 0 0 0 -.598 -1.28l-4.047 -4.048l2.103 -1.412c.726 -.385 1.18 -1.278 1.053 -2.189a2.2 2.2 0 0 0 -1.701 -1.845l-13.524 -3.89a1 1 0 0 0 -1.236 1.24z"
|
||||
id="path2" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 2.1 KiB |
@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/pointer.svg-7e9852b8fc87e59d7ede00033ef3f170.
|
||||
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
|
||||
@ -25,6 +27,10 @@ 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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://0yr6b2jtuttm"]
|
||||
[gd_scene load_steps=23 format=3 uid="uid://0yr6b2jtuttm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vhumsfntpqcl" path="res://gui/pointer/scripts/pointer.gd" id="1_1pe2k"]
|
||||
[ext_resource type="Texture2D" uid="uid://bspffyprdywgc" path="res://gui/pointer/assets/cursors/pointer.svg" id="2_q4bvb"]
|
||||
@ -8,21 +8,51 @@
|
||||
[ext_resource type="Script" uid="uid://c60a1bjcuj4hd" path="res://common/vfx/circle/scripts/circle.gd" id="5_b4uwv"]
|
||||
[ext_resource type="PackedScene" uid="uid://3ss8pvhsackj" path="res://gui/game/card/card_visualiser.tscn" id="6_7j4mj"]
|
||||
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="7_wgcdp"]
|
||||
[ext_resource type="Texture2D" uid="uid://0hbdgalf04e" path="res://common/icons/wood.svg" id="8_tdpeg"]
|
||||
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="8_xb313"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="9_s1ym6"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="10_d4v46"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="11_s1ym6"]
|
||||
[ext_resource type="Texture2D" uid="uid://cgefjpkvs8noj" path="res://common/icons/copy.svg" id="11_tof6i"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="13_mw4ws"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="14_efnoc"]
|
||||
[ext_resource type="Texture2D" uid="uid://df0y0s666ui4h" path="res://icon.png" id="15_dtmaq"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_6eft6"]
|
||||
shader = ExtResource("7_wgcdp")
|
||||
shader_parameter/fov = 90.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = -6e-45
|
||||
shader_parameter/x_rot = -6e-45
|
||||
shader_parameter/y_rot = -5.999999999999999e-45
|
||||
shader_parameter/x_rot = -5.999999999999999e-45
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mrxa2"]
|
||||
[sub_resource type="Resource" id="Resource_l3vvu"]
|
||||
script = ExtResource("9_s1ym6")
|
||||
title_text = "Very nice section"
|
||||
title_icon = ExtResource("11_tof6i")
|
||||
text = "It's a very nice section with a very nice text"
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_biqg7"]
|
||||
script = ExtResource("10_d4v46")
|
||||
text = "Dna"
|
||||
icon = ExtResource("13_mw4ws")
|
||||
metadata/_custom_type_script = "uid://b4tkium34c831"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_gskac"]
|
||||
script = ExtResource("10_d4v46")
|
||||
text = "Growth"
|
||||
icon = ExtResource("14_efnoc")
|
||||
metadata/_custom_type_script = "uid://b4tkium34c831"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mbe2a"]
|
||||
script = ExtResource("8_xb313")
|
||||
title = "Hello"
|
||||
texture = ExtResource("15_dtmaq")
|
||||
important_stat_text = "5"
|
||||
important_stat_icon = ExtResource("8_tdpeg")
|
||||
stats = Array[ExtResource("10_d4v46")]([SubResource("Resource_biqg7"), SubResource("Resource_gskac")])
|
||||
sections = Array[ExtResource("9_s1ym6")]([SubResource("Resource_l3vvu")])
|
||||
metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
|
||||
|
||||
[node name="Pointer" type="Node"]
|
||||
@ -123,8 +153,9 @@ modulate = Color(1, 1, 1, 0.5003133)
|
||||
material = SubResource("ShaderMaterial_6eft6")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
mouse_filter = 0
|
||||
card_info = SubResource("Resource_mrxa2")
|
||||
card_info = SubResource("Resource_mbe2a")
|
||||
|
||||
[node name="Audio" type="Node" parent="."]
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ const ZONE_ACTIVATED_COLOR = Color.TURQUOISE
|
||||
const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
|
||||
|
||||
const CARD_VISUALISATION_TIME = 0.5
|
||||
const CARD_UP_PADDING = 20
|
||||
const CARD_UP_PADDING = 50
|
||||
|
||||
@export var default_cursor : Texture2D
|
||||
|
||||
@ -101,7 +101,11 @@ func inspect(node : Node):
|
||||
update_inspector()
|
||||
|
||||
func update_card():
|
||||
if not inspected or inspected_card_info == null or time_last_inspected > CARD_VISUALISATION_TIME:
|
||||
if (
|
||||
not inspected or inspected_card_info == null
|
||||
or time_last_inspected > CARD_VISUALISATION_TIME
|
||||
or get_tree().paused
|
||||
):
|
||||
%CardVisualiser.hide()
|
||||
|
||||
elif inspected != null and (
|
||||
|
||||
BIN
icon.png
BIN
icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 12 KiB |
@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.cte
|
||||
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
|
||||
@ -25,6 +27,10 @@ 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
|
||||
|
||||
@ -12,7 +12,7 @@ config_version=5
|
||||
|
||||
config/name="Seeding Planets"
|
||||
config/description="Seeding planets is a survival, managment and cosy game in which you play a little gardener robot."
|
||||
config/version="proto-3.0"
|
||||
config/version="proto-3.1"
|
||||
run/main_scene="uid://c5bruelvqbm1k"
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
config/icon="uid://df0y0s666ui4h"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
VERSION=$(grep config/version project.godot | cut -d'"' -f2 )
|
||||
cd .export/web
|
||||
zip web.zip *
|
||||
butler push web.zip zink-exe/seeding-the-wasteland-prototype:web --userversion $VERSION
|
||||
cd .export/win
|
||||
zip win.zip *
|
||||
butler push web.zip zink-exe/seeding-the-wasteland-prototype:win --userversion $VERSION
|
||||
@ -45,10 +45,10 @@ y_sort_enabled = true
|
||||
position = Vector2(33, -75)
|
||||
|
||||
[node name="TruckLadder" parent="Entities" instance=ExtResource("9_gisiu")]
|
||||
position = Vector2(33, -139)
|
||||
position = Vector2(50, -135)
|
||||
|
||||
[node name="TruckRecharge" parent="Entities" instance=ExtResource("10_cnjsq")]
|
||||
position = Vector2(-36, -154)
|
||||
position = Vector2(-46, -152)
|
||||
|
||||
[node name="Planet" parent="." node_paths=PackedStringArray("quota_reward", "import_entities_from_node") instance=ExtResource("8_t31p7")]
|
||||
loot_item_number = Array[int]([1])
|
||||
|
||||
@ -64,14 +64,11 @@ func plant(
|
||||
type,
|
||||
plant_mutations
|
||||
)
|
||||
|
||||
plants.append(new_plant)
|
||||
planet_data.score_by_plant.append(0)
|
||||
new_plant.harvested.connect(_on_plant_harvested)
|
||||
new_plant.state_changed.connect(_on_plant_state_changed)
|
||||
new_plant.ready.connect(
|
||||
func(): update_garden_score()
|
||||
)
|
||||
get_tree().create_timer(0.05).timeout.connect(update_garden_score)
|
||||
return new_plant
|
||||
|
||||
func _on_plant_state_changed(_p: Plant):
|
||||
@ -85,7 +82,8 @@ func remove_plant(p: Plant):
|
||||
if id >= 0:
|
||||
plants.remove_at(id)
|
||||
planet_data.score_by_plant.remove_at(id)
|
||||
update_garden_score()
|
||||
|
||||
get_tree().create_timer(0.05).timeout.connect(update_garden_score)
|
||||
|
||||
|
||||
func update_garden_score():
|
||||
|
||||
@ -116,7 +116,6 @@ func plant(
|
||||
if garden.is_in_garden(plant_position):
|
||||
var new_plant = garden.plant(type, plant_mutations)
|
||||
add_entity(new_plant, plant_position)
|
||||
garden.update_garden_score()
|
||||
return true
|
||||
return false
|
||||
|
||||
@ -142,8 +141,7 @@ func pass_day():
|
||||
|
||||
if data.garden_score >= data.get_quota_score():
|
||||
reach_quota()
|
||||
|
||||
if data.quota_days <= 0:
|
||||
elif data.quota_days <= 0:
|
||||
day_limit_exceed.emit(self)
|
||||
|
||||
save()
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
extends Resource
|
||||
class_name TruckData
|
||||
|
||||
@export var rewards_given : Array[Reward] = []
|
||||
@export var rewards : Array[Reward] = []
|
||||
@export var rewarded_times : int = 0
|
||||
@export var compost_containing_seeds : Array[int] = []
|
||||
@export var entities_saved_data : Array[EntityData] = []
|
||||
@export var entities_saved_data : Array[EntityData] = []
|
||||
|
||||
@ -21,7 +21,10 @@ func _ready():
|
||||
for i in range(len(composts)):
|
||||
var compost = composts[i]
|
||||
compost.containing_seed = data.compost_containing_seeds[i]
|
||||
compost.filled.connect(func (c: Compost): data.compost_containing_seeds[i] = c.containing_seed)
|
||||
compost.filled.connect(
|
||||
func (c: Compost):
|
||||
data.compost_containing_seeds[i] = c.containing_seed
|
||||
)
|
||||
|
||||
if i < len(data.rewards):
|
||||
compost.reward = data.rewards[i]
|
||||
@ -35,6 +38,7 @@ func _ready():
|
||||
|
||||
func _on_compost_rewarded(c: Compost):
|
||||
data.rewarded_times += 1
|
||||
data.rewards_given.append(c.reward)
|
||||
c.reward = generate_reward()
|
||||
|
||||
func get_compost_rewards() -> Array[Reward]:
|
||||
@ -45,26 +49,41 @@ func get_compost_rewards() -> Array[Reward]:
|
||||
return rewards
|
||||
|
||||
func get_random_reward_cost() -> int:
|
||||
return randi_range(1 + data.rewarded_times * 2, 2 + data.rewarded_times * 2)
|
||||
return randi_range(data.rewarded_times + 1, data.rewarded_times + 2)
|
||||
|
||||
func get_possible_rewards() -> Array[Reward]:
|
||||
return [
|
||||
var possible_rewards : Array[Reward] = [
|
||||
UpgradeMaxEnergyReward.new(get_random_reward_cost() + 2),
|
||||
UpgradeMaxInventoryReward.new(get_random_reward_cost()),
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Blueprint.new(preload("res://entities/interactables/machines/solar_pannel/solar_pannel.tres"))
|
||||
),
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Knife.new()
|
||||
),
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Trowel.new()
|
||||
)
|
||||
]
|
||||
|
||||
if data.rewards_given.find_custom(
|
||||
func(r : Reward):
|
||||
return r is GiveItemReward and r.item is Trowel
|
||||
) == -1:
|
||||
possible_rewards.append(
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Knife.new()
|
||||
)
|
||||
)
|
||||
if data.rewards_given.find_custom(
|
||||
func(r : Reward):
|
||||
return r is GiveItemReward and r.item is Knife
|
||||
) == -1:
|
||||
possible_rewards.append(
|
||||
GiveItemReward.new(
|
||||
get_random_reward_cost(),
|
||||
Trowel.new()
|
||||
)
|
||||
)
|
||||
|
||||
return possible_rewards
|
||||
|
||||
func generate_reward() -> Reward:
|
||||
var max_tries = 3
|
||||
var reward = get_possible_rewards().pick_random()
|
||||
|
||||
BIN
stages/title_screen/assets/textures/title.png
Normal file
BIN
stages/title_screen/assets/textures/title.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
40
stages/title_screen/assets/textures/title.png.import
Normal file
40
stages/title_screen/assets/textures/title.png.import
Normal file
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cdpqg3pkjcw2h"
|
||||
path="res://.godot/imported/title.png-d45063d896f6ee3d177f9178ce51f6b0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/title_screen/assets/textures/title.png"
|
||||
dest_files=["res://.godot/imported/title.png-d45063d896f6ee3d177f9178ce51f6b0.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
|
||||
@ -7,12 +7,14 @@ class_name Planet3D
|
||||
@export var radius : float = 8.0 :
|
||||
set(v):
|
||||
radius = maxf(1.0, v)
|
||||
update_terrain()
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
update_water()
|
||||
@export var details : int = 64:
|
||||
set(v):
|
||||
details = maxi(1,v)
|
||||
update_terrain()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
|
||||
|
||||
@export_group("Terrain")
|
||||
@ -24,8 +26,9 @@ class_name Planet3D
|
||||
@export var height : float = 1.0 :
|
||||
set(v):
|
||||
height = maxf(0.0, v)
|
||||
update_terrain()
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
update_water()
|
||||
@export var terrain_material : Material:
|
||||
set(v):
|
||||
terrain_material = v
|
||||
@ -34,17 +37,20 @@ class_name Planet3D
|
||||
|
||||
@export_tool_button("Random Noise", "Callable") var update_action = func():
|
||||
noise = generate_noise()
|
||||
update_terrain()
|
||||
if is_node_ready():
|
||||
update_terrain()
|
||||
|
||||
@export_group("Water")
|
||||
@export_range(0.0,1.0,0.05) var water_level := 0.:
|
||||
set(v):
|
||||
water_level = v
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_water()
|
||||
@export var water_detail := 64:
|
||||
set(v):
|
||||
water_detail = maxi(1, v)
|
||||
update_water()
|
||||
if is_node_ready():
|
||||
update_water()
|
||||
@export var water_material : Material:
|
||||
set(v):
|
||||
water_material = v
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_4ph5l"]
|
||||
[ext_resource type="Script" uid="uid://cwmp2une7hobe" path="res://stages/title_screen/scripts/title_screen.gd" id="1_6yuhi"]
|
||||
[ext_resource type="Texture2D" uid="uid://nx4wxpr6mk8l" path="res://gui/menu/assets/texture/SeedingPlanetsLogo.png" id="2_qnk88"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_6yuhi"]
|
||||
[ext_resource type="Texture2D" uid="uid://cdpqg3pkjcw2h" path="res://stages/title_screen/assets/textures/title.png" id="3_y6tw6"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_y6tw6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm5b7w7j6527f" path="res://stages/title_screen/planet_3d.tscn" id="5_7a1qq"]
|
||||
[ext_resource type="Shader" uid="uid://bv2rghn44mrrf" path="res://stages/title_screen/resources/shaders/stars.gdshader" id="7_y6tw6"]
|
||||
@ -11,8 +11,8 @@
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_6yuhi"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_6yuhi"]
|
||||
seed = 263046432
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_7a1qq"]
|
||||
seed = -856983584
|
||||
frequency = 1.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_7a1qq"]
|
||||
@ -87,7 +87,7 @@ alignment = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 20
|
||||
theme_override_constants/separation = 40
|
||||
alignment = 1
|
||||
|
||||
[node name="Logo" type="TextureRect" parent="MarginContainer/GridContainer/VBoxContainer"]
|
||||
@ -96,7 +96,7 @@ custom_minimum_size = Vector2(400, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource("2_qnk88")
|
||||
texture = ExtResource("3_y6tw6")
|
||||
expand_mode = 5
|
||||
stretch_mode = 5
|
||||
|
||||
@ -168,7 +168,7 @@ size = Vector2i(1980, 1080)
|
||||
|
||||
[node name="Planet3d" parent="SubViewport" instance=ExtResource("5_7a1qq")]
|
||||
unique_name_in_owner = true
|
||||
noise = SubResource("FastNoiseLite_6yuhi")
|
||||
noise = SubResource("FastNoiseLite_7a1qq")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="SubViewport"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 64.323425)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user