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
This commit is contained in:
@@ -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
BIN
entities/interactables/truck/assets/sprites/truck_ladder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -2,22 +2,24 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c82ljr3in67am"
|
||||
path="res://.godot/imported/recharge_station.svg-b4dbe96f287bff2995b6160acd3f32ff.ctex"
|
||||
uid="uid://dlrj7tyi5wfh8"
|
||||
path="res://.godot/imported/truck_ladder.png-00d93dc49c0cc6457febb75d7b82dec4.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/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
|
||||
@@ -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
|
||||
22
entities/interactables/truck/ladder/scripts/truck_ladder.gd
Normal file
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
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
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")
|
||||
Reference in New Issue
Block a user