developpement d'écran de chargement et d'écran de sélection de niveau
* modification de certains assets * optimisation de chunks * ajout d'un SceneManager * ajout d'un premier dialogue avec Demeter * changement des jour en charge * mise en place d'un système de run * etc...
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
extends Interactable
|
||||
class_name TruckLadder
|
||||
|
||||
const TRUCK_SCENE_PATH = "res://stages/terrain/truck/truck.tscn"
|
||||
|
||||
func interact(p : Player):
|
||||
p.planet.save()
|
||||
get_tree().change_scene_to_file(TRUCK_SCENE_PATH)
|
||||
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
|
||||
return true
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
extends Interactable
|
||||
class_name TruckRecharge
|
||||
|
||||
func interact(_p: Player) -> bool:
|
||||
|
||||
if planet == null:
|
||||
return false
|
||||
|
||||
planet.pass_day()
|
||||
|
||||
return true
|
||||
@@ -0,0 +1,20 @@
|
||||
extends Interactable
|
||||
class_name TruckRecharge
|
||||
|
||||
func can_interact(_p : Player) -> bool:
|
||||
return (
|
||||
planet != null
|
||||
and planet.data
|
||||
and planet.data.charges > 0
|
||||
)
|
||||
|
||||
func interact(_p: Player) -> bool:
|
||||
|
||||
if can_interact(_p):
|
||||
planet.data.charges -= 1
|
||||
planet.pass_day()
|
||||
|
||||
%Bolt.modulate = Color.WHITE if planet.data.charges > 0 else Color.RED
|
||||
|
||||
return true
|
||||
return false
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/recharge_station.gd" id="1_ipgcv"]
|
||||
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
|
||||
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
|
||||
|
||||
@@ -29,5 +29,6 @@ scale = Vector2(0.5, 0.5)
|
||||
texture = SubResource("AtlasTexture_ot7vv")
|
||||
|
||||
[node name="Bolt" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -15)
|
||||
texture = ExtResource("3_jcfmm")
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
|
||||
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
|
||||
radius = 26.0
|
||||
height = 106.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ot7vv"]
|
||||
atlas = ExtResource("2_87dtp")
|
||||
region = Rect2(64, 161, 101, 205)
|
||||
|
||||
[node name="TruckRecharge" type="Area2D"]
|
||||
script = ExtResource("1_ipgcv")
|
||||
default_interact_text = "RECHARGE"
|
||||
default_info_title = "RECHARGE_STATION"
|
||||
default_info_desc = "RECHARGE_STATION_DESC_TEXT"
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(1, -14)
|
||||
shape = SubResource("CapsuleShape2D_bjhct")
|
||||
|
||||
[node name="RechargeStation" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -17)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = SubResource("AtlasTexture_ot7vv")
|
||||
|
||||
[node name="Bolt" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -15)
|
||||
texture = ExtResource("3_jcfmm")
|
||||
@@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
|
||||
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
|
||||
radius = 26.0
|
||||
height = 106.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ot7vv"]
|
||||
atlas = ExtResource("2_87dtp")
|
||||
region = Rect2(64, 161, 101, 205)
|
||||
|
||||
[node name="TruckRecharge" type="Area2D"]
|
||||
script = ExtResource("1_ipgcv")
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(1, -14)
|
||||
shape = SubResource("CapsuleShape2D_bjhct")
|
||||
|
||||
[node name="RechargeStation" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -17)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = SubResource("AtlasTexture_ot7vv")
|
||||
|
||||
[node name="Bolt" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -15)
|
||||
texture = ExtResource("3_jcfmm")
|
||||
@@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
|
||||
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
|
||||
radius = 26.0
|
||||
height = 106.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ot7vv"]
|
||||
atlas = ExtResource("2_87dtp")
|
||||
region = Rect2(64, 161, 101, 205)
|
||||
|
||||
[node name="TruckRecharge" type="Area2D"]
|
||||
script = ExtResource("1_ipgcv")
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(1, -14)
|
||||
shape = SubResource("CapsuleShape2D_bjhct")
|
||||
|
||||
[node name="RechargeStation" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -17)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = SubResource("AtlasTexture_ot7vv")
|
||||
|
||||
[node name="Bolt" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -15)
|
||||
texture = ExtResource("3_jcfmm")
|
||||
@@ -1,8 +1,7 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://2hrg6yjk0yt0"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://2hrg6yjk0yt0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bmjjpk4lvijws" path="res://entities/plants/scripts/plant_sprite.gd" id="1_pq8o7"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_j6jm5"]
|
||||
[ext_resource type="Texture2D" uid="uid://bu26h0iqutnky" path="res://entities/underground_loot/assets/sprites/underground_loot.svg" id="4_j6jm5"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wyuub"]
|
||||
atlas = ExtResource("3_j6jm5")
|
||||
@@ -114,12 +113,6 @@ region_enabled = true
|
||||
region_rect = Rect2(0, -50, 124, 135)
|
||||
region_filter_clip_enabled = true
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Sprite/PlantedSeed"]
|
||||
modulate = Color(0.14902, 0.172549, 0.270588, 1)
|
||||
position = Vector2(0, 62.2222)
|
||||
scale = Vector2(0.426047, 0.430108)
|
||||
texture = ExtResource("4_j6jm5")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
|
||||
@@ -14,7 +14,7 @@ func get_mutation_description() -> String:
|
||||
return tr("STRONG_EFFECT_TEXT_LEVEL_%d") % [roundi(get_score_multiplier() * 100)]
|
||||
|
||||
func get_score_multiplier():
|
||||
return float(level)/2.
|
||||
return float(level)/2
|
||||
|
||||
func mutate_score(_plant_state : Plant.State, _plant : Plant, score: int) -> int:
|
||||
return score + roundi(score * get_score_multiplier())
|
||||
@@ -280,7 +280,7 @@ class InteractableInstruction extends Instruction:
|
||||
|
||||
class ActionZone:
|
||||
var item : Item = null
|
||||
var area : Area2D
|
||||
var area : Area2D = Area2D.new()
|
||||
var affected_areas : Array[InspectableEntity]= []
|
||||
|
||||
func _init(_i : Item):
|
||||
@@ -330,4 +330,4 @@ class ActionZone:
|
||||
return Math.get_tiles_in_circle(
|
||||
get_global_position(),
|
||||
item.get_usage_zone_radius()
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user