Compare commits
20 Commits
f6ad0e08e9
...
6687235094
| Author | SHA1 | Date | |
|---|---|---|---|
| 6687235094 | |||
| e083aac700 | |||
| a496130e5b | |||
| 010b4702f6 | |||
| ce87292032 | |||
| 356ffb1e7b | |||
| 0882b06be7 | |||
| 18b48f5320 | |||
| 165a4d129b | |||
| 2dc365736f | |||
| 3d0104ed4a | |||
| dbb6855585 | |||
| bd852b007c | |||
| 3bbb1cfcdc | |||
| 22797a9ba3 | |||
| 90d5e92740 | |||
| 29cac5bbc0 | |||
| 5d0104d029 | |||
| 49e16d12f8 | |||
| 52b2df8639 |
@ -5,8 +5,6 @@ const TERRAIN_IMAGE_GAME_FACTOR = 40
|
||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE = 300
|
||||
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE = 50
|
||||
|
||||
signal terrain_updated
|
||||
|
||||
@export var terrainSize : Vector2 = Vector2(1000,1000)
|
||||
|
||||
@export var contamination : Image = null
|
||||
@ -62,15 +60,27 @@ func impact_contamination(position : Vector2, impact_radius : int, to_value : fl
|
||||
Color(1., 1., 1., to_value)
|
||||
)
|
||||
|
||||
func is_in_image(pixel_point : Vector2, image : Image):
|
||||
return (
|
||||
pixel_point.x > 0
|
||||
and pixel_point.y > 0
|
||||
and pixel_point.x < image.get_width()
|
||||
and pixel_point.y < image.get_height())
|
||||
|
||||
func get_contamination(point : Vector2) -> float:
|
||||
var pixel_point : Vector2 = (
|
||||
Vector2(point) / float(TERRAIN_IMAGE_GAME_FACTOR)
|
||||
- Vector2.ONE / 2
|
||||
)
|
||||
return contamination.get_pixel(
|
||||
int(round(pixel_point.x)),
|
||||
int(round(pixel_point.y))
|
||||
).r
|
||||
var pixel_point : Vector2 = get_pixel_point(point)
|
||||
if (is_in_image(pixel_point, contamination)):
|
||||
return contamination.get_pixel(
|
||||
int(round(pixel_point.x)),
|
||||
int(round(pixel_point.y))
|
||||
).r
|
||||
return 0
|
||||
|
||||
func get_decontamination_coverage() -> float:
|
||||
return ImageTools.get_color_coverage(contamination)
|
||||
|
||||
func get_pixel_point(point : Vector2) -> Vector2:
|
||||
return (
|
||||
Vector2(point) / float(TERRAIN_IMAGE_GAME_FACTOR)
|
||||
- Vector2.ONE / 2
|
||||
)
|
||||
|
||||
1
common/inventory/assets/icons/package.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-package"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5" /><path d="M12 12l8 -4.5" /><path d="M12 12l0 9" /><path d="M12 12l-8 -4.5" /><path d="M16 5.25l-8 4.5" /></svg>
|
||||
|
After Width: | Height: | Size: 468 B |
37
common/inventory/assets/icons/package.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://0xg54agef5gh"
|
||||
path="res://.godot/imported/package.svg-a9602fd424cfb199cd9405d02663e7df.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/inventory/assets/icons/package.svg"
|
||||
dest_files=["res://.godot/imported/package.svg-a9602fd424cfb199cd9405d02663e7df.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
15
common/inventory/resources/items/compost.tres
Normal file
@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="Package" load_steps=4 format=3 uid="uid://bya8sm6rm6747"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://0xg54agef5gh" path="res://common/inventory/assets/icons/package.svg" id="1_lhhdv"]
|
||||
[ext_resource type="Script" uid="uid://b6kubqgq0k7vj" path="res://common/inventory/scripts/items/package.gd" id="1_x02bb"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkwh1ntvgkkrt" path="res://entities/interactables/machines/compost/compost.tscn" id="2_uulso"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_x02bb")
|
||||
scene = ExtResource("2_uulso")
|
||||
name = "Compost"
|
||||
description = "Compost"
|
||||
icon = ExtResource("1_lhhdv")
|
||||
use_zone_radius = 5
|
||||
use_energy = 1
|
||||
metadata/_custom_type_script = "uid://b6kubqgq0k7vj"
|
||||
@ -5,7 +5,9 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_mgcdi")
|
||||
plant_type = ""
|
||||
name = "Boule"
|
||||
description = ""
|
||||
icon = ExtResource("1_dy25s")
|
||||
use_zone_radius = 5
|
||||
use_energy = 1
|
||||
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_28h2r")
|
||||
area_width = 50.0
|
||||
area_distance = 50.0
|
||||
name = "Shovel"
|
||||
description = "Can dig burried seed, and transform mature plants to seeds."
|
||||
icon = ExtResource("1_7g3xd")
|
||||
use_zone_radius = 50
|
||||
use_energy = 1
|
||||
metadata/_custom_type_script = "uid://dya38x1h1uiyg"
|
||||
|
||||
@ -45,6 +45,13 @@ func get_item(ind: int = 0) -> Item:
|
||||
return null;
|
||||
return items[ind]
|
||||
|
||||
func has_item(item : Item) -> bool:
|
||||
return item in items
|
||||
|
||||
func remove_item(item : Item):
|
||||
items.erase(item)
|
||||
emit_signal("inventory_changed", self)
|
||||
|
||||
func pop_item(ind: int = 0) -> Item:
|
||||
var item_removed: Item = items.pop_at(ind)
|
||||
emit_signal("inventory_changed", self)
|
||||
@ -55,3 +62,4 @@ func swap_items(item_to_add: Item, ind_to_get: int = 0) -> Item:
|
||||
items[ind_to_get] = item_to_add
|
||||
emit_signal("inventory_changed", self)
|
||||
return item_to_get
|
||||
|
||||
|
||||
@ -4,15 +4,20 @@ class_name Item
|
||||
@export var name: String
|
||||
@export_multiline var description: String
|
||||
@export var icon: Texture2D
|
||||
@export var use_zone_radius: int = 5
|
||||
@export var use_energy: int = 1
|
||||
|
||||
func is_one_time_use():
|
||||
return false
|
||||
|
||||
func can_use(_player : Player) -> bool:
|
||||
func can_use(_player : Player, zone: Area2D) -> bool:
|
||||
return false
|
||||
|
||||
func use_text() -> String:
|
||||
return ""
|
||||
|
||||
func use_requirement_text() -> String:
|
||||
return ""
|
||||
|
||||
func use(_player : Player) -> bool:
|
||||
return false
|
||||
func use(_player : Player, zone: Area2D):
|
||||
return false
|
||||
|
||||
20
common/inventory/scripts/items/package.gd
Normal file
@ -0,0 +1,20 @@
|
||||
extends Item
|
||||
class_name Package
|
||||
|
||||
@export var scene: PackedScene
|
||||
|
||||
func _init(_scene : PackedScene = null):
|
||||
scene = _scene
|
||||
|
||||
func use_text() -> String:
|
||||
return "Build " + name
|
||||
|
||||
func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player, zone : Area2D) -> bool:
|
||||
return player.planet.is_in_zone(zone.global_position)
|
||||
|
||||
func use(player : Player, zone : Area2D) -> bool:
|
||||
player.planet.instantiate_entity(scene, zone.global_position)
|
||||
return true
|
||||
1
common/inventory/scripts/items/package.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b6kubqgq0k7vj
|
||||
@ -13,13 +13,15 @@ class_name Seed
|
||||
func _init(_plant_type : PlantType = null):
|
||||
plant_type = _plant_type
|
||||
|
||||
func use_text() -> String:
|
||||
return "Plant " + plant_type.name
|
||||
|
||||
func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player) -> bool:
|
||||
return not player.planet.is_there_contamination(player.global_position)
|
||||
func can_use(player : Player, zone : Area2D) -> bool:
|
||||
return not player.planet.is_there_contamination(zone.global_position)
|
||||
|
||||
func use(player : Player) -> bool:
|
||||
if not can_use(player):
|
||||
return false
|
||||
return player.planet.plant(plant_type, player.global_position)
|
||||
func use(player : Player, zone : Area2D) -> bool:
|
||||
player.play_sfx("dig")
|
||||
return player.planet.plant(plant_type, zone.global_position)
|
||||
|
||||
@ -1,21 +1,32 @@
|
||||
extends ToolItem
|
||||
extends Item
|
||||
class_name Shovel
|
||||
|
||||
func can_use(player : Player) -> bool:
|
||||
var areas = player.action_area.get_overlapping_areas()
|
||||
for area in areas :
|
||||
if area is Plant or area is UndergroundLoot:
|
||||
return true
|
||||
return false
|
||||
const USE_INTERVAL = 0.15
|
||||
|
||||
func use(player : Player) -> bool:
|
||||
if not can_use(player):
|
||||
return false
|
||||
func use_text() -> String:
|
||||
return "Dig"
|
||||
|
||||
var areas = player.action_area.get_overlapping_areas()
|
||||
for area in areas :
|
||||
if area is Plant:
|
||||
area.harvest()
|
||||
if area is UndergroundLoot:
|
||||
area.dig()
|
||||
return true
|
||||
func can_use(_player : Player, zone : Area2D) -> bool:
|
||||
var areas = zone.get_overlapping_areas()
|
||||
for area in areas :
|
||||
if area is Plant or area is UndergroundLoot:
|
||||
return true
|
||||
return false
|
||||
|
||||
func use(player : Player, zone : Area2D) -> bool:
|
||||
dig(
|
||||
zone.get_overlapping_areas(),
|
||||
player
|
||||
)
|
||||
|
||||
return true
|
||||
|
||||
func dig(areas: Array[Area2D], player: Player):
|
||||
for area in areas :
|
||||
if area is Plant:
|
||||
player.play_sfx("harvest")
|
||||
area.harvest()
|
||||
if area is UndergroundLoot:
|
||||
player.play_sfx("dig")
|
||||
area.dig()
|
||||
await player.get_tree().create_timer(USE_INTERVAL).timeout
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
extends Item
|
||||
class_name ToolItem
|
||||
|
||||
@export var area_width: float = 50
|
||||
@export var area_distance: float = 50
|
||||
|
||||
func generate_action_area():
|
||||
return ActionArea.new(
|
||||
area_width,
|
||||
area_distance
|
||||
)
|
||||
@ -1 +0,0 @@
|
||||
uid://jom8ulyopso
|
||||
@ -1,8 +1,7 @@
|
||||
@tool
|
||||
extends Interactable
|
||||
class_name ItemObject
|
||||
|
||||
const ITEM_AREA_WIDTH = 10
|
||||
const ITEM_AREA_WIDTH = 20
|
||||
const ITEM_SPRITE_SIZE = 40.
|
||||
const SPRITE_SCENE : PackedScene = preload("res://entities/interactables/item_object/item_object_sprite.tscn")
|
||||
|
||||
@ -19,7 +18,16 @@ func _init(_item = null):
|
||||
item = _item
|
||||
|
||||
func _ready():
|
||||
generate_collision(10)
|
||||
generate_collision(ITEM_AREA_WIDTH)
|
||||
if item and object_sprite:
|
||||
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
|
||||
|
||||
|
||||
func inspected_text():
|
||||
return item.name + (" Seed" if item is Seed else "")
|
||||
|
||||
func interact_text():
|
||||
return "Take"
|
||||
|
||||
func interact(player : Player) -> bool:
|
||||
var swapped_item = player.inventory.get_item()
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://f2rte5jc0psp"
|
||||
path="res://.godot/imported/compost.svg-503fc2423ba701b15edd51da5ab01164.ctex"
|
||||
path="res://.godot/imported/compost.svg-f43ad0f7b40754d19aa7d5ea88e80cb8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/compost/assets/sprites/compost.svg"
|
||||
dest_files=["res://.godot/imported/compost.svg-503fc2423ba701b15edd51da5ab01164.ctex"]
|
||||
source_file="res://entities/interactables/machines/compost/assets/sprites/compost.svg"
|
||||
dest_files=["res://.godot/imported/compost.svg-f43ad0f7b40754d19aa7d5ea88e80cb8.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://bkwh1ntvgkkrt"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dw6jgsasb2fe1" path="res://entities/interactables/compost/scripts/compost.gd" id="1_1758a"]
|
||||
[ext_resource type="Texture2D" uid="uid://f2rte5jc0psp" path="res://entities/interactables/compost/assets/sprites/compost.svg" id="2_r6435"]
|
||||
[ext_resource type="Script" uid="uid://dw6jgsasb2fe1" path="res://entities/interactables/machines/compost/scripts/compost.gd" id="1_c0pig"]
|
||||
[ext_resource type="Texture2D" uid="uid://f2rte5jc0psp" path="res://entities/interactables/machines/compost/assets/sprites/compost.svg" id="2_r6435"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_etofw"]
|
||||
bg_color = Color(0.260098, 0.11665, 0.0419712, 0.231373)
|
||||
@ -17,8 +17,32 @@ corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_coj8m"]
|
||||
size = Vector2(77, 92)
|
||||
[sub_resource type="Animation" id="Animation_r6435"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Compost:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.291262, 0.291262)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Compost:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1758a"]
|
||||
resource_name = "empty"
|
||||
@ -48,33 +72,6 @@ tracks/1/keys = {
|
||||
"values": [Vector2(0.291262, 0.291262), Vector2(0.291, 0.191), Vector2(0.291, 0.366), Vector2(0.291262, 0.291262)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_r6435"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Compost:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.291262, 0.291262)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Compost:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_etofw"]
|
||||
resource_name = "fill"
|
||||
length = 0.3
|
||||
@ -98,8 +95,11 @@ _data = {
|
||||
&"fill": SubResource("Animation_etofw")
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_akkx7"]
|
||||
size = Vector2(66, 84)
|
||||
|
||||
[node name="Compost" type="Area2D"]
|
||||
script = ExtResource("1_1758a")
|
||||
script = ExtResource("1_c0pig")
|
||||
|
||||
[node name="Compost" type="Sprite2D" parent="."]
|
||||
modulate = Color(0.615686, 0.501961, 0.270588, 1)
|
||||
@ -114,16 +114,13 @@ offset_right = 62.0
|
||||
offset_bottom = 120.0
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_etofw")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_3ao1n")
|
||||
value = 20.0
|
||||
fill_mode = 3
|
||||
show_percentage = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(-0.5, 2)
|
||||
shape = SubResource("RectangleShape2D_coj8m")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_etofw")
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_akkx7")
|
||||
@ -1,16 +1,17 @@
|
||||
extends Interactable
|
||||
extends Machine
|
||||
class_name Compost
|
||||
|
||||
|
||||
@export var value_per_seed : float = 0.5
|
||||
|
||||
var value_per_seed : float = 0.5
|
||||
var fill_value : float = 0.
|
||||
|
||||
func _process(_delta):
|
||||
%ProgressBar.value = lerp(%ProgressBar.value, fill_value * 100, 0.5)
|
||||
|
||||
func _ready():
|
||||
fill_value = 0.
|
||||
func inspected_text():
|
||||
return "Compost"
|
||||
|
||||
func interact_text():
|
||||
return "Put a seed ("+str(roundi((1-fill_value)/value_per_seed))+" left)"
|
||||
|
||||
func can_interact(p : Player) -> bool:
|
||||
return p.inventory.get_item() and p.inventory.get_item() is Seed
|
||||
@ -22,7 +23,8 @@ func interact(p : Player) -> bool:
|
||||
if not can_interact(p):
|
||||
return false
|
||||
|
||||
p.delete_item()
|
||||
p.play_sfx("harvest")
|
||||
p.delete_item(p.inventory.get_item())
|
||||
fill_value += value_per_seed
|
||||
if fill_value >= 1.:
|
||||
$AnimationPlayer.play("empty")
|
||||
@ -3,12 +3,12 @@
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://cjo6ea86rfqbe"
|
||||
path="res://.godot/imported/compost_level_up.wav-d796efae9b651b45ecdda95fd157999a.sample"
|
||||
path="res://.godot/imported/compost_level_up.wav-18f25f0720265f21705081af070ef8cd.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/compost/sounds/compost_level_up.wav"
|
||||
dest_files=["res://.godot/imported/compost_level_up.wav-d796efae9b651b45ecdda95fd157999a.sample"]
|
||||
source_file="res://entities/interactables/machines/compost/sounds/compost_level_up.wav"
|
||||
dest_files=["res://.godot/imported/compost_level_up.wav-18f25f0720265f21705081af070ef8cd.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="65.888519mm"
|
||||
height="56.356422mm"
|
||||
viewBox="0 0 65.888519 56.356422"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
|
||||
sodipodi:docname="recharge_station.svg"
|
||||
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">
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="1.5821549"
|
||||
inkscape:cx="45.82358"
|
||||
inkscape:cy="147.89955"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1009"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs1" />
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-72.05574,-18.228039)">
|
||||
<rect
|
||||
style="fill:#d1d1d1;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="rect1"
|
||||
width="16.054054"
|
||||
height="35.392433"
|
||||
x="96.972969"
|
||||
y="18.228039"
|
||||
rx="5"
|
||||
ry="5" />
|
||||
<ellipse
|
||||
style="fill:#ffffff;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="path1"
|
||||
cx="105"
|
||||
cy="60.537163"
|
||||
rx="32.94426"
|
||||
ry="14.047297" />
|
||||
<ellipse
|
||||
style="fill:#d1d1d1;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="ellipse1"
|
||||
cx="105"
|
||||
cy="60.537163"
|
||||
rx="16.221287"
|
||||
ry="6.9166899" />
|
||||
<circle
|
||||
style="fill:#ffffff;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="path2"
|
||||
cx="105"
|
||||
cy="26.171452"
|
||||
r="5.685811" />
|
||||
<g
|
||||
id="g3"
|
||||
transform="translate(0.20904541)">
|
||||
<circle
|
||||
style="fill:#d1d1d1;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="circle2"
|
||||
cx="102.61697"
|
||||
cy="26.171452"
|
||||
r="1.5050678" />
|
||||
<circle
|
||||
style="fill:#d1d1d1;fill-opacity:1;stroke-width:0.264583;stroke-linecap:square"
|
||||
id="circle3"
|
||||
cx="106.96494"
|
||||
cy="26.171452"
|
||||
r="1.5050678" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c82ljr3in67am"
|
||||
path="res://.godot/imported/recharge_station.svg-b4dbe96f287bff2995b6160acd3f32ff.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/machines/recharge_station/assets/sprites/recharge_station.svg"
|
||||
dest_files=["res://.godot/imported/recharge_station.svg-b4dbe96f287bff2995b6160acd3f32ff.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
@ -0,0 +1,23 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d324mlmgls4fs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/machines/recharge_station/scripts/recharge_station.gd" id="1_2ffjo"]
|
||||
[ext_resource type="Texture2D" uid="uid://c82ljr3in67am" path="res://entities/interactables/machines/recharge_station/assets/sprites/recharge_station.svg" id="2_58ax0"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
|
||||
radius = 15.0
|
||||
height = 72.0
|
||||
|
||||
[node name="RechargeStation" type="Area2D"]
|
||||
modulate = Color(0.615686, 0.501961, 0.270588, 1)
|
||||
script = ExtResource("1_2ffjo")
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="RechargeStation" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -17)
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture = ExtResource("2_58ax0")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(1, -1)
|
||||
rotation = -1.5708
|
||||
shape = SubResource("CapsuleShape2D_bjhct")
|
||||
@ -0,0 +1,13 @@
|
||||
extends Machine
|
||||
class_name RechargeStation
|
||||
|
||||
var planet : Planet # mis à jour par la classe Planet
|
||||
|
||||
func interact(_p: Player) -> bool:
|
||||
|
||||
planet.pass_day()
|
||||
|
||||
return true
|
||||
|
||||
func interact_text():
|
||||
return "Recharge"
|
||||
@ -0,0 +1 @@
|
||||
uid://bsrn3gd2a532q
|
||||
2
entities/interactables/machines/scripts/machine.gd
Normal file
@ -0,0 +1,2 @@
|
||||
extends Interactable
|
||||
class_name Machine
|
||||
1
entities/interactables/machines/scripts/machine.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://du7qppxobx5nd
|
||||
@ -1,25 +1,27 @@
|
||||
extends Area2D
|
||||
extends InspectableEntity
|
||||
class_name Interactable
|
||||
|
||||
var available : bool = true
|
||||
|
||||
func _ready():
|
||||
printerr("Abstract Interactable class used")
|
||||
|
||||
func can_interact(_p : Player) -> bool:
|
||||
return true
|
||||
return true
|
||||
|
||||
func interact_requirement_text() -> String:
|
||||
return ""
|
||||
func interaction_cost(_p : Player) -> int:
|
||||
return 0
|
||||
|
||||
func interact(_p : Player) -> bool:
|
||||
printerr("Interact function called on abstract Interactable class")
|
||||
return false
|
||||
func interact(_p : Player) -> bool:
|
||||
printerr("Interact function called on abstract Interactable class")
|
||||
return false
|
||||
|
||||
func generate_collision(area_width : float):
|
||||
var collision = CollisionShape2D.new()
|
||||
var collision_shape = CircleShape2D.new()
|
||||
collision_shape.radius = area_width
|
||||
func generate_collision(area_width : float) -> CollisionShape2D:
|
||||
var collision = CollisionShape2D.new()
|
||||
var collision_shape = CircleShape2D.new()
|
||||
collision_shape.radius = area_width
|
||||
|
||||
collision.shape = collision_shape
|
||||
add_child(collision)
|
||||
collision.shape = collision_shape
|
||||
add_child(collision)
|
||||
|
||||
return collision
|
||||
|
||||
func interact_text():
|
||||
return ""
|
||||
|
||||
@ -3,6 +3,61 @@
|
||||
[ext_resource type="Script" uid="uid://bmjjpk4lvijws" path="res://entities/plants/scripts/plant_sprite.gd" id="1_pq8o7"]
|
||||
[ext_resource type="Texture2D" uid="uid://b3wom2xu26g43" path="res://entities/plants/assets/sprites/default_plant_glowing.png" id="2_hyinx"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_wyuub"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.15, 0.15)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:skew")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite2D:modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_j6jm5"]
|
||||
resource_name = "bump"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:scale")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.15, 0.15), Vector2(0.15, 0.075), Vector2(0.15, 0.15)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_rbgiq"]
|
||||
resource_name = "harvest"
|
||||
length = 0.2
|
||||
@ -31,85 +86,6 @@ tracks/1/keys = {
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_j6jm5"]
|
||||
resource_name = "bump"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:scale")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.233333, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.15, 0.15), Vector2(0.15, 0.075), Vector2(0.15, 0.15)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:position")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.233333, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, 17.475), Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_wyuub"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.15, 0.15)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Sprite2D:skew")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Sprite2D:modulate")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_8eofq"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_wyuub"),
|
||||
|
||||
@ -2,14 +2,14 @@
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c7mp7tkkkk6o5" path="res://entities/plants/assets/sprites/default/growing.png" id="1_fp5j6"]
|
||||
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_moyj3"]
|
||||
[ext_resource type="Script" uid="uid://cgscbuxe4dawb" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_cky1j"]
|
||||
[ext_resource type="Script" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_cky1j"]
|
||||
[ext_resource type="Texture2D" uid="uid://bupl1y0cfj21q" path="res://entities/plants/assets/sprites/default/mature.png" id="3_ffarr"]
|
||||
[ext_resource type="Texture2D" uid="uid://ba413oun7ry78" path="res://entities/plants/assets/sprites/default/planted.png" id="4_2s6re"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_cky1j"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_q68uy"]
|
||||
script = ExtResource("2_cky1j")
|
||||
impact_radius = 100
|
||||
impact_radius = 150
|
||||
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qt76e"]
|
||||
@ -19,7 +19,7 @@ region = Rect2(1140, 345, 141, 128)
|
||||
[resource]
|
||||
script = ExtResource("1_moyj3")
|
||||
name = "Chardi"
|
||||
description = "This plant reduce contamination around when it becomes mature."
|
||||
description = "This plant remove a lot of contamination around when it becomes mature."
|
||||
growing_time = 1
|
||||
seed_texture = SubResource("AtlasTexture_qt76e")
|
||||
planted_texture = ExtResource("4_2s6re")
|
||||
@ -1,11 +1,17 @@
|
||||
[gd_resource type="Resource" script_class="PlantType" load_steps=7 format=3 uid="uid://dsctivn1vrem2"]
|
||||
[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://dsctivn1vrem2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://jnye5pe1bgqw" path="res://entities/plants/scripts/plant_type.gd" id="1_eqtut"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwr3c6r6piwaa" path="res://entities/plants/assets/sprites/maias/growing.png" id="1_vyplc"]
|
||||
[ext_resource type="Script" path="res://entities/plants/scripts/plant_effects/decontaminate_terrain_effect.gd" id="2_vyplc"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3apfwbqsg5ha" path="res://entities/plants/assets/sprites/maias/mature.png" id="3_pi4ie"]
|
||||
[ext_resource type="Texture2D" uid="uid://cpx7bkrvttasr" path="res://entities/plants/assets/sprites/maias/planted.png" id="4_iqcy2"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="6_mwrj8"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_q4pje"]
|
||||
script = ExtResource("2_vyplc")
|
||||
impact_radius = 20
|
||||
metadata/_custom_type_script = "uid://cgscbuxe4dawb"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sri3b"]
|
||||
atlas = ExtResource("6_mwrj8")
|
||||
region = Rect2(1697, 331, 125, 158)
|
||||
@ -13,12 +19,13 @@ region = Rect2(1697, 331, 125, 158)
|
||||
[resource]
|
||||
script = ExtResource("1_eqtut")
|
||||
name = "Maias"
|
||||
description = "This gorgeous flower has no effect, but produce a lot of seeds."
|
||||
description = "This gorgeous flower produce a lot of seeds."
|
||||
growing_time = 1
|
||||
seed_texture = SubResource("AtlasTexture_sri3b")
|
||||
planted_texture = ExtResource("4_iqcy2")
|
||||
growing_texture = ExtResource("1_vyplc")
|
||||
mature_texture = ExtResource("3_pi4ie")
|
||||
mature_effect = SubResource("Resource_q4pje")
|
||||
harvest_types_path = Array[String](["uid://b04vho33bl52b", "uid://dsctivn1vrem2"])
|
||||
harvest_number = Array[int]([3, 4])
|
||||
metadata/_custom_type_script = "uid://jnye5pe1bgqw"
|
||||
@ -1,11 +1,10 @@
|
||||
extends Area2D
|
||||
extends InspectableEntity
|
||||
class_name Plant
|
||||
|
||||
const PLANT_AREA_WIDTH = 10
|
||||
const PLANT_SPRITE_SCALE = 0.15
|
||||
const PLANT_AREA_WIDTH = 20
|
||||
const HARVESTED_SEED_POSITION_RANGE = 100
|
||||
|
||||
const RANDOM_MAX_GROW_INTERVAL = 0.4
|
||||
const RANDOM_MAX_GROW_INTERVAL = Planet.PASS_DAY_ANIMATION_TIME/2. - 0.1
|
||||
|
||||
const SPRITE_SCENE : PackedScene = preload("res://entities/plants/plant_sprite.tscn")
|
||||
|
||||
@ -24,6 +23,11 @@ func _init(_plant_type = null, _planet = null):
|
||||
plant_type = _plant_type
|
||||
planet = _planet
|
||||
|
||||
func inspected_text():
|
||||
var state_text = "Growing"
|
||||
if state == State.MATURE: state_text = "Mature"
|
||||
return state_text + " " + plant_type.name
|
||||
|
||||
func generate_sprite() -> PlantSprite:
|
||||
var spriteObject : PlantSprite = SPRITE_SCENE.instantiate()
|
||||
|
||||
@ -55,9 +59,11 @@ func set_day(d):
|
||||
if day == 0:
|
||||
change_state(State.PLANTED)
|
||||
if day > plant_type.growing_time:
|
||||
change_state(State.MATURE)
|
||||
if state != State.MATURE:
|
||||
change_state(State.MATURE)
|
||||
else:
|
||||
change_state(State.GROWING)
|
||||
if state != State.GROWING:
|
||||
change_state(State.GROWING)
|
||||
|
||||
func change_state(_state: State):
|
||||
state = _state
|
||||
|
||||
@ -10,6 +10,7 @@ func apply_texture_to_sprite(texture, with_animation = true):
|
||||
$AnimationPlayer.play("bump")
|
||||
await $AnimationPlayer.animation_finished
|
||||
sprite.texture = texture
|
||||
sprite.flip_h = true if randi()%2 == 0 else false
|
||||
|
||||
func start_harvest_animation():
|
||||
$AnimationPlayer.play("harvest")
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=23 format=3 uid="uid://bgvbgeq46wee2"]
|
||||
[gd_scene load_steps=24 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="AudioStream" uid="uid://dfrp66a4isnt6" path="res://entities/player/sounds/dig/dig_1.wav" id="3_gx6sm"]
|
||||
[ext_resource type="Texture2D" uid="uid://bf6nw4onkhavr" path="res://common/inventory/assets/icons/shovel.svg" id="3_yqrof"]
|
||||
[ext_resource type="AudioStream" uid="uid://bdxkvaciw4mb3" path="res://entities/player/sounds/dig/dig_2.wav" id="4_yqrof"]
|
||||
[ext_resource type="AudioStream" uid="uid://llxrlwfccywb" path="res://entities/player/sounds/dig/dig_3.wav" id="5_3wlsy"]
|
||||
[ext_resource type="AudioStream" uid="uid://8nmr5vifkt1f" path="res://entities/player/sounds/harvest/harvest_1.wav" id="6_b2kln"]
|
||||
@ -60,9 +61,15 @@ script = ExtResource("1_abrql")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
position = Vector2(2, -46)
|
||||
scale = Vector2(0.084375, 0.084375)
|
||||
scale = Vector2(0.08, 0.08)
|
||||
texture = ExtResource("1_symyc")
|
||||
|
||||
[node name="ItemSprite" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
position = Vector2(0, 5)
|
||||
texture = ExtResource("3_yqrof")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-2, -18)
|
||||
shape = SubResource("CircleShape2D_sglur")
|
||||
@ -82,6 +89,7 @@ volume_db = -12.5
|
||||
[node name="AudioStreamPlayer_harvest" type="AudioStreamPlayer" parent="Audio"]
|
||||
stream = SubResource("AudioStreamRandomizer_gt4e4")
|
||||
volume_db = -10.0
|
||||
pitch_scale = 1.5
|
||||
|
||||
[node name="AudioStreamPlayer_pick_up" type="AudioStreamPlayer" parent="Audio"]
|
||||
stream = SubResource("AudioStreamRandomizer_24ehl")
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
extends Area2D
|
||||
class_name ActionArea
|
||||
|
||||
const OPACITY = 0.3
|
||||
const ACTIVATED_COLOR = Color.TURQUOISE
|
||||
const DEACTIVATED_COLOR = Color.REBECCA_PURPLE
|
||||
|
||||
var collision_shape : CollisionShape2D = null
|
||||
var area_width : float = 40
|
||||
var area_distance : float = 80
|
||||
|
||||
var activated : bool = false :
|
||||
set(v):
|
||||
var old = activated
|
||||
activated = v
|
||||
if old != activated:
|
||||
queue_redraw()
|
||||
|
||||
func _init(
|
||||
_area_width : float = 40,
|
||||
_area_distance : float = 80
|
||||
):
|
||||
area_width = _area_width
|
||||
area_distance = _area_distance
|
||||
|
||||
func _ready():
|
||||
collision_shape = CollisionShape2D.new()
|
||||
collision_shape.position.x = area_distance
|
||||
collision_shape.shape = CircleShape2D.new()
|
||||
collision_shape.shape.radius = area_width
|
||||
add_child(collision_shape)
|
||||
|
||||
func _process(_delta):
|
||||
look_at(get_global_mouse_position())
|
||||
|
||||
func _draw():
|
||||
draw_circle(
|
||||
Vector2(
|
||||
area_distance,
|
||||
0
|
||||
),
|
||||
area_width,
|
||||
Color((ACTIVATED_COLOR if activated else DEACTIVATED_COLOR), OPACITY)
|
||||
)
|
||||
@ -1 +0,0 @@
|
||||
uid://btmwjrscevcb1
|
||||
@ -1,149 +1,245 @@
|
||||
extends CharacterBody2D
|
||||
class_name Player
|
||||
|
||||
const MAX_REACH = 100
|
||||
const HOLDING_ITEM_SPRITE_SIZE = 40.
|
||||
|
||||
signal player_updated(player: Player)
|
||||
signal action_tried_without_energy
|
||||
signal upgraded
|
||||
|
||||
var planet : Planet # mis à jour par la classe Planet
|
||||
@export var speed = 400
|
||||
|
||||
@onready var inventory : Inventory = Inventory.new()
|
||||
@export var speed = 350
|
||||
|
||||
var max_energy : int = 3
|
||||
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 controlling_player : bool = true :
|
||||
set(v):
|
||||
controlling_player = v
|
||||
velocity = Vector2.ZERO
|
||||
|
||||
var closest_interactable : Interactable = null :
|
||||
set(v):
|
||||
var old = closest_interactable
|
||||
closest_interactable = v
|
||||
if old != closest_interactable:
|
||||
player_updated.emit(self)
|
||||
var can_use_item : bool = false :
|
||||
set(v):
|
||||
var old = can_use_item
|
||||
can_use_item = v
|
||||
if old != can_use_item:
|
||||
player_updated.emit(self)
|
||||
var can_interact : bool = false :
|
||||
set(v):
|
||||
var old = can_interact
|
||||
can_interact = v
|
||||
if old != can_interact:
|
||||
player_updated.emit(self)
|
||||
var instruction : Instruction = null
|
||||
|
||||
var energy : int = max_energy :
|
||||
set(v):
|
||||
energy = v
|
||||
emit_signal("player_updated", self)
|
||||
var action_area : ActionArea = null
|
||||
player_updated.emit(self)
|
||||
|
||||
@onready var inventory : Inventory = Inventory.new()
|
||||
@onready var preview_zone : Area2D = null
|
||||
@onready var action_zone : Area2D = null
|
||||
|
||||
func _ready():
|
||||
emit_signal("player_updated", self)
|
||||
player_updated.emit(self)
|
||||
inventory.inventory_changed.connect(_on_inventory_updated)
|
||||
Pointer.player = self
|
||||
|
||||
func _on_inventory_updated(_inventory: Inventory):
|
||||
emit_signal("player_updated", self)
|
||||
# Méthode déclenchée par la classe planet
|
||||
func _start_pass_day():
|
||||
controlling_player = false
|
||||
instruction = null
|
||||
|
||||
func get_input():
|
||||
# Méthode déclenchée par la classe planet
|
||||
func _pass_day():
|
||||
recharge()
|
||||
|
||||
# Méthode déclenchée par la classe planet
|
||||
func _end_pass_day():
|
||||
controlling_player = true
|
||||
|
||||
func _process(_delta):
|
||||
if controlling_player:
|
||||
var old_velocity=velocity
|
||||
calculate_direction()
|
||||
|
||||
can_use_item = inventory.get_item() and inventory.get_item().can_use(self)
|
||||
can_interact = closest_interactable and closest_interactable.can_interact(self)
|
||||
if action_area:
|
||||
action_area.activated = can_use_item
|
||||
if Input.is_action_just_pressed("action"):
|
||||
try_use_item()
|
||||
if Input.is_action_just_pressed("interact") and closest_interactable and can_interact:
|
||||
closest_interactable.interact(self)
|
||||
if Input.is_action_just_pressed("drop") and inventory.get_item():
|
||||
drop_item()
|
||||
if instruction and instruction.can_be_done(self) and not has_just_received_instruction:
|
||||
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:
|
||||
$Audio/AudioStreamPlayer_movement.play()
|
||||
play_sfx("move")
|
||||
else:
|
||||
velocity = Vector2.ZERO
|
||||
move_and_slide()
|
||||
|
||||
func _on_inventory_updated(_inventory: Inventory):
|
||||
if inventory.get_item():
|
||||
setup_preview_zone(inventory.get_item().use_zone_radius)
|
||||
var item_texture = inventory.get_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)
|
||||
)
|
||||
%ItemSprite.visible = inventory.get_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")
|
||||
|
||||
if input_direction.length() != 0:
|
||||
instruction = null
|
||||
|
||||
if instruction:
|
||||
input_direction = self.global_position.direction_to(instruction.position)
|
||||
|
||||
velocity = input_direction * speed
|
||||
if input_direction.x:
|
||||
$Sprite.flip_h = (input_direction.x < 0)
|
||||
|
||||
func try_use_item():
|
||||
if energy == 0 and inventory.get_item():
|
||||
action_tried_without_energy.emit()
|
||||
if energy > 0 and can_use_item:
|
||||
use_item()
|
||||
|
||||
func can_interact(interactable : Interactable):
|
||||
return interactable.can_interact(self)
|
||||
|
||||
func try_interact(interactable : Interactable):
|
||||
has_just_received_instruction = true
|
||||
instruction = InteractableInstruction.new(
|
||||
interactable
|
||||
)
|
||||
|
||||
func try_move(move_to : Vector2):
|
||||
instruction = MoveInstruction.new(move_to)
|
||||
|
||||
func get_item(item : Item):
|
||||
remove_action_area()
|
||||
inventory.set_item(item)
|
||||
if item is ToolItem:
|
||||
add_action_area(item.generate_action_area())
|
||||
play_sfx("pick")
|
||||
|
||||
func drop_item():
|
||||
var item_to_drop = inventory.pop_item()
|
||||
planet.drop_item(item_to_drop, global_position)
|
||||
remove_action_area()
|
||||
play_sfx("drop")
|
||||
|
||||
func delete_item():
|
||||
inventory.set_item(null)
|
||||
remove_action_area()
|
||||
func delete_item(item: Item):
|
||||
inventory.remove_item(item)
|
||||
|
||||
func use_item():
|
||||
var item = inventory.get_item()
|
||||
var is_item_used = item.use(self)
|
||||
if is_item_used:
|
||||
energy -= 1
|
||||
if item.is_one_time_use():
|
||||
delete_item()
|
||||
|
||||
# Méthode déclenchée par la classe planet
|
||||
func _pass_day():
|
||||
energy = max_energy
|
||||
|
||||
func detect_closest_interactable():
|
||||
var in_range_interactables : Array[Interactable] = []
|
||||
for area in $InteractArea2D.get_overlapping_areas():
|
||||
if area is Interactable and area.available:
|
||||
in_range_interactables.append(area)
|
||||
|
||||
in_range_interactables.sort_custom(
|
||||
func(a : Node2D, b : Node2D) :
|
||||
return a.global_position.distance_to(global_position) > b.global_position.distance_to(global_position)
|
||||
func try_use_item(item : Item, use_position : Vector2):
|
||||
has_just_received_instruction = true
|
||||
setup_action_zone(use_position, item.use_zone_radius)
|
||||
instruction = ItemActionInstruction.new(
|
||||
use_position,
|
||||
item
|
||||
)
|
||||
|
||||
if len(in_range_interactables) > 0:
|
||||
closest_interactable = in_range_interactables[0]
|
||||
else :
|
||||
closest_interactable = null
|
||||
func preview_can_use_item(item : Item) -> bool:
|
||||
return can_use_item_on_zone(item, preview_zone)
|
||||
|
||||
func add_action_area(area : ActionArea):
|
||||
action_area = area
|
||||
add_child(action_area)
|
||||
func can_use_item_on_zone(item : Item, zone: Area2D) -> bool:
|
||||
return (
|
||||
inventory.has_item(item)
|
||||
and (energy - item.use_energy) >= 0
|
||||
and item.can_use(self, zone)
|
||||
)
|
||||
|
||||
func remove_action_area():
|
||||
if (action_area):
|
||||
remove_child(action_area)
|
||||
func use_item(item : Item):
|
||||
if can_use_item_on_zone(item, action_zone):
|
||||
var is_item_used = item.use(self, action_zone)
|
||||
if is_item_used:
|
||||
energy -= item.use_energy
|
||||
if item.is_one_time_use():
|
||||
delete_item(item)
|
||||
|
||||
func upgrade():
|
||||
max_energy += 1
|
||||
energy += 1
|
||||
upgraded.emit()
|
||||
|
||||
func _process(_delta):
|
||||
get_input()
|
||||
move_and_slide()
|
||||
detect_closest_interactable()
|
||||
func recharge(amount : int = max_energy):
|
||||
energy = min(energy + amount, max_energy)
|
||||
|
||||
func _on_root_gui_day_pass_pressed():
|
||||
controlling_player = false
|
||||
func generate_action_area(radius : int = 0) -> Area2D:
|
||||
var area2D = Area2D.new()
|
||||
var collision_shape = CollisionShape2D.new()
|
||||
var circle_shape = CircleShape2D.new()
|
||||
|
||||
func _on_root_gui_day_pass_finished():
|
||||
controlling_player = true
|
||||
circle_shape.radius = radius
|
||||
collision_shape.shape = circle_shape
|
||||
area2D.add_child(collision_shape)
|
||||
|
||||
func _on_root_gui_game_click():
|
||||
try_use_item()
|
||||
get_parent().add_child(area2D)
|
||||
|
||||
return area2D
|
||||
|
||||
func setup_preview_zone(zone_radius : int) -> Area2D:
|
||||
if preview_zone:
|
||||
preview_zone.queue_free()
|
||||
preview_zone = generate_action_area(zone_radius)
|
||||
return preview_zone
|
||||
|
||||
func setup_action_zone(zone_position : Vector2, zone_radius : int) -> Area2D:
|
||||
if action_zone:
|
||||
action_zone.queue_free()
|
||||
action_zone = generate_action_area(zone_radius)
|
||||
action_zone.global_position = zone_position
|
||||
return action_zone
|
||||
|
||||
func move_preview_zone(zone_position : Vector2):
|
||||
if preview_zone:
|
||||
preview_zone.global_position = zone_position
|
||||
|
||||
func detect_area_in_preview_zone() -> Array:
|
||||
return preview_zone.get_overlapping_areas()
|
||||
|
||||
func detect_area_in_action_zone() -> Array:
|
||||
if action_zone:
|
||||
return action_zone.get_overlapping_areas()
|
||||
return []
|
||||
|
||||
func play_sfx(sound : String):
|
||||
match sound:
|
||||
"dig":
|
||||
$Audio/AudioStreamPlayer_dig.play()
|
||||
"harvest":
|
||||
$Audio/AudioStreamPlayer_harvest.play()
|
||||
"pick":
|
||||
$Audio/AudioStreamPlayer_pick_up.play()
|
||||
"drop":
|
||||
$Audio/AudioStreamPlayer_drop.play()
|
||||
"move":
|
||||
$Audio/AudioStreamPlayer_movement.play()
|
||||
|
||||
class Instruction:
|
||||
|
||||
var position : Vector2
|
||||
|
||||
func _init(_pos : Vector2):
|
||||
position = _pos
|
||||
|
||||
func can_be_done(player : Player):
|
||||
return player.global_position.distance_to(position) < 10
|
||||
|
||||
func do(_player : Player):
|
||||
pass
|
||||
|
||||
class MoveInstruction extends Instruction:
|
||||
pass
|
||||
|
||||
class ItemActionInstruction extends Instruction:
|
||||
var item = Item
|
||||
|
||||
func _init(_pos : Vector2, _item : Item):
|
||||
position = _pos
|
||||
item = _item
|
||||
|
||||
func can_be_done(player : Player):
|
||||
return player.global_position.distance_to(position) < player.MAX_REACH
|
||||
|
||||
func do(player : Player):
|
||||
player.use_item(item)
|
||||
|
||||
class InteractableInstruction extends Instruction:
|
||||
var interactable = Interactable
|
||||
|
||||
func _init(_interactable : Interactable):
|
||||
interactable = _interactable
|
||||
position = interactable.global_position
|
||||
|
||||
func can_be_done(player : Player):
|
||||
return player.global_position.distance_to(position) < player.MAX_REACH
|
||||
|
||||
func do(player : Player):
|
||||
interactable.interact(player)
|
||||
|
||||
26
entities/scripts/inspectable_entity.gd
Normal file
@ -0,0 +1,26 @@
|
||||
extends Area2D
|
||||
class_name InspectableEntity
|
||||
|
||||
const MODULATE_INSPECTED_COLOR = Color.GRAY
|
||||
|
||||
@onready var default_modulate : Color = modulate
|
||||
@onready var inspectable_signals_setuped : bool = setup_inspectable_signals()
|
||||
|
||||
var inspected : bool = false :
|
||||
set(v):
|
||||
inspected = v
|
||||
modulate = MODULATE_INSPECTED_COLOR if inspected else default_modulate
|
||||
|
||||
func setup_inspectable_signals() -> bool:
|
||||
mouse_entered.connect(_on_mouse_entered)
|
||||
mouse_exited.connect(_on_mouse_excited)
|
||||
return true
|
||||
|
||||
func _on_mouse_entered():
|
||||
Pointer.inspect_entity(self)
|
||||
|
||||
func _on_mouse_excited():
|
||||
Pointer.stop_inspect_entity(self)
|
||||
|
||||
func inspected_text():
|
||||
return ""
|
||||
1
entities/scripts/inspectable_entity.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://d3bk52402ylvl
|
||||
@ -1,7 +1,7 @@
|
||||
extends Area2D
|
||||
extends InspectableEntity
|
||||
class_name UndergroundLoot
|
||||
|
||||
const AREA_WIDTH = 10
|
||||
const AREA_WIDTH = 20
|
||||
const LOOTED_ITEM_RANDOM_RANGE = 100
|
||||
|
||||
const SPRITE_SCENE : PackedScene = preload("res://entities/underground_loot/underground_loot_sprite.tscn")
|
||||
@ -15,6 +15,9 @@ var planet : Planet # mis à jour par la classe Planet
|
||||
func _init(_planet = null):
|
||||
planet = _planet
|
||||
|
||||
func inspected_text():
|
||||
return "Buried Loot"
|
||||
|
||||
func generate_sprite() -> Node2D:
|
||||
var object = SPRITE_SCENE.instantiate()
|
||||
|
||||
|
||||
51
game.tscn
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://d28cp7a21kwou"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://d28cp7a21kwou"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="1_iotsf"]
|
||||
[ext_resource type="PackedScene" uid="uid://csiacsndm62ll" path="res://gui/game/pause/pause.tscn" id="2_215e1"]
|
||||
@ -7,44 +7,51 @@
|
||||
[ext_resource type="Script" uid="uid://dedg615xudpoq" path="res://entities/interactables/item_object/script/item_object.gd" id="3_215e1"]
|
||||
[ext_resource type="PackedScene" uid="uid://tsi5j1uxppa4" path="res://stages/terrain/planet/planet.tscn" id="6_e8heu"]
|
||||
[ext_resource type="Resource" uid="uid://ddqalo1k30i5x" path="res://common/inventory/resources/items/default_shovel.tres" id="6_lc2xo"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkwh1ntvgkkrt" path="res://entities/interactables/compost/compost.tscn" id="7_215e1"]
|
||||
[ext_resource type="Resource" uid="uid://bya8sm6rm6747" path="res://common/inventory/resources/items/compost.tres" id="7_215e1"]
|
||||
[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://common/inventory/scripts/item.gd" id="7_rvswv"]
|
||||
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/machines/recharge_station/recharge_station.tscn" id="8_7sc4i"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="8_boyg6"]
|
||||
[ext_resource type="Resource" uid="uid://b04vho33bl52b" path="res://entities/plants/resources/plants/default.tres" id="9_e36ub"]
|
||||
[ext_resource type="Resource" uid="uid://b04vho33bl52b" path="res://entities/plants/resources/plant_types/default.tres" id="9_e36ub"]
|
||||
[ext_resource type="Script" uid="uid://bypjcvlc15gsm" path="res://common/inventory/scripts/items/seed.gd" id="10_hb5m1"]
|
||||
[ext_resource type="Resource" uid="uid://dsctivn1vrem2" path="res://entities/plants/resources/plants/maias.tres" id="11_x5p1p"]
|
||||
[ext_resource type="Resource" uid="uid://dsctivn1vrem2" path="res://entities/plants/resources/plant_types/maias.tres" id="11_x5p1p"]
|
||||
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="12_qhcbd"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qt76e"]
|
||||
atlas = ExtResource("8_boyg6")
|
||||
region = Rect2(1140, 345, 141, 128)
|
||||
|
||||
[sub_resource type="Resource" id="Resource_lc2xo"]
|
||||
[sub_resource type="Resource" id="Resource_7sc4i"]
|
||||
script = ExtResource("10_hb5m1")
|
||||
plant_type = ExtResource("9_e36ub")
|
||||
name = "Chardi"
|
||||
description = "This plant reduce contamination around when it becomes mature."
|
||||
description = "This plant remove a lot of contamination around when it becomes mature."
|
||||
icon = SubResource("AtlasTexture_qt76e")
|
||||
use_zone_radius = 5
|
||||
use_energy = 1
|
||||
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_215e1"]
|
||||
[sub_resource type="Resource" id="Resource_80cx4"]
|
||||
script = ExtResource("10_hb5m1")
|
||||
plant_type = ExtResource("9_e36ub")
|
||||
name = "Chardi"
|
||||
description = "This plant reduce contamination around when it becomes mature."
|
||||
description = "This plant remove a lot of contamination around when it becomes mature."
|
||||
icon = SubResource("AtlasTexture_qt76e")
|
||||
use_zone_radius = 5
|
||||
use_energy = 1
|
||||
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sri3b"]
|
||||
atlas = ExtResource("8_boyg6")
|
||||
region = Rect2(1697, 331, 125, 158)
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7sc4i"]
|
||||
[sub_resource type="Resource" id="Resource_e8heu"]
|
||||
script = ExtResource("10_hb5m1")
|
||||
plant_type = ExtResource("11_x5p1p")
|
||||
name = "Maias"
|
||||
description = "This gorgeous flower has no effect, but produce a lot of seeds."
|
||||
description = "This gorgeous flower produce a lot of seeds."
|
||||
icon = SubResource("AtlasTexture_sri3b")
|
||||
use_zone_radius = 5
|
||||
use_energy = 1
|
||||
metadata/_custom_type_script = "uid://bypjcvlc15gsm"
|
||||
|
||||
[node name="Game" type="Node2D"]
|
||||
@ -67,31 +74,33 @@ y_sort_enabled = true
|
||||
|
||||
[node name="Player" parent="Entities" instance=ExtResource("2_lc2xo")]
|
||||
|
||||
[node name="ShovelObject" type="Area2D" parent="Entities"]
|
||||
position = Vector2(2, 72)
|
||||
[node name="ItemObject" type="Area2D" parent="Entities"]
|
||||
position = Vector2(0, 129)
|
||||
script = ExtResource("3_215e1")
|
||||
item = ExtResource("6_lc2xo")
|
||||
metadata/_custom_type_script = "uid://dedg615xudpoq"
|
||||
|
||||
[node name="Compost" parent="Entities" instance=ExtResource("7_215e1")]
|
||||
position = Vector2(3, 458)
|
||||
[node name="ItemObject2" type="Area2D" parent="Entities"]
|
||||
position = Vector2(-162, 23)
|
||||
script = ExtResource("3_215e1")
|
||||
item = ExtResource("7_215e1")
|
||||
metadata/_custom_type_script = "uid://dedg615xudpoq"
|
||||
|
||||
[node name="RechargeStation" parent="Entities" instance=ExtResource("8_7sc4i")]
|
||||
position = Vector2(-1, -217)
|
||||
|
||||
[node name="Planet" parent="." node_paths=PackedStringArray("import_entities_from_node") instance=ExtResource("6_e8heu")]
|
||||
loot_items = Array[ExtResource("7_rvswv")]([SubResource("Resource_lc2xo"), SubResource("Resource_215e1"), SubResource("Resource_7sc4i")])
|
||||
loot_items = Array[ExtResource("7_rvswv")]([SubResource("Resource_7sc4i"), SubResource("Resource_80cx4"), SubResource("Resource_e8heu")])
|
||||
import_entities_from_node = NodePath("../Entities")
|
||||
|
||||
[node name="Camera" parent="." node_paths=PackedStringArray("following") instance=ExtResource("12_qhcbd")]
|
||||
position = Vector2(2.22, 0)
|
||||
following = NodePath("../Entities/Player")
|
||||
|
||||
[connection signal="day_pass_finished" from="CanvasLayer/RootGui" to="Entities/Player" method="_on_root_gui_day_pass_finished"]
|
||||
[connection signal="day_pass_finished" from="CanvasLayer/RootGui" to="Planet" method="_on_root_gui_day_pass_finished"]
|
||||
[connection signal="day_pass_pressed" from="CanvasLayer/RootGui" to="Entities/Player" method="_on_root_gui_day_pass_pressed"]
|
||||
[connection signal="day_pass_proceed" from="CanvasLayer/RootGui" to="Planet" method="_on_root_gui_day_pass_proceed"]
|
||||
[connection signal="game_click" from="CanvasLayer/RootGui" to="Entities/Player" method="_on_root_gui_game_click"]
|
||||
[connection signal="pause_asked" from="CanvasLayer/RootGui" to="CanvasLayer/Pause" method="_on_root_gui_pause_asked"]
|
||||
[connection signal="action_tried_without_energy" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_action_tried_without_energy"]
|
||||
[connection signal="player_updated" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_updated"]
|
||||
[connection signal="upgraded" from="Entities/Player" to="CanvasLayer/RootGui" method="_on_player_upgraded"]
|
||||
[connection signal="day_limit_exceed" from="Planet" to="CanvasLayer/Win" method="_on_planet_day_limit_exceed"]
|
||||
[connection signal="pass_day_ended" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_pass_day_ended"]
|
||||
[connection signal="pass_day_started" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_pass_day_started"]
|
||||
[connection signal="planet_updated" from="Planet" to="CanvasLayer/RootGui" method="_on_planet_updated"]
|
||||
|
||||
@ -1,15 +1,62 @@
|
||||
[gd_scene load_steps=21 format=3 uid="uid://12nak7amd1uq"]
|
||||
[gd_scene load_steps=30 format=3 uid="uid://12nak7amd1uq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/game/scripts/game_gui.gd" id="1_udau0"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="2_nq5i2"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_nq5i2"]
|
||||
[ext_resource type="Texture2D" uid="uid://cm3ehinvvj52i" path="res://gui/game/assets/texture/Interface sans boutons.png" id="3_n4kem"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/game/assets/icons/bolt.svg" id="4_k4juk"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="4_ujg5r"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_ujg5r"]
|
||||
[ext_resource type="Texture2D" uid="uid://c2pgaklnj5w3d" path="res://gui/game/assets/texture/Tablette info.png" id="6_fovlv"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="7_n4kem"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="8_n4kem"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="8_n4kem"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5cuxgisrsfgt" path="res://gui/game/pause/assets/icons/player-pause.svg" id="9_2wykm"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_id0t5"]
|
||||
interpolation_mode = 1
|
||||
offsets = PackedFloat32Array(0, 0.115169, 0.41573, 0.620786, 0.924157)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ykapk"]
|
||||
gradient = SubResource("Gradient_id0t5")
|
||||
fill_to = Vector2(1, 1)
|
||||
repeat = 1
|
||||
|
||||
[sub_resource type="Animation" id="Animation_p6blc"]
|
||||
resource_name = "default"
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.5, 1.03333),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.950568, 0, 0.346412, 1), Color(0.999996, 0.39403, 0.49625, 1), Color(0.950568, 0, 0.346412, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_l73to"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0.950568, 0, 0.346412, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_l3q4a"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_l73to"),
|
||||
&"default": SubResource("Animation_p6blc")
|
||||
}
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ek73b"]
|
||||
atlas = ExtResource("7_n4kem")
|
||||
region = Rect2(76, 75, 124, 135)
|
||||
@ -21,224 +68,6 @@ font_size = 20
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_n4kem"]
|
||||
font_size = 12
|
||||
|
||||
[sub_resource type="Animation" id="Animation_iyvkh"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("RechargeFade:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("RechargeFade:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_left")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-44.0]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("Effect:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("Effect:modulate")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_bottom")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [12.5]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_n4kem"]
|
||||
resource_name = "no_energy_left"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_left")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.0333333, 0.1, 0.166667, 0.233333, 0.3, 0.366667, 0.433333, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [-44.0, -40.0, -44.0, -48.0, -44.0, -40.0, -44.0, -40.0, -44.0]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Effect:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [true, false]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Effect:modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.266667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.866667, 0.152941, 0.337255, 0), Color(0.866667, 0.152941, 0.337255, 0.392157), Color(0.866667, 0.152941, 0.337255, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_k4juk"]
|
||||
resource_name = "recharge_fade_in"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("RechargeFade:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("RechargeFade:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_fovlv"]
|
||||
resource_name = "recharge_fade_out"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("RechargeFade:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.166667, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("RechargeFade:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(1),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_2wykm"]
|
||||
resource_name = "upgrade"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Effect:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [true, false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Effect:modulate")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.133333, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.67451, 0.52549, 0.203922, 0), Color(0.67451, 0.52549, 0.203922, 0.572549), Color(0.67451, 0.52549, 0.203922, 0)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("MarginContainer/PlayerInfo/EnergyInfo:offset_bottom")
|
||||
tracks/2/interp = 2
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.233333, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [12.5, -32.0, 12.5]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_n4kem"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_iyvkh"),
|
||||
&"no_energy_left": SubResource("Animation_n4kem"),
|
||||
&"recharge_fade_in": SubResource("Animation_k4juk"),
|
||||
&"recharge_fade_out": SubResource("Animation_fovlv"),
|
||||
&"upgrade": SubResource("Animation_2wykm")
|
||||
}
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_2wykm"]
|
||||
offsets = PackedFloat32Array(0, 0.279476, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1)
|
||||
@ -248,6 +77,144 @@ gradient = SubResource("Gradient_2wykm")
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_iyvkh"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("PassDayFade:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0.0627451, 0.0588235, 0.168627, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Effect:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_id0t5"]
|
||||
resource_name = "not_permitted"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Effect:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.266667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.866667, 0.152941, 0.337255, 0), Color(0.866667, 0.152941, 0.337255, 0.392157), Color(0.866667, 0.152941, 0.337255, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ykapk"]
|
||||
resource_name = "pass_day"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("PassDayFade:color")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.4, 0.6, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.0627451, 0.0588235, 0.168627, 0), Color(0.0627451, 0.0588235, 0.168627, 1), Color(0.0627451, 0.0588235, 0.168627, 1), Color(0.0627451, 0.0588235, 0.168627, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_n4kem"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_iyvkh"),
|
||||
&"not_permitted": SubResource("Animation_id0t5"),
|
||||
&"pass_day": SubResource("Animation_ykapk")
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_2wykm"]
|
||||
resource_name = "upgrade"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.9),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.6, 0.580392, 0, 0), Color(0.600196, 0.581106, 0, 0.392157), Color(0.6, 0.580392, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_l3q4a"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_nhqnj"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_l3q4a"),
|
||||
&"upgrade": SubResource("Animation_2wykm")
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_w16yr"]
|
||||
resource_name = "no_energy_left_appear"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("NoEnergyLeft:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0.0666667, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -100), Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_mbdxg"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("NoEnergyLeft:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -100)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_p0xoq"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_mbdxg"),
|
||||
&"no_energy_left_appear": SubResource("Animation_w16yr")
|
||||
}
|
||||
|
||||
[node name="RootGui" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@ -257,15 +224,42 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
mouse_filter = 1
|
||||
script = ExtResource("1_udau0")
|
||||
|
||||
[node name="GameAction" type="TextureButton" parent="."]
|
||||
[node name="NoEnergyLeft" type="VBoxContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
modulate = Color(0.950568, 0, 0.346412, 1)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -100.0
|
||||
offset_bottom = 2.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("2_nq5i2")
|
||||
theme_override_constants/separation = 12
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="NoEnergyLeft"]
|
||||
custom_minimum_size = Vector2(0, 40)
|
||||
layout_mode = 2
|
||||
texture = SubResource("GradientTexture2D_ykapk")
|
||||
expand_mode = 1
|
||||
stretch_mode = 1
|
||||
|
||||
[node name="Label" type="Label" parent="NoEnergyLeft"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_nq5i2")
|
||||
text = "No energy left"
|
||||
label_settings = ExtResource("4_ujg5r")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="BlinkAnimation" type="AnimationPlayer" parent="NoEnergyLeft"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_l3q4a")
|
||||
}
|
||||
autoplay = "default"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
@ -338,15 +332,6 @@ label_settings = ExtResource("4_ujg5r")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="DayPass" type="Button" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 8
|
||||
focus_mode = 0
|
||||
theme = ExtResource("2_nq5i2")
|
||||
text = "Recharge"
|
||||
icon = ExtResource("4_k4juk")
|
||||
|
||||
[node name="ItemInfo" type="TextureRect" parent="MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 300)
|
||||
@ -398,43 +383,6 @@ label_settings = SubResource("LabelSettings_n4kem")
|
||||
autowrap_mode = 3
|
||||
clip_text = true
|
||||
|
||||
[node name="AvailableActions" type="HBoxContainer" parent="MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
theme = ExtResource("2_nq5i2")
|
||||
|
||||
[node name="Plant" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Space/Click - Plant Seed"
|
||||
|
||||
[node name="Interact" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "E - Interact"
|
||||
|
||||
[node name="GetItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "E - Take Item"
|
||||
|
||||
[node name="SwapItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "E - Swap Item"
|
||||
|
||||
[node name="DropItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "W - Drop Item"
|
||||
|
||||
[node name="UseItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Space/Click - Use Item"
|
||||
|
||||
[node name="TopRightContent" type="HBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
@ -455,23 +403,19 @@ layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 0
|
||||
focus_mode = 0
|
||||
mouse_filter = 1
|
||||
icon = ExtResource("9_2wykm")
|
||||
|
||||
[node name="RechargeFade" type="ColorRect" parent="."]
|
||||
[node name="PassDayFade" type="ColorRect" parent="."]
|
||||
physics_interpolation_mode = 0
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_n4kem")
|
||||
}
|
||||
mouse_filter = 2
|
||||
color = Color(0.0627451, 0.0588235, 0.168627, 0)
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="."]
|
||||
layout_mode = 0
|
||||
@ -479,7 +423,7 @@ offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="Effect" type="TextureRect" parent="."]
|
||||
visible = false
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@ -489,6 +433,20 @@ grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
texture = SubResource("GradientTexture2D_id0t5")
|
||||
|
||||
[connection signal="button_down" from="GameAction" to="." method="_on_game_action_button_down"]
|
||||
[connection signal="pressed" from="MarginContainer/DayPass" to="." method="_on_day_pass_pressed"]
|
||||
[node name="PassDayAnimation" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_n4kem")
|
||||
}
|
||||
|
||||
[node name="EffectAnimation" type="AnimationPlayer" parent="."]
|
||||
root_node = NodePath("../Effect")
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_nhqnj")
|
||||
}
|
||||
|
||||
[node name="NoEnergyLeftAnimation" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_p0xoq")
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/TopRightContent/Pause" to="." method="_on_pause_pressed"]
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://csiacsndm62ll"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="1_51ks3"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_51ks3"]
|
||||
[ext_resource type="Script" uid="uid://crt2d4m5ba25i" path="res://gui/game/pause/scripts/pause.gd" id="1_he4ox"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="2_8d1kg"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="3_0pdto"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_8d1kg"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_0pdto"]
|
||||
[ext_resource type="Texture2D" uid="uid://vmsn54d1ptih" path="res://gui/game/pause/assets/icons/player-play.svg" id="5_apjlw"]
|
||||
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://gui/game/pause/assets/icons/rotate.svg" id="6_58dya"]
|
||||
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://gui/game/pause/assets/icons/logout.svg" id="7_yj6f1"]
|
||||
@ -76,8 +76,8 @@ horizontal_alignment = 1
|
||||
[node name="ControlsText" type="Label" parent="Tutorial/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "QWERTY/AZERTY/Directional Arrows : Move
|
||||
E : Interact/Pickup Items
|
||||
Space/Click : Use Item
|
||||
Left Click : Interact/Pickup Items
|
||||
Right Click/Space : Use Item
|
||||
W : Drop Item
|
||||
"
|
||||
horizontal_alignment = 1
|
||||
|
||||
@ -2,13 +2,12 @@ extends Control
|
||||
|
||||
var pause = false :
|
||||
set(v):
|
||||
print(pause)
|
||||
pause = v
|
||||
visible = pause
|
||||
get_tree().paused = pause
|
||||
|
||||
func _ready():
|
||||
pause = false
|
||||
pause = true
|
||||
|
||||
func _input(_event):
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
|
||||
@ -1,23 +1,13 @@
|
||||
extends Control
|
||||
class_name GameGui
|
||||
|
||||
signal game_click
|
||||
signal day_pass_pressed
|
||||
signal day_pass_proceed
|
||||
signal day_pass_finished
|
||||
signal pause_asked
|
||||
|
||||
func _on_player_updated(player:Player):
|
||||
%EnergyCount.text = str(player.energy) + "/" + str(player.max_energy)
|
||||
%EnergyInfo.modulate = Color.WHITE if player.energy > 0 else Color.RED
|
||||
|
||||
%AvailableActions/GetItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() == null
|
||||
%AvailableActions/Interact.visible = not player.closest_interactable is ItemObject and player.can_interact
|
||||
%AvailableActions/SwapItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() != null
|
||||
%AvailableActions/DropItem.visible = player.inventory.get_item() != null
|
||||
%AvailableActions/UseItem.visible = player.inventory.get_item() and player.can_use_item and not player.inventory.get_item() is Seed
|
||||
%AvailableActions/Plant.visible = player.inventory.get_item() and player.can_use_item and player.inventory.get_item() is Seed
|
||||
|
||||
update_no_energy_left_info(player.energy)
|
||||
|
||||
%ItemInfo.visible = player.inventory.get_item() != null
|
||||
if player.inventory.get_item():
|
||||
@ -27,16 +17,10 @@ func _on_player_updated(player:Player):
|
||||
%ItemDesc.text = item.description
|
||||
|
||||
func _on_day_pass_pressed():
|
||||
day_pass_pressed.emit()
|
||||
$AnimationPlayer.play("recharge_fade_in")
|
||||
|
||||
await $AnimationPlayer.animation_finished
|
||||
day_pass_proceed.emit()
|
||||
$AnimationPlayer.play("recharge_fade_out")
|
||||
await $AnimationPlayer.animation_finished
|
||||
day_pass_finished.emit()
|
||||
|
||||
func _on_game_action_button_down():
|
||||
game_click.emit()
|
||||
|
||||
func _on_planet_updated(planet:Planet):
|
||||
%DayCount.text = "Day " + str(planet.day)
|
||||
@ -52,4 +36,17 @@ func _on_pause_pressed():
|
||||
|
||||
|
||||
func _on_player_upgraded():
|
||||
$AnimationPlayer.play("upgrade")
|
||||
$EffectAnimation.play("upgrade")
|
||||
|
||||
func _on_planet_pass_day_started(planet):
|
||||
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
|
||||
$PassDayAnimation.play("pass_day")
|
||||
await $PassDayAnimation.animation_finished
|
||||
$PassDayAnimation.speed_scale = 1
|
||||
|
||||
func update_no_energy_left_info(energy):
|
||||
if energy == 0 and not %NoEnergyLeft.visible:
|
||||
%NoEnergyLeft.visible = true
|
||||
$NoEnergyLeftAnimation.play("no_energy_left_appear")
|
||||
elif energy != 0 and %NoEnergyLeft.visible:
|
||||
%NoEnergyLeft.visible = false
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://v41hfc7haaye"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="1_cl67j"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_cl67j"]
|
||||
[ext_resource type="Script" uid="uid://b3wuxv04clyed" path="res://gui/game/win/scripts/win.gd" id="1_sehw2"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="2_sehw2"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/game/ressources/default_label_settings.tres" id="3_0b3c6"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_sehw2"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_0b3c6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://gui/game/pause/assets/icons/rotate.svg" id="4_8p3aj"]
|
||||
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://gui/game/pause/assets/icons/logout.svg" id="5_j3wid"]
|
||||
|
||||
|
||||
1
gui/menu/assets/icons/users-group.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-users-group"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 13a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M8 21v-1a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v1" /><path d="M15 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M17 10h2a2 2 0 0 1 2 2v1" /><path d="M5 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /><path d="M3 13v-1a2 2 0 0 1 2 -2h2" /></svg>
|
||||
|
After Width: | Height: | Size: 583 B |
37
gui/menu/assets/icons/users-group.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b38hdpsvqcwg8"
|
||||
path="res://.godot/imported/users-group.svg-65aad5cfa47be548675b81fab7ab9db6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/menu/assets/icons/users-group.svg"
|
||||
dest_files=["res://.godot/imported/users-group.svg-65aad5cfa47be548675b81fab7ab9db6.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
@ -2,5 +2,8 @@ extends Node2D
|
||||
|
||||
@export_file var start_scene_path : String
|
||||
|
||||
func _ready():
|
||||
%Version.text = ProjectSettings.get_setting("application/config/version")
|
||||
|
||||
func _on_start_pressed():
|
||||
get_tree().change_scene_to_file(start_scene_path)
|
||||
|
||||
1
gui/pointer/assets/cursors/pointer.svg
Normal file
@ -0,0 +1 @@
|
||||
<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>
|
||||
|
After Width: | Height: | Size: 607 B |
37
gui/pointer/assets/cursors/pointer.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bspffyprdywgc"
|
||||
path="res://.godot/imported/pointer.svg-7e9852b8fc87e59d7ede00033ef3f170.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/pointer/assets/cursors/pointer.svg"
|
||||
dest_files=["res://.godot/imported/pointer.svg-7e9852b8fc87e59d7ede00033ef3f170.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
50
gui/pointer/assets/icons/left_click.svg
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-mouse-2"
|
||||
version="1.1"
|
||||
id="svg4"
|
||||
sodipodi:docname="left_click.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="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="namedview4"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:zoom="37"
|
||||
inkscape:cx="11.202703"
|
||||
inkscape:cy="12.945946"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1009"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4" />
|
||||
<path
|
||||
stroke="none"
|
||||
d="M0 0h24v24H0z"
|
||||
fill="none"
|
||||
id="path1" />
|
||||
<path
|
||||
id="path2"
|
||||
style="color:#000000;fill:#ffffff;fill-opacity:1;stroke:none;-inkscape-stroke:none"
|
||||
d="M 10,2 C 7.250429,2 5,4.250429 5,7 v 3 7 c 0,2.74957 2.250429,5 5,5 h 4 c 2.74957,0 5,-2.25043 5,-5 V 10 7 C 19,4.250429 16.74957,2 14,2 h -2 z m 3,2 h 1 c 1.668693,0 3,1.3313062 3,3 v 2 h -4 z m -6,7 h 5 5 v 6 c 0,1.668693 -1.331307,3 -3,3 H 10 C 8.3313062,20 7,18.668693 7,17 Z"
|
||||
sodipodi:nodetypes="sscsssscsscscssccccccssssc" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
37
gui/pointer/assets/icons/left_click.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://djb52fosgmv4j"
|
||||
path="res://.godot/imported/left_click.svg-163ab642e0d1ce655b5b40384b3f1392.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/pointer/assets/icons/left_click.svg"
|
||||
dest_files=["res://.godot/imported/left_click.svg-163ab642e0d1ce655b5b40384b3f1392.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
50
gui/pointer/assets/icons/right_click.svg
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="icon icon-tabler icons-tabler-outline icon-tabler-mouse-2"
|
||||
version="1.1"
|
||||
id="svg4"
|
||||
sodipodi:docname="right_click.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="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="namedview4"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:zoom="37"
|
||||
inkscape:cx="11.202703"
|
||||
inkscape:cy="12.945946"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1009"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4" />
|
||||
<path
|
||||
stroke="none"
|
||||
d="M0 0h24v24H0z"
|
||||
fill="none"
|
||||
id="path1" />
|
||||
<path
|
||||
id="path2"
|
||||
style="color:#000000;fill:#ffffff;stroke:none;-inkscape-stroke:none;stroke-opacity:1;fill-opacity:1"
|
||||
d="M 10,2 C 7.250429,2 5,4.250429 5,7 v 3 7 c 0,2.74957 2.250429,5 5,5 h 4 c 2.74957,0 5,-2.25043 5,-5 V 10 7 C 19,4.250429 16.74957,2 14,2 h -2 z m 0,2 h 1 V 9 H 7 V 7 C 7,5.3313062 8.3313062,4 10,4 Z m -3,7 h 5 5 v 6 c 0,1.668693 -1.331307,3 -3,3 H 10 C 8.3313062,20 7,18.668693 7,17 Z"
|
||||
sodipodi:nodetypes="sscsssscsscsscccsscccssssc" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
37
gui/pointer/assets/icons/right_click.svg.import
Normal file
@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://y3083o1fhgn0"
|
||||
path="res://.godot/imported/right_click.svg-89ed358ede3244ca5dababdd0f091dae.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/pointer/assets/icons/right_click.svg"
|
||||
dest_files=["res://.godot/imported/right_click.svg-89ed358ede3244ca5dababdd0f091dae.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
BIN
gui/pointer/assets/sounds/click.wav
Normal file
24
gui/pointer/assets/sounds/click.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://bym03qp4n6vep"
|
||||
path="res://.godot/imported/click.wav-fdd6eee7149fdb4e39d8aa55063ce4ff.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/pointer/assets/sounds/click.wav"
|
||||
dest_files=["res://.godot/imported/click.wav-fdd6eee7149fdb4e39d8aa55063ce4ff.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
71
gui/pointer/pointer.tscn
Normal file
@ -0,0 +1,71 @@
|
||||
[gd_scene load_steps=7 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"]
|
||||
[ext_resource type="AudioStream" uid="uid://bym03qp4n6vep" path="res://gui/pointer/assets/sounds/click.wav" id="3_kj0cm"]
|
||||
[ext_resource type="Texture2D" uid="uid://djb52fosgmv4j" path="res://gui/pointer/assets/icons/left_click.svg" id="3_pshoq"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/game/assets/icons/bolt.svg" id="4_b4uwv"]
|
||||
[ext_resource type="Script" uid="uid://c2en2hc6a7ils" path="res://gui/pointer/scripts/action_zone.gd" id="4_pshoq"]
|
||||
|
||||
[node name="Pointer" type="Node"]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_1pe2k")
|
||||
default_cursor = ExtResource("2_q4bvb")
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
layer = 128
|
||||
|
||||
[node name="Inspector" type="Control" parent="CanvasLayer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Container" type="VBoxContainer" parent="CanvasLayer/Inspector"]
|
||||
layout_mode = 0
|
||||
offset_left = 40.0
|
||||
offset_right = 137.0
|
||||
offset_bottom = 79.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="InspectorText" type="Label" parent="CanvasLayer/Inspector/Container"]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 2
|
||||
text = "Item"
|
||||
|
||||
[node name="Action" type="HBoxContainer" parent="CanvasLayer/Inspector/Container"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 0.168627, 1)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MouseImage" type="TextureRect" parent="CanvasLayer/Inspector/Container/Action"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_pshoq")
|
||||
|
||||
[node name="ActionEnergyImage" type="TextureRect" parent="CanvasLayer/Inspector/Container/Action"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_b4uwv")
|
||||
|
||||
[node name="ActionText" type="Label" parent="CanvasLayer/Inspector/Container/Action"]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 2
|
||||
text = "Take"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ActionZone" type="Sprite2D" parent="CanvasLayer/Inspector"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -1)
|
||||
script = ExtResource("4_pshoq")
|
||||
|
||||
[node name="Audio" type="Node" parent="."]
|
||||
|
||||
[node name="Click" type="AudioStreamPlayer" parent="Audio"]
|
||||
stream = ExtResource("3_kj0cm")
|
||||
volume_db = -15.0
|
||||
17
gui/pointer/scripts/action_zone.gd
Normal file
@ -0,0 +1,17 @@
|
||||
extends Sprite2D
|
||||
class_name ActionZone
|
||||
|
||||
const OPACITY = 0.4
|
||||
const ACTIVATED_COLOR = Color.TURQUOISE
|
||||
const DEACTIVATED_COLOR = Color.REBECCA_PURPLE
|
||||
|
||||
|
||||
var radius : int = 0
|
||||
var active : bool = false
|
||||
|
||||
func _draw():
|
||||
draw_circle(
|
||||
Vector2.ZERO,
|
||||
radius,
|
||||
Color((ACTIVATED_COLOR if active else DEACTIVATED_COLOR), OPACITY)
|
||||
)
|
||||
1
gui/pointer/scripts/action_zone.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://c2en2hc6a7ils
|
||||
98
gui/pointer/scripts/pointer.gd
Normal file
@ -0,0 +1,98 @@
|
||||
extends Node
|
||||
|
||||
const DEFAULT_ACTION_COLOR = Color.WHITE
|
||||
const ENERGY_ACTION_COLOR = Color("ffff2b")
|
||||
|
||||
@export var default_cursor : Texture2D
|
||||
|
||||
var inspected_entity : InspectableEntity = null
|
||||
var player : Player # renseigné par Player
|
||||
var can_interact : bool = false
|
||||
var current_selected_item : Item = null
|
||||
var can_use_item : bool = false
|
||||
|
||||
func _ready():
|
||||
Input.set_custom_mouse_cursor(default_cursor)
|
||||
%InspectorText.visible = false
|
||||
%Action.visible = false
|
||||
|
||||
func _input(_event):
|
||||
if player:
|
||||
if Input.is_action_just_pressed("move"):
|
||||
player.try_move(
|
||||
player.get_global_mouse_position()
|
||||
)
|
||||
if Input.is_action_just_pressed("drop"):
|
||||
player.drop_item()
|
||||
|
||||
if Input.is_action_just_pressed("action"):
|
||||
if can_interact:
|
||||
var interactable = inspected_entity as Interactable
|
||||
player.try_interact(interactable)
|
||||
elif can_use_item:
|
||||
player.try_use_item(
|
||||
player.inventory.get_item(),
|
||||
player.get_global_mouse_position()
|
||||
)
|
||||
|
||||
func _process(_delta):
|
||||
%Inspector.position = get_viewport().get_mouse_position()
|
||||
|
||||
if player:
|
||||
can_interact = (
|
||||
inspected_entity
|
||||
and inspected_entity is Interactable
|
||||
and player.can_interact(inspected_entity)
|
||||
)
|
||||
|
||||
current_selected_item = player.inventory.get_item()
|
||||
|
||||
can_use_item = (
|
||||
current_selected_item
|
||||
and player.preview_can_use_item(current_selected_item)
|
||||
)
|
||||
|
||||
if current_selected_item:
|
||||
%ActionZone.radius = current_selected_item.use_zone_radius
|
||||
%ActionZone.active = can_use_item
|
||||
else:
|
||||
%ActionZone.radius = 0
|
||||
|
||||
%ActionZone.queue_redraw()
|
||||
|
||||
update_inspector()
|
||||
|
||||
func inspect_entity(entity : InspectableEntity):
|
||||
if inspected_entity and inspected_entity != entity:
|
||||
inspected_entity.inspected = false
|
||||
inspected_entity = entity
|
||||
inspected_entity.inspected = true
|
||||
update_inspector()
|
||||
|
||||
func update_inspector():
|
||||
%InspectorText.visible = inspected_entity != null
|
||||
if inspected_entity:
|
||||
%InspectorText.text = inspected_entity.inspected_text()
|
||||
|
||||
if player:
|
||||
if can_interact and inspected_entity and inspected_entity is Interactable:
|
||||
%Action.visible = true
|
||||
%ActionText.text = inspected_entity.interact_text()
|
||||
%Action.modulate = DEFAULT_ACTION_COLOR if inspected_entity.interaction_cost(player) == 0 else ENERGY_ACTION_COLOR
|
||||
%ActionEnergyImage.visible = inspected_entity.interaction_cost(player) != 0
|
||||
elif can_use_item and current_selected_item:
|
||||
%Action.visible = true
|
||||
%ActionText.text = current_selected_item.use_text()
|
||||
%Action.modulate = DEFAULT_ACTION_COLOR if current_selected_item.use_energy == 0 else ENERGY_ACTION_COLOR
|
||||
%ActionEnergyImage.visible = current_selected_item.use_energy != 0
|
||||
else:
|
||||
%Action.visible = false
|
||||
|
||||
else:
|
||||
%Action.visible = false
|
||||
|
||||
func stop_inspect_entity(entity : InspectableEntity):
|
||||
entity.inspected = false
|
||||
if inspected_entity == entity:
|
||||
inspected_entity = null
|
||||
update_inspector()
|
||||
1
gui/pointer/scripts/pointer.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://vhumsfntpqcl
|
||||
|
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 285 KiB |
@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://qx75h1k3wmm1"
|
||||
path="res://.godot/imported/Tablette info.png-b4fbef928a773f595b589d989235c266.ctex"
|
||||
path="res://.godot/imported/Tablette info.png-e89cd3fdb4a303341f3bbad730de279c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/game/ressources/Tablette info.png"
|
||||
dest_files=["res://.godot/imported/Tablette info.png-b4fbef928a773f595b589d989235c266.ctex"]
|
||||
source_file="res://gui/ressources/Tablette info.png"
|
||||
dest_files=["res://.godot/imported/Tablette info.png-e89cd3fdb4a303341f3bbad730de279c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[gd_resource type="Theme" load_steps=5 format=3 uid="uid://bgcmd213j6gk1"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="1_hv6r3"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="1_hv6r3"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hv6r3"]
|
||||
bg_color = Color(0.976471, 0.741176, 0.4, 1)
|
||||
@ -3,12 +3,12 @@
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://byyfovm1ha5ya"
|
||||
path="res://.godot/imported/AtomicMd-3zXDZ.ttf-72972057c8e238d8e668e97b2f9f70c6.fontdata"
|
||||
path="res://.godot/imported/AtomicMd-3zXDZ.ttf-0d8ee2c5d0b5b97084be121e0cf9710b.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/game/ressources/fonts/AtomicMd-3zXDZ.ttf"
|
||||
dest_files=["res://.godot/imported/AtomicMd-3zXDZ.ttf-72972057c8e238d8e668e97b2f9f70c6.fontdata"]
|
||||
source_file="res://gui/ressources/fonts/AtomicMd-3zXDZ.ttf"
|
||||
dest_files=["res://.godot/imported/AtomicMd-3zXDZ.ttf-0d8ee2c5d0b5b97084be121e0cf9710b.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://c8xf3tfnpufk3"
|
||||
path="res://.godot/imported/spincycle_3d_ot.otf-21ea869159b3b8db074d7006cdac52ac.fontdata"
|
||||
path="res://.godot/imported/spincycle_3d_ot.otf-f71d33fbaded9da2ba85d0eb20bfd1e1.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/game/ressources/fonts/spincycle_3d_ot.otf"
|
||||
dest_files=["res://.godot/imported/spincycle_3d_ot.otf-21ea869159b3b8db074d7006cdac52ac.fontdata"]
|
||||
source_file="res://gui/ressources/fonts/spincycle_3d_ot.otf"
|
||||
dest_files=["res://.godot/imported/spincycle_3d_ot.otf-f71d33fbaded9da2ba85d0eb20bfd1e1.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://cpnsnrqhfkj3k"
|
||||
path="res://.godot/imported/spincycle_ot.otf-27679d167ed7a37649e3338357150952.fontdata"
|
||||
path="res://.godot/imported/spincycle_ot.otf-be21809daa8fde21c00f1cf664ce2342.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/game/ressources/fonts/spincycle_ot.otf"
|
||||
dest_files=["res://.godot/imported/spincycle_ot.otf-27679d167ed7a37649e3338357150952.fontdata"]
|
||||
source_file="res://gui/ressources/fonts/spincycle_ot.otf"
|
||||
dest_files=["res://.godot/imported/spincycle_ot.otf-be21809daa8fde21c00f1cf664ce2342.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://dqwayi8yjwau2"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/game/ressources/fonts/spincycle_ot.otf" id="1_w0wva"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="1_w0wva"]
|
||||
|
||||
[resource]
|
||||
font = ExtResource("1_w0wva")
|
||||
@ -12,13 +12,14 @@ 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-1.0"
|
||||
config/version="proto-2.0"
|
||||
run/main_scene="uid://c5bruelvqbm1k"
|
||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||
config/icon="uid://df0y0s666ui4h"
|
||||
|
||||
[autoload]
|
||||
|
||||
Pointer="*res://gui/pointer/pointer.tscn"
|
||||
Music="*res://common/music/music.tscn"
|
||||
|
||||
[input]
|
||||
@ -47,14 +48,9 @@ move_down={
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
interact={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
action={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(112, 17),"global_position":Vector2(121, 65),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
drop={
|
||||
@ -67,6 +63,11 @@ pause={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(231, 25),"global_position":Vector2(240, 73),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
|
||||
108
root.tscn
@ -1,20 +1,23 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://c5bruelvqbm1k"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://c5bruelvqbm1k"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c54457tbocdwk" path="res://gui/menu/scripts/menu.gd" id="1_bf3um"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/planet/assets/textures/sol_gamejam_normal.png" id="2_huihk"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcn4cq53h1qiy" path="res://stages/terrain/planet/resources/textures/sol_gamejam_fleurs_transp.png" id="3_tw3kd"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="4_gd4vy"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="4_gd4vy"]
|
||||
[ext_resource type="Texture2D" uid="uid://nx4wxpr6mk8l" path="res://gui/menu/assets/texture/SeedingPlanetsLogo.png" id="5_qw60f"]
|
||||
[ext_resource type="Texture2D" uid="uid://03ijmo6xlytu" path="res://gui/menu/assets/texture/abre1glow.png" id="6_eji0w"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://gui/game/assets/icons/bolt.svg" id="7_qwhpj"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="8_bf3um"]
|
||||
|
||||
[node name="Root" type="Node2D"]
|
||||
script = ExtResource("1_bf3um")
|
||||
start_scene_path = "uid://d28cp7a21kwou"
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
process_mode = 3
|
||||
|
||||
[node name="Background1" type="TextureRect" parent="CanvasLayer"]
|
||||
z_index = -1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
@ -25,6 +28,7 @@ expand_mode = 2
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="Background2" type="TextureRect" parent="CanvasLayer"]
|
||||
z_index = -1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
@ -42,17 +46,8 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("4_gd4vy")
|
||||
|
||||
[node name="Logo" type="TextureRect" parent="CanvasLayer/MarginContainer"]
|
||||
z_index = 2
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource("5_qw60f")
|
||||
expand_mode = 5
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="Tree" type="TextureRect" parent="CanvasLayer/MarginContainer"]
|
||||
z_index = -1
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
@ -61,34 +56,91 @@ texture = ExtResource("6_eji0w")
|
||||
expand_mode = 4
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="Start" type="Button" parent="CanvasLayer/MarginContainer"]
|
||||
[node name="Version" type="Label" parent="CanvasLayer/MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 8
|
||||
size_flags_vertical = 0
|
||||
text = "Version"
|
||||
|
||||
[node name="GridContainer" type="HBoxContainer" parent="CanvasLayer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/MarginContainer/GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 20
|
||||
alignment = 1
|
||||
|
||||
[node name="Logo" type="TextureRect" parent="CanvasLayer/MarginContainer/GridContainer/VBoxContainer"]
|
||||
z_index = 2
|
||||
custom_minimum_size = Vector2(600, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource("5_qw60f")
|
||||
expand_mode = 5
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Start" type="Button" parent="CanvasLayer/MarginContainer/GridContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource("4_gd4vy")
|
||||
theme_override_font_sizes/font_size = 33
|
||||
text = "Start"
|
||||
icon = ExtResource("7_qwhpj")
|
||||
|
||||
[node name="Version" type="Label" parent="CanvasLayer/MarginContainer"]
|
||||
[node name="Credits" type="VBoxContainer" parent="CanvasLayer/MarginContainer/GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 0
|
||||
text = "Prototype 1"
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="Credits" type="Label" parent="CanvasLayer/MarginContainer"]
|
||||
[node name="ArtTitle" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 8
|
||||
text = "🎨 Art
|
||||
Céline Ferrand / Lunarde
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("4_gd4vy")
|
||||
text = "Art"
|
||||
label_settings = ExtResource("8_bf3um")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ArtText" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"]
|
||||
layout_mode = 2
|
||||
text = "Céline Ferrand / Lunarde
|
||||
Camille Fleury
|
||||
"
|
||||
horizontal_alignment = 1
|
||||
|
||||
🖥️ Development / 🧩 Game Design
|
||||
Zacharie Guet / Zink
|
||||
[node name="DevTitle" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("4_gd4vy")
|
||||
text = "Development / Game Design"
|
||||
label_settings = ExtResource("8_bf3um")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="DevText" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"]
|
||||
layout_mode = 2
|
||||
text = "Zacharie Guet / Zink
|
||||
Victor Robert Jaunet / Altaezio
|
||||
"
|
||||
horizontal_alignment = 1
|
||||
|
||||
🎸 Music
|
||||
Niels / Nilou"
|
||||
[node name="MusicTitle" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("4_gd4vy")
|
||||
text = "Music"
|
||||
label_settings = ExtResource("8_bf3um")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/MarginContainer/Start" to="." method="_on_start_pressed"]
|
||||
[node name="MusicText" type="Label" parent="CanvasLayer/MarginContainer/GridContainer/Credits"]
|
||||
layout_mode = 2
|
||||
text = "Niels / Nilou"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/MarginContainer/GridContainer/VBoxContainer/Start" to="." method="_on_start_pressed"]
|
||||
|
||||
@ -3,7 +3,11 @@ class_name Planet
|
||||
|
||||
signal planet_updated(planet : Planet)
|
||||
signal day_limit_exceed(planet : Planet)
|
||||
signal pass_day_started(planet : Planet)
|
||||
signal pass_day_proceeded(planet : Planet)
|
||||
signal pass_day_ended(planet : Planet)
|
||||
|
||||
const PASS_DAY_ANIMATION_TIME : float = 1.5
|
||||
const DAY_LIMIT : int = 10
|
||||
const PLANET_TEXTURE_SCALE : float = 5.0
|
||||
|
||||
@ -36,6 +40,13 @@ func _ready():
|
||||
|
||||
#region ------------------ Generation ------------------
|
||||
|
||||
func instantiate_entity(s: PackedScene, entity_position : Vector2):
|
||||
var entity = s.instantiate() as Node2D
|
||||
|
||||
add_entity(entity)
|
||||
|
||||
entity.global_position = entity_position
|
||||
|
||||
func add_entity(e : Node2D, container : Node2D = entityContainer):
|
||||
if e.get_parent():
|
||||
e.get_parent().remove_child(e)
|
||||
@ -45,7 +56,6 @@ func add_entity(e : Node2D, container : Node2D = entityContainer):
|
||||
|
||||
container.add_child(e)
|
||||
|
||||
|
||||
func generate_polygon_sprite(order : int = 0) -> Polygon2D:
|
||||
var sprite = Polygon2D.new()
|
||||
var size = terrainData.terrainSize
|
||||
@ -111,15 +121,35 @@ func impact_contamination(impact_position : Vector2, impact_radius : int, contam
|
||||
if contamination_texture:
|
||||
contamination_texture.update(terrainData.contamination)
|
||||
|
||||
func is_in_zone(point : Vector2) -> bool:
|
||||
return terrainData.is_in_image(terrainData.get_pixel_point(point), terrainData.contamination)
|
||||
|
||||
func is_there_contamination(point : Vector2) -> bool:
|
||||
return terrainData.get_contamination(point) < 0.5
|
||||
|
||||
func pass_day():
|
||||
for e : Node2D in entityContainer.get_children():
|
||||
if e.has_method("_start_pass_day"):
|
||||
e._start_pass_day()
|
||||
pass_day_started.emit(self)
|
||||
await get_tree().create_timer(PASS_DAY_ANIMATION_TIME/2.).timeout
|
||||
|
||||
generate_loot()
|
||||
pass_day_proceeded.emit(self)
|
||||
day += 1
|
||||
for e : Node2D in entityContainer.get_children():
|
||||
if e.has_method("_pass_day"):
|
||||
e._pass_day()
|
||||
generate_loot()
|
||||
|
||||
pass_day_ended.emit(self)
|
||||
await get_tree().create_timer(PASS_DAY_ANIMATION_TIME/2.).timeout
|
||||
for e : Node2D in entityContainer.get_children():
|
||||
if e.has_method("_end_pass_day"):
|
||||
e._end_pass_day()
|
||||
|
||||
decontamination_coverage = terrainData.get_decontamination_coverage()
|
||||
if day + 1 > DAY_LIMIT:
|
||||
day_limit_exceed.emit(self)
|
||||
|
||||
func generate_loot(number : int = loot_number.pick_random()):
|
||||
for i in range(number):
|
||||
@ -137,11 +167,3 @@ func generate_loot(number : int = loot_number.pick_random()):
|
||||
)
|
||||
|
||||
#endregion
|
||||
|
||||
func _on_root_gui_day_pass_proceed():
|
||||
pass_day()
|
||||
|
||||
func _on_root_gui_day_pass_finished():
|
||||
decontamination_coverage = terrainData.get_decontamination_coverage()
|
||||
if day + 1 > DAY_LIMIT:
|
||||
day_limit_exceed.emit(self)
|
||||
|
||||