ajout du camion #87
* changements des objectifs, donnent juste des graines, sprite moins gros et objectifs plus nombreux * changement de la probabilité de mutation * refactor du code terrain et planet
@ -56,8 +56,6 @@ func generate_objective_rewards(level = 0) -> Array[ObjectiveReward]:
|
||||
var amount = level + 1
|
||||
|
||||
var possible_objective_rewards_path : Array[ObjectiveReward] = [
|
||||
UpgradePlayerMaxEnergyReward.new(),
|
||||
UpgradePlayerInventorySizeReward.new(),
|
||||
LootRandomSeedsReward.new(randi_range(4+level, 6+level))
|
||||
]
|
||||
|
||||
|
||||
@ -30,10 +30,10 @@ func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
return player.planet.is_in_base(zone.get_global_position())
|
||||
return player.planet && player.planet.is_in_base(zone.get_global_position())
|
||||
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
if machine_type and machine_level:
|
||||
if machine_type and machine_level and player.planet:
|
||||
player.planet.instantiate_machine(machine_type, machine_level, zone.get_global_position())
|
||||
return true
|
||||
return false
|
||||
|
||||
@ -25,7 +25,7 @@ func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
return true
|
||||
return player.planet != null
|
||||
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
player.planet.instantiate_entity(scene, zone.get_global_position())
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
extends Item
|
||||
class_name Seed
|
||||
|
||||
const MUTATION_PROBABILITY = 0.2
|
||||
const MUTATION_PROBABILITY = 0.3
|
||||
|
||||
const SHOVEL_ICON = preload("res://common/icons/shovel.svg")
|
||||
const GROWING_ICON = preload("res://common/icons/chevrons-up.svg")
|
||||
@ -39,6 +39,9 @@ func is_one_time_use():
|
||||
return true
|
||||
|
||||
func can_use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
if player.planet == null:
|
||||
return false
|
||||
|
||||
var is_there_a_plant_here = false
|
||||
for area in zone.area.get_overlapping_areas() :
|
||||
if area is Plant:
|
||||
@ -52,6 +55,9 @@ func can_use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
return not is_there_a_plant_here and not is_there_contamination_in_zone
|
||||
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
if player.planet == null:
|
||||
return false
|
||||
|
||||
player.play_sfx("dig")
|
||||
return player.planet.plant(
|
||||
plant_type,
|
||||
|
||||
@ -10,7 +10,7 @@ func get_seeds_production(l : int = level) -> int:
|
||||
|
||||
func product(player : Player):
|
||||
for i in range(get_seeds_production()):
|
||||
player.planet.drop_item(
|
||||
player.terrain.drop_item(
|
||||
Seed.new(GameInfo.game_data.unlocked_plant_types.pick_random()),
|
||||
global_position,
|
||||
100
|
||||
|
||||
@ -1,88 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
@ -1,29 +0,0 @@
|
||||
[gd_scene load_steps=5 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"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_3xua0"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
|
||||
radius = 15.0
|
||||
height = 72.0
|
||||
|
||||
[node name="RechargeStation" type="Area2D"]
|
||||
script = ExtResource("1_2ffjo")
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(1, -1)
|
||||
rotation = -1.5708
|
||||
shape = SubResource("CapsuleShape2D_bjhct")
|
||||
|
||||
[node name="RechargeStation" type="Sprite2D" parent="."]
|
||||
self_modulate = Color(0.729412, 0.588235, 0.105882, 1)
|
||||
position = Vector2(0, -17)
|
||||
scale = Vector2(0.3, 0.3)
|
||||
texture = ExtResource("2_58ax0")
|
||||
|
||||
[node name="Bolt" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -40)
|
||||
scale = Vector2(0.375, 0.375)
|
||||
texture = ExtResource("3_3xua0")
|
||||
@ -1,17 +1,24 @@
|
||||
extends InspectableEntity
|
||||
class_name Interactable
|
||||
|
||||
signal interacted(p: Player)
|
||||
|
||||
@export var default_interact_text = ""
|
||||
|
||||
var available : bool = true
|
||||
|
||||
func interact_text() -> String:
|
||||
return default_interact_text
|
||||
|
||||
func can_interact(_p : Player) -> bool:
|
||||
return available
|
||||
|
||||
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:
|
||||
interacted.emit(_p)
|
||||
return true
|
||||
|
||||
func generate_collision(area_width : float) -> CollisionShape2D:
|
||||
var collision = CollisionShape2D.new()
|
||||
|
||||
BIN
entities/interactables/truck/assets/sprites/truck_ladder.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dlrj7tyi5wfh8"
|
||||
path="res://.godot/imported/truck_ladder.png-00d93dc49c0cc6457febb75d7b82dec4.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/truck/assets/sprites/truck_ladder.png"
|
||||
dest_files=["res://.godot/imported/truck_ladder.png-00d93dc49c0cc6457febb75d7b82dec4.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
22
entities/interactables/truck/ladder/scripts/truck_ladder.gd
Normal file
@ -0,0 +1,22 @@
|
||||
extends Interactable
|
||||
class_name TruckLadder
|
||||
|
||||
@export var truck_interior : TruckInterior
|
||||
@export var planet_camera : Camera
|
||||
|
||||
func _ready():
|
||||
truck_interior.player_exited.connect(_on_truck_interior_player_exited)
|
||||
|
||||
func interact(p : Player):
|
||||
truck_interior.add_entity(p)
|
||||
p.global_position = truck_interior.spawn_position.global_position
|
||||
truck_interior.camera.make_current()
|
||||
planet_camera.following = null
|
||||
return true
|
||||
|
||||
|
||||
func _on_truck_interior_player_exited(p):
|
||||
planet.add_entity(p)
|
||||
p.global_position = global_position
|
||||
planet_camera.make_current()
|
||||
planet_camera.following = p
|
||||
@ -0,0 +1 @@
|
||||
uid://buimaomxu01wj
|
||||
33
entities/interactables/truck/ladder/truck_ladder.tscn
Normal file
@ -0,0 +1,33 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cg1visg52i21a"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://buimaomxu01wj" path="res://entities/interactables/truck/ladder/scripts/truck_ladder.gd" id="1_26qdk"]
|
||||
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_xila4"]
|
||||
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://common/icons/logout.svg" id="3_214ms"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_hslnw"]
|
||||
radius = 26.0
|
||||
height = 112.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gmirm"]
|
||||
atlas = ExtResource("2_xila4")
|
||||
region = Rect2(205, 157, 87, 208)
|
||||
|
||||
[node name="TruckLadder" type="Area2D"]
|
||||
script = ExtResource("1_26qdk")
|
||||
default_interact_text = "Enter Truck"
|
||||
default_info_title = "Truck Entrance"
|
||||
default_info_desc = "A good old ladder."
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-0.25, -28)
|
||||
shape = SubResource("CapsuleShape2D_hslnw")
|
||||
|
||||
[node name="TruckLadder" type="Sprite2D" parent="."]
|
||||
position = Vector2(-1.25, -30)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = SubResource("AtlasTexture_gmirm")
|
||||
|
||||
[node name="Bolt" type="Sprite2D" parent="."]
|
||||
position = Vector2(0.75, -29.000004)
|
||||
texture = ExtResource("3_214ms")
|
||||
@ -1,10 +1,11 @@
|
||||
extends Machine
|
||||
class_name RechargeStation
|
||||
|
||||
var planet : Planet # mis à jour par la classe Planet
|
||||
extends Interactable
|
||||
class_name TruckRecharge
|
||||
|
||||
func interact(_p: Player) -> bool:
|
||||
|
||||
if planet == null:
|
||||
return false
|
||||
|
||||
planet.pass_day()
|
||||
|
||||
return true
|
||||
@ -19,4 +20,4 @@ func inspector_info() -> Inspector.Info:
|
||||
return Inspector.Info.new(
|
||||
pointer_text(),
|
||||
"You can recharge your robot here. When recharging, time will pass and plants may grow."
|
||||
)
|
||||
)
|
||||
30
entities/interactables/truck/recharge/truck_recharge.tscn
Normal file
@ -0,0 +1,30 @@
|
||||
[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="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="."]
|
||||
position = Vector2(0, -15)
|
||||
texture = ExtResource("3_jcfmm")
|
||||
BIN
entities/objectives/assets/sprites/herbe.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
@ -2,22 +2,24 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c82ljr3in67am"
|
||||
path="res://.godot/imported/recharge_station.svg-b4dbe96f287bff2995b6160acd3f32ff.ctex"
|
||||
uid="uid://4iukrxpg34y4"
|
||||
path="res://.godot/imported/herbe.png-0b71f9ccc1e3943af9b0f3a135d3651b.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"]
|
||||
source_file="res://entities/objectives/assets/sprites/herbe.png"
|
||||
dest_files=["res://.godot/imported/herbe.png-0b71f9ccc1e3943af9b0f3a135d3651b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
@ -25,6 +27,10 @@ mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
@ -32,6 +38,3 @@ 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
entities/objectives/assets/sprites/herbe3.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
40
entities/objectives/assets/sprites/herbe3.png.import
Normal file
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bsetwgt5tqv7v"
|
||||
path="res://.godot/imported/herbe3.png-a47f3310ca32019ca3d036e811d21212.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/objectives/assets/sprites/herbe3.png"
|
||||
dest_files=["res://.godot/imported/herbe3.png-a47f3310ca32019ca3d036e811d21212.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
entities/objectives/assets/sprites/herbe4.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
40
entities/objectives/assets/sprites/herbe4.png.import
Normal file
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://k4v52q6eejv"
|
||||
path="res://.godot/imported/herbe4.png-c674d45256bbf00e0fd646fd55e2e33b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/objectives/assets/sprites/herbe4.png"
|
||||
dest_files=["res://.godot/imported/herbe4.png-c674d45256bbf00e0fd646fd55e2e33b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
entities/objectives/assets/sprites/herbe8_glow.png
Normal file
|
After Width: | Height: | Size: 117 KiB |
40
entities/objectives/assets/sprites/herbe8_glow.png.import
Normal file
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ckb8w7hsfevvt"
|
||||
path="res://.godot/imported/herbe8_glow.png-c4d058e6fea519767afa64e839e5f87f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/objectives/assets/sprites/herbe8_glow.png"
|
||||
dest_files=["res://.godot/imported/herbe8_glow.png-c4d058e6fea519767afa64e839e5f87f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
entities/objectives/assets/sprites/plante_morte.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
40
entities/objectives/assets/sprites/plante_morte.png.import
Normal file
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bxb13hfnhxpvv"
|
||||
path="res://.godot/imported/plante_morte.png-308d7033b9ec4bc89434e061a168e35b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/objectives/assets/sprites/plante_morte.png"
|
||||
dest_files=["res://.godot/imported/plante_morte.png-308d7033b9ec4bc89434e061a168e35b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@ -1,10 +1,10 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://djl2le58ckgdx"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://djl2le58ckgdx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://j8fpi8rd8eyy" path="res://entities/objectives/scripts/objective.gd" id="1_3hqw5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dbednu7eygtrf" path="res://entities/objectives/assets/sprites/arbre_mort.png" id="2_3hqw5"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4pv2o7crchc0" path="res://entities/objectives/assets/sprites/little_plant.png" id="3_dulsb"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="4_6uhem"]
|
||||
[ext_resource type="Texture2D" uid="uid://bo3o2qf3i20ke" path="res://common/icons/scuba-diving-tank.svg" id="5_6uhem"]
|
||||
[ext_resource type="Texture2D" uid="uid://4iukrxpg34y4" path="res://entities/objectives/assets/sprites/herbe.png" id="2_047qm"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxb13hfnhxpvv" path="res://entities/objectives/assets/sprites/plante_morte.png" id="3_bvagy"]
|
||||
[ext_resource type="Texture2D" uid="uid://k4v52q6eejv" path="res://entities/objectives/assets/sprites/herbe4.png" id="4_lrlky"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckb8w7hsfevvt" path="res://entities/objectives/assets/sprites/herbe8_glow.png" id="5_6uhem"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_v08i5"]
|
||||
length = 0.001
|
||||
@ -18,7 +18,7 @@ tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0.443137, 0.443137, 0.443137, 1)]
|
||||
"values": [Color(0.627451, 0.85490197, 0.8980392, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
@ -83,26 +83,26 @@ tracks/5/keys = {
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("LittlePlant3:scale")
|
||||
tracks/6/path = NodePath("ArbreMort:scale")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.094358, 0.094358)]
|
||||
"values": [Vector2(0.162791, 0.162791)]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("ArbreMort:scale")
|
||||
tracks/7/path = NodePath("LittlePlant3:scale")
|
||||
tracks/7/interp = 1
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.162791, 0.162791)]
|
||||
"values": [Vector2(0.094358, 0.094358)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_6uhem"]
|
||||
@ -117,7 +117,7 @@ tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.266667),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.443137, 0.443137, 0.443137, 1), Color(1, 1, 1, 1)]
|
||||
"values": [Color(0.62835556, 0.85348916, 0.8974243, 1), Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
@ -141,7 +141,7 @@ tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0.433333, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0.094358, 0.094358)]
|
||||
"values": [Vector2(0, 0), Vector2(0.044, 0.044)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
@ -165,7 +165,7 @@ tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0.6, 0.8),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0.094358, 0.094358)]
|
||||
"values": [Vector2(0, 0), Vector2(0.044, 0.044)]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
@ -182,27 +182,27 @@ tracks/5/keys = {
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("LittlePlant3:scale")
|
||||
tracks/6/path = NodePath("ArbreMort:scale")
|
||||
tracks/6/interp = 2
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0.4, 0.533333),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0.094358, 0.094358)]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("ArbreMort:scale")
|
||||
tracks/7/interp = 2
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.266667, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.162791, 0.162791), Vector2(0.183, 0.093), Vector2(0.123, 0.178), Vector2(0.162791, 0.162791)]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/imported = false
|
||||
tracks/7/enabled = true
|
||||
tracks/7/path = NodePath("LittlePlant3:scale")
|
||||
tracks/7/interp = 2
|
||||
tracks/7/loop_wrap = true
|
||||
tracks/7/keys = {
|
||||
"times": PackedFloat32Array(0.4, 0.533333),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0.054, 0.054)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_047qm"]
|
||||
_data = {
|
||||
@ -211,12 +211,8 @@ _data = {
|
||||
}
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bvagy"]
|
||||
radius = 24.0
|
||||
height = 160.0
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_v08i5"]
|
||||
font = ExtResource("4_6uhem")
|
||||
font_size = 18
|
||||
radius = 15.0
|
||||
height = 68.0
|
||||
|
||||
[node name="Objective" type="Area2D"]
|
||||
script = ExtResource("1_3hqw5")
|
||||
@ -229,53 +225,31 @@ libraries = {
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -20)
|
||||
position = Vector2(-1, -16)
|
||||
rotation = 1.5708
|
||||
shape = SubResource("CapsuleShape2D_bvagy")
|
||||
|
||||
[node name="ArbreMort" type="Sprite2D" parent="."]
|
||||
modulate = Color(0.443137, 0.443137, 0.443137, 1)
|
||||
position = Vector2(5, 4)
|
||||
scale = Vector2(0.162791, 0.162791)
|
||||
texture = ExtResource("2_3hqw5")
|
||||
centered = false
|
||||
offset = Vector2(-627.055, -607.11)
|
||||
|
||||
[node name="LittlePlant" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(-22, -46)
|
||||
position = Vector2(-15, -25)
|
||||
scale = Vector2(0.094358, 0.094358)
|
||||
texture = ExtResource("3_dulsb")
|
||||
texture = ExtResource("2_047qm")
|
||||
|
||||
[node name="ArbreMort" type="Sprite2D" parent="."]
|
||||
modulate = Color(0.627451, 0.85490197, 0.8980392, 1)
|
||||
position = Vector2(0, -17)
|
||||
scale = Vector2(0.162791, 0.162791)
|
||||
texture = ExtResource("3_bvagy")
|
||||
offset = Vector2(0, -85.55)
|
||||
|
||||
[node name="LittlePlant2" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(39, -25)
|
||||
position = Vector2(21, -22)
|
||||
scale = Vector2(0.094358, 0.094358)
|
||||
texture = ExtResource("3_dulsb")
|
||||
texture = ExtResource("4_lrlky")
|
||||
|
||||
[node name="LittlePlant3" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(-49, -14)
|
||||
position = Vector2(0, -15.000002)
|
||||
scale = Vector2(0.094358, 0.094358)
|
||||
texture = ExtResource("3_dulsb")
|
||||
|
||||
[node name="RewardInfo" type="HBoxContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = -67.0
|
||||
offset_top = -34.0
|
||||
offset_right = 51.0
|
||||
offset_bottom = -15.0
|
||||
theme_override_constants/separation = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="RewardText" type="Label" parent="RewardInfo"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "bla"
|
||||
label_settings = SubResource("LabelSettings_v08i5")
|
||||
|
||||
[node name="RewardIcon" type="TextureRect" parent="RewardInfo"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_6uhem")
|
||||
expand_mode = 2
|
||||
|
||||
@ -5,14 +5,7 @@ const RANDOM_MAX_OBJECTIVE_INTERVAL = 1.
|
||||
const DECONTAMINATION_ICON = preload("res://common/icons/skull.svg")
|
||||
|
||||
var completed : bool = false
|
||||
var planet : Planet
|
||||
@export var reward : ObjectiveReward = null :
|
||||
set(r):
|
||||
reward = r
|
||||
update_reward_info(r)
|
||||
|
||||
func _ready():
|
||||
update_reward_info(reward)
|
||||
@export var reward : ObjectiveReward = null
|
||||
|
||||
func pointer_text():
|
||||
return "Contamination Objective"
|
||||
@ -20,7 +13,7 @@ func pointer_text():
|
||||
func inspector_info() -> Inspector.Info:
|
||||
var info : Inspector.Info = Inspector.Info.new(
|
||||
pointer_text(),
|
||||
"This dead log can hide a treasure of life."
|
||||
"This dead branch can hide a treasure of life."
|
||||
)
|
||||
|
||||
info.framed_infos.append(
|
||||
@ -40,9 +33,3 @@ func _end_pass_day():
|
||||
%AnimationPlayer.play("activate")
|
||||
%RewardInfo.visible = false
|
||||
completed = true
|
||||
|
||||
func update_reward_info(r : ObjectiveReward):
|
||||
if r:
|
||||
%RewardText.text = r.get_text()
|
||||
%RewardIcon.texture = r.get_icon()
|
||||
%RewardInfo.visible = r != null
|
||||
|
||||
@ -7,7 +7,8 @@ func _init(_day_limit_increase : int):
|
||||
day_limit_increase = _day_limit_increase
|
||||
|
||||
func reward(objective : Objective):
|
||||
objective.planet.day_limit += day_limit_increase
|
||||
if objective.planet:
|
||||
objective.planet.day_limit += day_limit_increase
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/hourglass-empty.svg")
|
||||
|
||||
@ -18,7 +18,7 @@ func get_description() -> String:
|
||||
return "Loot the following item: " + item.name + "."
|
||||
|
||||
func reward(objective : Objective):
|
||||
objective.planet.drop_item(
|
||||
objective.terrain.drop_item(
|
||||
item,
|
||||
objective.global_position,
|
||||
REWARD_ITEM_RANDOM_DISPLACEMENT_FACTOR
|
||||
|
||||
@ -19,7 +19,7 @@ func get_description() -> String:
|
||||
|
||||
func reward(objective : Objective):
|
||||
for i in range(seeds_number):
|
||||
objective.planet.drop_item(
|
||||
objective.terrain.drop_item(
|
||||
Seed.new(GameInfo.game_data.unlocked_plant_types.pick_random()),
|
||||
objective.global_position,
|
||||
REWARD_SEED_RANDOM_DISPLACEMENT_FACTOR
|
||||
|
||||
@ -7,7 +7,7 @@ func _init(_recharge_amount : int = 1):
|
||||
recharge_amount = _recharge_amount
|
||||
|
||||
func reward(objective : Objective):
|
||||
objective.planet.player.recharge(recharge_amount)
|
||||
objective.terrain.player.recharge(recharge_amount)
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/bolt.svg")
|
||||
|
||||
@ -7,7 +7,7 @@ func _init(_upgrade_amount : int = 1):
|
||||
upgrade_amount = _upgrade_amount
|
||||
|
||||
func reward(objective : Objective):
|
||||
objective.planet.player.upgrade_max_energy(upgrade_amount)
|
||||
objective.terrain.player.upgrade_max_energy(upgrade_amount)
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/bolt.svg")
|
||||
|
||||
@ -7,7 +7,7 @@ func _init(_upgrade_amount : int = 1):
|
||||
upgrade_amount = _upgrade_amount
|
||||
|
||||
func reward(objective : Objective):
|
||||
objective.planet.player.upgrade_inventory_size(upgrade_amount)
|
||||
objective.terrain.player.upgrade_inventory_size(upgrade_amount)
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/backpack.svg")
|
||||
|
||||
@ -16,7 +16,6 @@ const SPRITE_SCENE : PackedScene = preload("res://entities/plants/plant_sprite.t
|
||||
enum State {PLANTED, GROWING, MATURE}
|
||||
|
||||
@export var plant_type: PlantType
|
||||
var planet: Planet # mis à jour par la classe Planet
|
||||
|
||||
var state: State = State.PLANTED: set = change_state
|
||||
@export var day: int = 0 : set = set_day
|
||||
|
||||
@ -8,7 +8,9 @@ const DEFAULT_INVENTORY_SIZE = 2
|
||||
signal player_updated(player: Player)
|
||||
signal upgraded
|
||||
|
||||
var planet : Planet # mis à jour par la classe Planet
|
||||
var terrain : Terrain
|
||||
var planet : Planet :
|
||||
get(): return terrain if terrain is Planet else null
|
||||
@export var speed = 350
|
||||
|
||||
var max_energy : int = 3
|
||||
@ -136,7 +138,7 @@ func pick_item(item : Item) -> Item:
|
||||
func drop_item():
|
||||
var item_to_drop = inventory.pop_item()
|
||||
if item_to_drop:
|
||||
planet.drop_item(item_to_drop, global_position)
|
||||
terrain.drop_item(item_to_drop, global_position)
|
||||
play_sfx("drop")
|
||||
|
||||
func delete_item(item: Item):
|
||||
|
||||
@ -3,6 +3,13 @@ class_name InspectableEntity
|
||||
|
||||
const MODULATE_INSPECTED_COLOR = Color.GRAY
|
||||
|
||||
var terrain : Terrain
|
||||
var planet : Planet :
|
||||
get(): return terrain if terrain is Planet else null
|
||||
|
||||
@export var default_info_title = ""
|
||||
@export var default_info_desc = ""
|
||||
|
||||
@onready var default_modulate : Color = modulate
|
||||
@onready var inspectable_signals_setuped : bool = setup_inspectable_signals()
|
||||
|
||||
@ -21,11 +28,12 @@ func _on_mouse_excited():
|
||||
Pointer.stop_inspect(self)
|
||||
|
||||
func pointer_text():
|
||||
return ""
|
||||
return default_info_title
|
||||
|
||||
func inspector_info() -> Inspector.Info:
|
||||
return Inspector.Info.new(
|
||||
pointer_text()
|
||||
pointer_text(),
|
||||
default_info_desc
|
||||
)
|
||||
|
||||
func _notification(what):
|
||||
|
||||
@ -7,13 +7,10 @@ const LOOTED_ITEM_RANDOM_RANGE = 50
|
||||
const SPRITE_SCENE : PackedScene = preload("res://entities/underground_loot/underground_loot_sprite.tscn")
|
||||
|
||||
@export var loot : Array[Item]
|
||||
var planet : Planet # mis à jour par la classe Planet
|
||||
|
||||
@onready var sprite_object: Node2D = generate_sprite()
|
||||
@onready var collision_shape: CollisionShape2D = generate_collision_shape()
|
||||
|
||||
func _init(_planet = null):
|
||||
planet = _planet
|
||||
|
||||
func pointer_text():
|
||||
return "Buried Loot"
|
||||
|
||||
@ -57,7 +57,7 @@ func update_no_energy_left_info(energy):
|
||||
func _on_planet_new_quota_started(planet:Planet):
|
||||
%Announce.announce(
|
||||
"New Quota",
|
||||
"Reach " + str(roundi(planet.next_quota)) + " units before " + str(Planet.DEFAULT_DAY_LIMIT) + " days"
|
||||
"Reach " + str(roundi(planet.next_quota)) + " garden score before " + str(Planet.DEFAULT_DAY_LIMIT) + " days"
|
||||
)
|
||||
|
||||
func _on_planet_pass_day_ended(planet:Planet):
|
||||
@ -65,12 +65,12 @@ func _on_planet_pass_day_ended(planet:Planet):
|
||||
if remaining_days == 1:
|
||||
%Announce.announce(
|
||||
"Last day for reaching quota",
|
||||
str(roundi(planet.next_quota - planet.decontamination_surface)) + " units left to decontaminate",
|
||||
str(roundi(planet.next_quota - planet.garden_score)) + " garden score left",
|
||||
Announce.RED_COLOR
|
||||
)
|
||||
if remaining_days == 2:
|
||||
%Announce.announce(
|
||||
"2 days left before quota's ending",
|
||||
str(roundi(planet.next_quota - planet.decontamination_surface)) + " units left to decontaminate",
|
||||
str(roundi(planet.next_quota - planet.garden_score)) + " garden score left",
|
||||
Announce.YELLOW_COLOR
|
||||
)
|
||||
|
||||
@ -11,15 +11,12 @@ var following_game_position : Vector2 = Vector2()
|
||||
var following_screen_position : Vector2 = Vector2()
|
||||
var following_entity : Node2D = null
|
||||
|
||||
@export var camera : Camera2D
|
||||
|
||||
var arrow_up : Texture = preload("res://common/icons/arrow-narrow-up.svg")
|
||||
var arrow_down : Texture = preload("res://common/icons/arrow-narrow-down.svg")
|
||||
var arrow_right : Texture = preload("res://common/icons/arrow-narrow-right.svg")
|
||||
var arrow_left : Texture = preload("res://common/icons/arrow-narrow-left.svg")
|
||||
|
||||
func setup(_camera : Camera2D, text : String):
|
||||
camera = _camera
|
||||
func setup(text : String):
|
||||
%Label.text = text
|
||||
|
||||
func follow_game_position(game_position : Vector2):
|
||||
@ -35,34 +32,34 @@ func follow_entity(entity : Node2D):
|
||||
following_type = FollowingType.ENTITY
|
||||
|
||||
func _process(_d):
|
||||
if camera:
|
||||
show()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
show()
|
||||
|
||||
var abs_position : Vector2 = following_screen_position
|
||||
if following_type == FollowingType.GAME_POS:
|
||||
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
elif following_type == FollowingType.ENTITY and following_entity:
|
||||
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
|
||||
position = Vector2(
|
||||
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
|
||||
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
|
||||
)
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
|
||||
var arrow_texture : Texture = arrow_down
|
||||
if abs_position.y < 0:
|
||||
arrow_texture = arrow_up
|
||||
if abs_position.x < 0 :
|
||||
arrow_texture = arrow_left
|
||||
if abs_position.x > screen_size.x :
|
||||
arrow_texture = arrow_right
|
||||
position.x -= size.x
|
||||
if abs_position.y > screen_size.y :
|
||||
arrow_texture = arrow_down
|
||||
position.y -= size.y
|
||||
var abs_position : Vector2 = following_screen_position
|
||||
if following_type == FollowingType.GAME_POS:
|
||||
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
elif following_type == FollowingType.ENTITY and following_entity:
|
||||
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
|
||||
|
||||
%Arrow.texture = arrow_texture
|
||||
else:
|
||||
hide()
|
||||
position = Vector2(
|
||||
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
|
||||
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
|
||||
)
|
||||
|
||||
var arrow_texture : Texture = arrow_down
|
||||
if abs_position.y < 0:
|
||||
arrow_texture = arrow_up
|
||||
if abs_position.x < 0 :
|
||||
arrow_texture = arrow_left
|
||||
if abs_position.x > screen_size.x :
|
||||
arrow_texture = arrow_right
|
||||
position.x -= size.x
|
||||
if abs_position.y > screen_size.y :
|
||||
arrow_texture = arrow_down
|
||||
position.y -= size.y
|
||||
|
||||
|
||||
%Arrow.texture = arrow_texture
|
||||
|
||||
@ -4,7 +4,6 @@ class_name Tutorial
|
||||
const INDICATOR_SCENE = preload("res://gui/game/tutorial/in_game_indicator/in_game_indicator.tscn")
|
||||
|
||||
var indicators : Array[InGameIndicator]
|
||||
@export var camera : Camera2D
|
||||
@export var player : Player
|
||||
|
||||
@onready var steps : Array[Step] = [
|
||||
@ -38,30 +37,29 @@ func destroy_indicators():
|
||||
|
||||
func pass_to_step(new_step : Step):
|
||||
actual_step = new_step
|
||||
indicators = new_step.generate_indicators(camera, player)
|
||||
indicators = new_step.generate_indicators(player)
|
||||
for i in indicators:
|
||||
add_child(i)
|
||||
|
||||
class Step:
|
||||
func generate_indicator(cam : Camera2D, text : String) -> InGameIndicator:
|
||||
func generate_indicator(text : String) -> InGameIndicator:
|
||||
var new_indicator : InGameIndicator = INDICATOR_SCENE.instantiate()
|
||||
new_indicator.setup(
|
||||
cam,
|
||||
text
|
||||
)
|
||||
return new_indicator
|
||||
|
||||
func generate_indicators(_cam : Camera2D, _player : Player) -> Array[InGameIndicator]:
|
||||
func generate_indicators(_player : Player) -> Array[InGameIndicator]:
|
||||
return []
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
func is_step_over(_p : Player) -> bool:
|
||||
return true
|
||||
|
||||
class TakeShovelStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
func generate_indicators(p: Player) -> Array[InGameIndicator]:
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is ItemObject and entity.item is Shovel:
|
||||
var indicator = generate_indicator(cam, "Take the Shovel")
|
||||
var indicator = generate_indicator("Take the Shovel")
|
||||
indicator.follow_entity(entity)
|
||||
return [
|
||||
indicator
|
||||
@ -73,11 +71,11 @@ class TakeShovelStep extends Step:
|
||||
return p.inventory.length() > 0
|
||||
|
||||
class DigLootStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
func generate_indicators(p: Player) -> Array[InGameIndicator]:
|
||||
var indicators : Array[InGameIndicator] = []
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is UndergroundLoot:
|
||||
var indicator = generate_indicator(cam, "Dig Underground Loot")
|
||||
var indicator = generate_indicator("Dig Underground Loot")
|
||||
indicator.follow_entity(entity)
|
||||
indicators.append(
|
||||
indicator
|
||||
@ -85,17 +83,17 @@ class DigLootStep extends Step:
|
||||
return indicators
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
for entity in p.terrain.entity_container.get_children():
|
||||
if entity is ItemObject and entity.item is Seed:
|
||||
return true
|
||||
return false
|
||||
|
||||
class TakeSeedStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
func generate_indicators(p: Player) -> Array[InGameIndicator]:
|
||||
var indicators : Array[InGameIndicator] = []
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
for entity in p.terrain.entity_container.get_children():
|
||||
if entity is ItemObject and entity.item is Seed:
|
||||
var indicator = generate_indicator(cam, "Take a seed")
|
||||
var indicator = generate_indicator("Take a seed")
|
||||
indicator.follow_entity(entity)
|
||||
indicators.append(
|
||||
indicator
|
||||
@ -109,23 +107,23 @@ class TakeSeedStep extends Step:
|
||||
return false
|
||||
|
||||
class PlantSeedStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
var indicator = generate_indicator(cam, "Plant the seed in decontamined zone")
|
||||
func generate_indicators(p: Player) -> Array[InGameIndicator]:
|
||||
var indicator = generate_indicator("Plant the seed in decontamined zone")
|
||||
indicator.follow_game_position(Vector2(0,0) + p.planet.entity_container.global_position)
|
||||
return [indicator]
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
for entity in p.terrain.entity_container.get_children():
|
||||
if entity is Plant:
|
||||
return true
|
||||
return false
|
||||
|
||||
class RechargeStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
func generate_indicators(p: Player) -> Array[InGameIndicator]:
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
var indicator = generate_indicator(cam, "Recharge to pass days")
|
||||
var indicator = generate_indicator("Recharge to pass days")
|
||||
indicator.follow_entity(entity)
|
||||
if entity is RechargeStation:
|
||||
if entity is TruckRecharge:
|
||||
return [
|
||||
indicator
|
||||
]
|
||||
@ -133,13 +131,17 @@ class RechargeStep extends Step:
|
||||
return []
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
if p.planet == null :
|
||||
return false
|
||||
return p.planet.day > 1
|
||||
|
||||
class WaitMaturePlant extends Step:
|
||||
func generate_indicators(_cam : Camera2D, _p: Player) -> Array[InGameIndicator]:
|
||||
func generate_indicators(_p: Player) -> Array[InGameIndicator]:
|
||||
return []
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
if p.planet == null :
|
||||
return false
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is Plant and entity.state == Plant.State.MATURE:
|
||||
return true
|
||||
@ -149,11 +151,11 @@ class HarvestMaturePlant extends Step:
|
||||
|
||||
var mature_plant_number : int = 0
|
||||
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
func generate_indicators(p: Player) -> Array[InGameIndicator]:
|
||||
var indicators : Array[InGameIndicator] = []
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is Plant and entity.state == Plant.State.MATURE:
|
||||
var indicator = generate_indicator(cam, "Harvest mature plants with shovel")
|
||||
var indicator = generate_indicator("Harvest mature plants with shovel")
|
||||
indicator.follow_entity(entity)
|
||||
indicators.append(
|
||||
indicator
|
||||
@ -162,8 +164,10 @@ class HarvestMaturePlant extends Step:
|
||||
return indicators
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
if p.planet == null :
|
||||
return false
|
||||
var actual_mature_plant_number = 0
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is Plant and entity.state == Plant.State.MATURE:
|
||||
actual_mature_plant_number += 1
|
||||
return mature_plant_number != actual_mature_plant_number
|
||||
return mature_plant_number != actual_mature_plant_number
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://d28cp7a21kwou"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://d28cp7a21kwou"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="1_yy1uy"]
|
||||
[ext_resource type="PackedScene" uid="uid://csiacsndm62ll" path="res://gui/game/pause/pause.tscn" id="2_bt4fd"]
|
||||
@ -8,8 +8,10 @@
|
||||
[ext_resource type="Script" uid="uid://dedg615xudpoq" path="res://entities/interactables/item_object/script/item_object.gd" id="5_kgrdw"]
|
||||
[ext_resource type="PackedScene" uid="uid://dt6mptqg80dew" path="res://gui/game/tutorial/tutorial.tscn" id="5_orelw"]
|
||||
[ext_resource type="Script" uid="uid://dya38x1h1uiyg" path="res://common/inventory/scripts/items/shovel.gd" id="7_fbkgs"]
|
||||
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/machines/recharge_station/recharge_station.tscn" id="7_h4bgy"]
|
||||
[ext_resource type="PackedScene" uid="uid://tsi5j1uxppa4" path="res://stages/terrain/planet/planet.tscn" id="8_t31p7"]
|
||||
[ext_resource type="PackedScene" uid="uid://cg1visg52i21a" path="res://entities/interactables/truck/ladder/truck_ladder.tscn" id="9_gisiu"]
|
||||
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="10_cnjsq"]
|
||||
[ext_resource type="PackedScene" uid="uid://ceplumcunebag" path="res://stages/terrain/truck/truck_interior.tscn" id="13_cnjsq"]
|
||||
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="16_m18ms"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_orelw"]
|
||||
@ -48,8 +50,13 @@ script = ExtResource("5_kgrdw")
|
||||
item = SubResource("Resource_orelw")
|
||||
metadata/_custom_type_script = "uid://dedg615xudpoq"
|
||||
|
||||
[node name="RechargeStation" parent="Entities" instance=ExtResource("7_h4bgy")]
|
||||
position = Vector2(0, -187)
|
||||
[node name="TruckLadder" parent="Entities" node_paths=PackedStringArray("truck_interior", "planet_camera") instance=ExtResource("9_gisiu")]
|
||||
position = Vector2(33, -139)
|
||||
truck_interior = NodePath("../../TruckInterior")
|
||||
planet_camera = NodePath("../../Camera")
|
||||
|
||||
[node name="TruckRecharge" parent="Entities" instance=ExtResource("10_cnjsq")]
|
||||
position = Vector2(-36, -154)
|
||||
|
||||
[node name="Planet" parent="." node_paths=PackedStringArray("import_entities_from_node") instance=ExtResource("8_t31p7")]
|
||||
loot_number = Array[int]([1])
|
||||
@ -62,6 +69,9 @@ import_entities_from_node = NodePath("../Entities")
|
||||
position = Vector2(2.22, 0)
|
||||
following = NodePath("../Entities/Player")
|
||||
|
||||
[node name="TruckInterior" parent="." instance=ExtResource("13_cnjsq")]
|
||||
position = Vector2(-372, -4191)
|
||||
|
||||
[connection signal="pause_asked" from="CanvasLayer/RootGui" to="CanvasLayer/Pause" method="_on_root_gui_pause_asked"]
|
||||
[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"]
|
||||
|
||||
@ -14,16 +14,14 @@ const DEFAULT_DAY_LIMIT : int = 7
|
||||
const PLANET_TEXTURE_SCALE : float = 5.0
|
||||
const OBJECTIVE_MAX_LEVEL : int = 10
|
||||
const OBJECTIVE_MIN_ANGLE_DIFF = PI/2
|
||||
const OBJECTIVE_FIRST_DISTANCE = 200
|
||||
const OBJECTIVE_BETWEEN_DISTANCE = 50
|
||||
|
||||
@export_group("Loot")
|
||||
@export var first_loot_number : int = 3
|
||||
@export var loot_number : Array[int] = [0,1,2]
|
||||
@export var loot_item_number : Array[int] = [1,2]
|
||||
|
||||
@export_group("Objectives")
|
||||
@export var objective_first_distance : int = 200
|
||||
@export var objective_between_distance : int = 200
|
||||
|
||||
@export_group("Textures")
|
||||
@export var background_texture : Texture2D
|
||||
@export var contamination_material : ShaderMaterial
|
||||
@ -34,6 +32,14 @@ var decontamination_surface : float
|
||||
var garden_score : int
|
||||
|
||||
@onready var objective_scene : PackedScene = preload("res://entities/objectives/objective.tscn")
|
||||
var terrain_size = Vector2.ONE * 1000 :
|
||||
set(v):
|
||||
terrain_size = v
|
||||
if border_limit:
|
||||
border_limit.queue_free()
|
||||
border_limit = create_border_limit()
|
||||
|
||||
@onready var border_limit : StaticBody2D = create_border_limit()
|
||||
|
||||
var planet_data : PlanetData
|
||||
|
||||
@ -43,7 +49,6 @@ var day_limit = DEFAULT_DAY_LIMIT
|
||||
var days_on_last_quota : int = 0
|
||||
var last_quota : float = 0
|
||||
var next_quota : float
|
||||
var player : Player
|
||||
|
||||
func _ready():
|
||||
planet_data = GameInfo.game_data.current_planet_data if GameInfo.game_data.current_planet_data else PlanetData.new()
|
||||
@ -103,18 +108,6 @@ func instantiate_machine(m_type : MachineType, level, machine_position : Vector2
|
||||
|
||||
machine.global_position = machine_position
|
||||
|
||||
func add_entity(e : Node2D, container : Node2D = entity_container):
|
||||
if e.get_parent():
|
||||
e.get_parent().remove_child(e)
|
||||
|
||||
if "planet" in e:
|
||||
e.planet = self
|
||||
|
||||
if e is Player:
|
||||
player = e
|
||||
|
||||
container.add_child(e)
|
||||
|
||||
func generate_polygon_sprite(order : int = 0) -> Polygon2D:
|
||||
var sprite = Polygon2D.new()
|
||||
var size = terrain_size
|
||||
@ -156,6 +149,29 @@ func generate_contamination_terrain_sprite() -> Polygon2D:
|
||||
|
||||
return sprite
|
||||
|
||||
func create_border_limit() -> StaticBody2D:
|
||||
var static_body = StaticBody2D.new()
|
||||
var static_body_collision = CollisionPolygon2D.new()
|
||||
|
||||
add_child(static_body)
|
||||
static_body.add_child(static_body_collision)
|
||||
|
||||
var size = terrain_size
|
||||
static_body_collision.polygon = PackedVector2Array([
|
||||
Vector2(0,0),
|
||||
Vector2(0, size.y),
|
||||
Vector2(size.x, size.y),
|
||||
Vector2(size.x, 0),
|
||||
Vector2(0,0),
|
||||
Vector2(-BORDER_WIDTH, -BORDER_WIDTH),
|
||||
Vector2(size.x + BORDER_WIDTH, -BORDER_WIDTH),
|
||||
Vector2(size.x + BORDER_WIDTH, size.y + BORDER_WIDTH),
|
||||
Vector2(- BORDER_WIDTH, size.y + BORDER_WIDTH),
|
||||
Vector2(-BORDER_WIDTH, -BORDER_WIDTH)
|
||||
])
|
||||
|
||||
return static_body
|
||||
|
||||
#endregion
|
||||
|
||||
#region ------------------ Usage ------------------
|
||||
@ -221,7 +237,7 @@ func pass_day():
|
||||
|
||||
func generate_loot(number : int = loot_number.pick_random()):
|
||||
for i in range(number):
|
||||
var loot = UndergroundLoot.new(self)
|
||||
var loot = UndergroundLoot.new()
|
||||
for j in range(loot_item_number.pick_random()):
|
||||
loot.loot.append(
|
||||
Seed.new(GameInfo.game_data.unlocked_plant_types.pick_random())
|
||||
@ -249,7 +265,7 @@ func generate_objectives():
|
||||
last_objective_angle = objective_angle
|
||||
|
||||
generate_objective(
|
||||
objective_first_distance + objective_between_distance * i,
|
||||
OBJECTIVE_FIRST_DISTANCE + OBJECTIVE_BETWEEN_DISTANCE * i,
|
||||
objective_angle,
|
||||
objective_reward,
|
||||
)
|
||||
|
||||
@ -3,24 +3,28 @@ class_name Terrain
|
||||
|
||||
const BORDER_WIDTH = 100
|
||||
|
||||
var player : Player
|
||||
|
||||
@export var import_entities_from_node : Node2D = null
|
||||
|
||||
var terrain_size = Vector2.ONE * 1000 :
|
||||
set(v):
|
||||
terrain_size = v
|
||||
if border_limit:
|
||||
border_limit.queue_free()
|
||||
border_limit = create_border_limit()
|
||||
|
||||
@onready var border_limit : StaticBody2D = create_border_limit()
|
||||
@onready var entity_container : Node2D = create_entity_container()
|
||||
|
||||
func add_entity(e : Node2D, container : Node2D = entity_container):
|
||||
if e.get_parent():
|
||||
e.get_parent().remove_child(e)
|
||||
|
||||
if "terrain" in e:
|
||||
e.terrain = self
|
||||
|
||||
if e is Player:
|
||||
player = e
|
||||
|
||||
container.add_child(e)
|
||||
|
||||
func remove_entity(e : Node2D, container : Node2D = entity_container):
|
||||
if e.get_parent() == entity_container:
|
||||
container.remove_child(e)
|
||||
|
||||
func create_entity_container() -> Node2D:
|
||||
var container = Node2D.new()
|
||||
container.y_sort_enabled = true
|
||||
@ -51,25 +55,3 @@ func drop_item(item: Item, item_position : Vector2, random_displacement_factor =
|
||||
|
||||
return item_object
|
||||
|
||||
func create_border_limit() -> StaticBody2D:
|
||||
var static_body = StaticBody2D.new()
|
||||
var static_body_collision = CollisionPolygon2D.new()
|
||||
|
||||
add_child(static_body)
|
||||
static_body.add_child(static_body_collision)
|
||||
|
||||
var size = terrain_size
|
||||
static_body_collision.polygon = PackedVector2Array([
|
||||
Vector2(0,0),
|
||||
Vector2(0, size.y),
|
||||
Vector2(size.x, size.y),
|
||||
Vector2(size.x, 0),
|
||||
Vector2(0,0),
|
||||
Vector2(-BORDER_WIDTH, -BORDER_WIDTH),
|
||||
Vector2(size.x + BORDER_WIDTH, -BORDER_WIDTH),
|
||||
Vector2(size.x + BORDER_WIDTH, size.y + BORDER_WIDTH),
|
||||
Vector2(- BORDER_WIDTH, size.y + BORDER_WIDTH),
|
||||
Vector2(-BORDER_WIDTH, -BORDER_WIDTH)
|
||||
])
|
||||
|
||||
return static_body
|
||||
|
||||
BIN
stages/terrain/truck/assets/sprite/truck_interior.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
40
stages/terrain/truck/assets/sprite/truck_interior.png.import
Normal file
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d2p7h0aga85tn"
|
||||
path="res://.godot/imported/truck_interior.png-ff9bd2d0107d83f7c4209d959ee69f15.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/truck/assets/sprite/truck_interior.png"
|
||||
dest_files=["res://.godot/imported/truck_interior.png-ff9bd2d0107d83f7c4209d959ee69f15.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
stages/terrain/truck/assets/sprite/truck_interior.png~
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
6
stages/terrain/truck/scripts/truck_entrance.gd
Normal file
@ -0,0 +1,6 @@
|
||||
extends Node2D
|
||||
class_name TruckEntrance
|
||||
|
||||
var terrain : Terrain
|
||||
var planet : Planet :
|
||||
get(): return terrain if terrain is Planet else null
|
||||
1
stages/terrain/truck/scripts/truck_entrance.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://byu0woo6o3af0
|
||||
10
stages/terrain/truck/scripts/truck_interior.gd
Normal file
@ -0,0 +1,10 @@
|
||||
extends Terrain
|
||||
class_name TruckInterior
|
||||
|
||||
signal player_exited(player : Player)
|
||||
|
||||
@onready var spawn_position : Node2D = %SpawnPosition
|
||||
@onready var camera : Camera = %Camera
|
||||
|
||||
func _on_exit_interacted(p: Player):
|
||||
player_exited.emit(p)
|
||||
1
stages/terrain/truck/scripts/truck_interior.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://d0gmkwebxdptk
|
||||
62
stages/terrain/truck/truck_interior.tscn
Normal file
@ -0,0 +1,62 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://ceplumcunebag"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://d2p7h0aga85tn" path="res://stages/terrain/truck/assets/sprite/truck_interior.png" id="1_5c5ey"]
|
||||
[ext_resource type="Script" uid="uid://d0gmkwebxdptk" path="res://stages/terrain/truck/scripts/truck_interior.gd" id="1_fk6sc"]
|
||||
[ext_resource type="Script" uid="uid://dyprcd68fjstf" path="res://entities/interactables/scripts/interactable.gd" id="3_fk6sc"]
|
||||
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://common/icons/logout.svg" id="3_v18jm"]
|
||||
[ext_resource type="Script" uid="uid://d1nsr56bh1a1y" path="res://entities/camera/scripts/camera.gd" id="4_5di8w"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_wi5be"]
|
||||
radius = 69.76956
|
||||
height = 376.0
|
||||
|
||||
[node name="TruckInterior" type="Node2D"]
|
||||
position = Vector2(-40, -469)
|
||||
script = ExtResource("1_fk6sc")
|
||||
metadata/_custom_type_script = "uid://dfl1ijmbmw57r"
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
modulate = Color(0.67495143, 0.69801295, 0.68495274, 1)
|
||||
position = Vector2(292, 376)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("1_5c5ey")
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"]
|
||||
position = Vector2(112.00001, 670)
|
||||
scale = Vector2(0.8064369, 0.8064369)
|
||||
polygon = PackedVector2Array(141.36256, -138.8825, 1616.9894, -111.60202, 1656.67, 461.2884, 389.36707, 466.24847, 386.88702, 545.6099, -173.60316, 533.2097, -141.36258, -57.041016, -2.480053, -89.28162, 109.12198, -106.64194, 131, -327, -487, -326, -465, 841, 2150.1992, 815.9348, 2110.5183, -825.855, -521, -732, -482, -327, 133, -331)
|
||||
|
||||
[node name="SpawnPosition" type="Node2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(52, 473.00003)
|
||||
scale = Vector2(0.5539248, 0.5539248)
|
||||
|
||||
[node name="Exit" type="Area2D" parent="."]
|
||||
position = Vector2(47, 497.00003)
|
||||
scale = Vector2(0.5539248, 0.5539248)
|
||||
script = ExtResource("3_fk6sc")
|
||||
default_interact_text = "Exit the truck"
|
||||
default_info_title = "Exit"
|
||||
default_info_desc = "A good old ladder."
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="Bolt" type="Sprite2D" parent="Exit"]
|
||||
position = Vector2(10.831797, -16.24775)
|
||||
scale = Vector2(1.8052993, 1.8052993)
|
||||
texture = ExtResource("3_v18jm")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Exit"]
|
||||
position = Vector2(9.026497, 81.2384)
|
||||
shape = SubResource("CapsuleShape2D_wi5be")
|
||||
|
||||
[node name="Camera" type="Camera2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(316, 340)
|
||||
zoom = Vector2(1.18, 1.18)
|
||||
script = ExtResource("4_5di8w")
|
||||
metadata/_custom_type_script = "uid://d1nsr56bh1a1y"
|
||||
|
||||
[connection signal="interacted" from="Exit" to="." method="_on_exit_interacted"]
|
||||