Compare commits
4 Commits
main
...
Feature-fi
| Author | SHA1 | Date | |
|---|---|---|---|
| ac556e3715 | |||
| d0ad5f4fe5 | |||
| e0fb5dbac0 | |||
| bd91fe76b7 |
BIN
assets/Bordered_Black_Square.png
Normal file
BIN
assets/Bordered_Black_Square.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
34
assets/Bordered_Black_Square.png.import
Normal file
34
assets/Bordered_Black_Square.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bhx36hs83ynqs"
|
||||||
|
path="res://.godot/imported/Bordered_Black_Square.png-ff534a515f4750944c45a40d35861714.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/Bordered_Black_Square.png"
|
||||||
|
dest_files=["res://.godot/imported/Bordered_Black_Square.png-ff534a515f4750944c45a40d35861714.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
|
||||||
1
assets/arrow.svg
Normal file
1
assets/arrow.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>Trade_Icons</title><polygon points="14.13 9.11 2.13 9.11 8.13 2.11 14.13 9.11"/><rect x="6.12" y="8" width="4" height="6"/></svg>
|
||||||
|
After Width: | Height: | Size: 229 B |
37
assets/arrow.svg.import
Normal file
37
assets/arrow.svg.import
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dprlu0x5gcgon"
|
||||||
|
path="res://.godot/imported/arrow.svg-a996b9f5a5e99d25f45d2c6cd1a7999b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/arrow.svg"
|
||||||
|
dest_files=["res://.godot/imported/arrow.svg-a996b9f5a5e99d25f45d2c6cd1a7999b.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
|
||||||
3
assets/triangle.svg
Normal file
3
assets/triangle.svg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="10.033" height="5" viewBox="0 0 10.033 5">
|
||||||
|
<polygon points="5.016 0 0 0.003 2.506 2.5 5.016 5 7.525 2.5 10.033 0.003 5.016 0" fill="red"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 194 B |
37
assets/triangle.svg.import
Normal file
37
assets/triangle.svg.import
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://s4iiumvei5wc"
|
||||||
|
path="res://.godot/imported/triangle.svg-2246efe0f7e4fdb6705e62b9f62230d2.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/triangle.svg"
|
||||||
|
dest_files=["res://.godot/imported/triangle.svg-2246efe0f7e4fdb6705e62b9f62230d2.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=8.071
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
||||||
16
game.tscn
16
game.tscn
@ -1,8 +1,18 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://c0s77m0ea3sey"]
|
[gd_scene load_steps=4 format=3 uid="uid://c0s77m0ea3sey"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cc6wo0ska0sem" path="res://scripts/game.gd" id="1_41a5u"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dy71gkll44btc" path="res://scenes/player.tscn" id="1_geqht"]
|
[ext_resource type="PackedScene" uid="uid://dy71gkll44btc" path="res://scenes/player.tscn" id="1_geqht"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c7todenm3hn4d" path="res://scenes/boat.tscn" id="2_qmvsn"]
|
||||||
|
|
||||||
[node name="Game" type="Node2D"]
|
[node name="Game" type="Node2D"]
|
||||||
|
position = Vector2(568, 324)
|
||||||
|
script = ExtResource("1_41a5u")
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("1_geqht")]
|
[node name="Boat" parent="." instance=ExtResource("2_qmvsn")]
|
||||||
position = Vector2(567, 297)
|
position = Vector2(-15, 40)
|
||||||
|
|
||||||
|
[node name="Player" parent="." node_paths=PackedStringArray("boat") instance=ExtResource("1_geqht")]
|
||||||
|
position = Vector2(-67, 6)
|
||||||
|
boat = NodePath("../Boat")
|
||||||
|
|
||||||
|
[connection signal="is_dead" from="Player" to="Boat" method="_on_player_is_dead"]
|
||||||
|
|||||||
@ -12,5 +12,50 @@ config_version=5
|
|||||||
|
|
||||||
config/name="BoatCoop"
|
config/name="BoatCoop"
|
||||||
run/main_scene="res://game.tscn"
|
run/main_scene="res://game.tscn"
|
||||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[editor]
|
||||||
|
|
||||||
|
version_control/plugin_name="GitPlugin"
|
||||||
|
version_control/autoload_on_startup=true
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
ui_left={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_right={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_up={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_down={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[layer_names]
|
||||||
|
|
||||||
|
2d_physics/layer_1="Barrière"
|
||||||
|
2d_physics/layer_2="Joueur"
|
||||||
|
|||||||
7
scenes/barrier.tscn
Normal file
7
scenes/barrier.tscn
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://crxp1lat0mj1n"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_exqad"]
|
||||||
|
size = Vector2(128, 128)
|
||||||
|
|
||||||
|
[node name="Barrier" type="CollisionShape2D"]
|
||||||
|
shape = SubResource("RectangleShape2D_exqad")
|
||||||
9
scenes/boa1545.tmp
Normal file
9
scenes/boa1545.tmp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
|
barrier_scene = null
|
||||||
8
scenes/boa3EE7.tmp
Normal file
8
scenes/boa3EE7.tmp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
8
scenes/boa51BE.tmp
Normal file
8
scenes/boa51BE.tmp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
8
scenes/boa68D0.tmp
Normal file
8
scenes/boa68D0.tmp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
8
scenes/boa8867.tmp
Normal file
8
scenes/boa8867.tmp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
7
scenes/boa9849.tmp
Normal file
7
scenes/boa9849.tmp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
9
scenes/boa99FC.tmp
Normal file
9
scenes/boa99FC.tmp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
|
barrier_scene = null
|
||||||
7
scenes/boaB2D7.tmp
Normal file
7
scenes/boaB2D7.tmp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
8
scenes/boaBB59.tmp
Normal file
8
scenes/boaBB59.tmp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
9
scenes/boaCF4E.tmp
Normal file
9
scenes/boaCF4E.tmp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(5, -2)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
tile_scene = null
|
||||||
|
barrier_scene = null
|
||||||
7
scenes/boaD346.tmp
Normal file
7
scenes/boaD346.tmp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
position = Vector2(-1, 0)
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
13
scenes/boat.tscn
Normal file
13
scenes/boat.tscn
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://c7todenm3hn4d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bvejqjdvu7eb1" path="res://scripts/boat.gd" id="1_brclq"]
|
||||||
|
|
||||||
|
[node name="Boat" type="Node2D"]
|
||||||
|
script = ExtResource("1_brclq")
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
|
||||||
|
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
|
||||||
30
scenes/gam25FD.tmp
Normal file
30
scenes/gam25FD.tmp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
[gd_scene load_steps=6 format=3 uid="uid://c0s77m0ea3sey"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/game.gd" id="1_g5flc"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dy71gkll44btc" path="res://scenes/player.tscn" id="2_3msrq"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c7todenm3hn4d" path="res://scenes/boat.tscn" id="3_5kild"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bmxg7u37aon0o" path="res://scenes/tile.tscn" id="4_cd0bw"]
|
||||||
|
|
||||||
|
[sub_resource type="SegmentShape2D" id="SegmentShape2D_dliv6"]
|
||||||
|
|
||||||
|
[node name="Game" type="Node2D"]
|
||||||
|
position = Vector2(552, 300)
|
||||||
|
script = ExtResource("1_g5flc")
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("2_3msrq")]
|
||||||
|
z_index = 1
|
||||||
|
position = Vector2(-546, -300)
|
||||||
|
|
||||||
|
[node name="Boat" parent="." instance=ExtResource("3_5kild")]
|
||||||
|
position = Vector2(-548, -304)
|
||||||
|
|
||||||
|
[node name="Tile" parent="Boat" instance=ExtResource("4_cd0bw")]
|
||||||
|
position = Vector2(6, 6)
|
||||||
|
|
||||||
|
[node name="Barrier" type="StaticBody2D" parent="Boat"]
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="Boat/Barrier"]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boat/Barrier"]
|
||||||
|
shape = SubResource("SegmentShape2D_dliv6")
|
||||||
|
one_way_collision_margin = 63.0
|
||||||
20
scenes/plaC3C8.tmp
Normal file
20
scenes/plaC3C8.tmp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://dy71gkll44btc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/player.gd" id="1_jlots"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://s4iiumvei5wc" path="res://assets/triangle.svg" id="2_jjceo"]
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody2D"]
|
||||||
|
motion_mode = 1
|
||||||
|
script = ExtResource("1_jlots")
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||||
|
position = Vector2(-14, 2.86102e-06)
|
||||||
|
rotation = 1.58969
|
||||||
|
scale = Vector2(0.998311, 1.01563)
|
||||||
|
polygon = PackedVector2Array(-9.03255, -0.816984, -0.51107, -26.5797, 8.99469, -1.15189)
|
||||||
|
|
||||||
|
[node name="Sprite2D2" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(0, -9.53674e-07)
|
||||||
|
rotation = -1.5708
|
||||||
|
scale = Vector2(0.230709, 0.642787)
|
||||||
|
texture = ExtResource("2_jjceo")
|
||||||
20
scenes/plaE0E6.tmp
Normal file
20
scenes/plaE0E6.tmp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://dy71gkll44btc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/player.gd" id="1_jlots"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://s4iiumvei5wc" path="res://assets/triangle.svg" id="2_jjceo"]
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody2D"]
|
||||||
|
motion_mode = 1
|
||||||
|
script = ExtResource("1_jlots")
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||||
|
position = Vector2(-14, 2.86102e-06)
|
||||||
|
rotation = 1.58969
|
||||||
|
scale = Vector2(0.998311, 1.01563)
|
||||||
|
polygon = PackedVector2Array(-9.03255, -0.816984, -0.51107, -26.5797, 8.99469, -1.15189)
|
||||||
|
|
||||||
|
[node name="Sprite2D2" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(0, -9.53674e-07)
|
||||||
|
rotation = -1.5708
|
||||||
|
scale = Vector2(0.230709, 0.642787)
|
||||||
|
texture = ExtResource("2_jjceo")
|
||||||
20
scenes/plaE0E7.tmp
Normal file
20
scenes/plaE0E7.tmp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://dy71gkll44btc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/player.gd" id="1_jlots"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://s4iiumvei5wc" path="res://assets/triangle.svg" id="2_jjceo"]
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody2D"]
|
||||||
|
motion_mode = 1
|
||||||
|
script = ExtResource("1_jlots")
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||||
|
position = Vector2(-14, 2.86102e-06)
|
||||||
|
rotation = 1.58969
|
||||||
|
scale = Vector2(0.998311, 1.01563)
|
||||||
|
polygon = PackedVector2Array(-9.03255, -0.816984, -0.51107, -26.5797, 8.99469, -1.15189)
|
||||||
|
|
||||||
|
[node name="Sprite2D2" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(0, -9.53674e-07)
|
||||||
|
rotation = -1.5708
|
||||||
|
scale = Vector2(0.230709, 0.642787)
|
||||||
|
texture = ExtResource("2_jjceo")
|
||||||
@ -1,23 +1,30 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://dy71gkll44btc"]
|
[gd_scene load_steps=5 format=3 uid="uid://dy71gkll44btc"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/player.gd" id="1_jlots"]
|
[ext_resource type="Script" uid="uid://ceijb6ltpgsy1" path="res://scripts/player.gd" id="1_jlots"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://s4iiumvei5wc" path="res://assets/triangle.svg" id="2_jjceo"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_scfaw"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_g2els"]
|
||||||
size = Vector2(80, 124)
|
radius = 6.0
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_pnm6c"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_qhqgy"]
|
||||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1)
|
|
||||||
|
|
||||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_wyt1d"]
|
|
||||||
gradient = SubResource("Gradient_pnm6c")
|
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D"]
|
[node name="Player" type="CharacterBody2D"]
|
||||||
|
collision_layer = 2
|
||||||
motion_mode = 1
|
motion_mode = 1
|
||||||
script = ExtResource("1_jlots")
|
script = ExtResource("1_jlots")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="Sprite2D2" type="Sprite2D" parent="."]
|
||||||
shape = SubResource("RectangleShape2D_scfaw")
|
z_index = 100
|
||||||
|
position = Vector2(5, 0)
|
||||||
|
rotation = -1.5708
|
||||||
|
scale = Vector2(0.230709, 0.642787)
|
||||||
|
texture = ExtResource("2_jjceo")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
scale = Vector2(0.3125, 126)
|
shape = SubResource("CircleShape2D_g2els")
|
||||||
texture = SubResource("GradientTexture1D_wyt1d")
|
|
||||||
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
collision_layer = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
|
shape = SubResource("CircleShape2D_qhqgy")
|
||||||
|
|||||||
11
scenes/tile.tscn
Normal file
11
scenes/tile.tscn
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://bmxg7u37aon0o"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bhx36hs83ynqs" path="res://assets/Bordered_Black_Square.png" id="1_bgcjk"]
|
||||||
|
|
||||||
|
[node name="Tile" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
modulate = Color(1, 1, 1, 0.337255)
|
||||||
|
position = Vector2(0, 2.28882e-05)
|
||||||
|
scale = Vector2(0.074, 0.0740913)
|
||||||
|
texture = ExtResource("1_bgcjk")
|
||||||
74
scripts/boat.gd
Normal file
74
scripts/boat.gd
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
@export var tile_scene: PackedScene = preload("res://scenes/tile.tscn")
|
||||||
|
@export var barrier_scene: PackedScene = preload("res://scenes/barrier.tscn")
|
||||||
|
var tiles = []
|
||||||
|
var tile_size = 128.0
|
||||||
|
var test_broken_tiles = true
|
||||||
|
const boatSize = 5
|
||||||
|
const barrierOffset = 2
|
||||||
|
var speed = 100
|
||||||
|
var velocity = Vector2()
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
spawn_boat_tiles()
|
||||||
|
spawn_boat_barriers()
|
||||||
|
|
||||||
|
func spawn_boat_tiles():
|
||||||
|
tiles.clear()
|
||||||
|
|
||||||
|
for x in range(boatSize):
|
||||||
|
var row = []
|
||||||
|
for y in range(boatSize):
|
||||||
|
if test_broken_tiles && randf() < 0.7 || (x == floor(boatSize/2) && y == floor(boatSize/2)): # 70% de chance de spawn une tuile pour tester les bateaux incomplets
|
||||||
|
var tile = tile_scene.instantiate()
|
||||||
|
add_child(tile)
|
||||||
|
|
||||||
|
#Positionner les tuiles pour que l'on spawne toujours au centre
|
||||||
|
tile.position = Vector2(
|
||||||
|
(x - ((boatSize - 1) * 0.5)) * tile_size,
|
||||||
|
(y - ((boatSize - 1) * 0.5)) * tile_size
|
||||||
|
)
|
||||||
|
|
||||||
|
var collision_shape = barrier_scene.instantiate()
|
||||||
|
$Area2D.add_child(collision_shape)
|
||||||
|
collision_shape.position = Vector2(
|
||||||
|
(x - ((boatSize - 1) * 0.5)) * tile_size,
|
||||||
|
(y - ((boatSize - 1) * 0.5)) * tile_size
|
||||||
|
)
|
||||||
|
|
||||||
|
row.append(tile)
|
||||||
|
else:
|
||||||
|
row.append(null) # On garde la structure mais on marque la tuile manquante
|
||||||
|
tiles.append(row)
|
||||||
|
|
||||||
|
|
||||||
|
func spawn_boat_barriers():
|
||||||
|
var collider_range = range(tiles.size())
|
||||||
|
collider_range.append_array([-1, boatSize])
|
||||||
|
for x in collider_range:
|
||||||
|
for y in collider_range:
|
||||||
|
if not has_tile(x, y):
|
||||||
|
var barrier = barrier_scene.instantiate()
|
||||||
|
$StaticBody2D.add_child(barrier)
|
||||||
|
barrier.position = Vector2(
|
||||||
|
(x - ((boatSize - 1) * 0.5)) * tile_size,
|
||||||
|
(y - ((boatSize - 1) * 0.5)) * tile_size
|
||||||
|
)
|
||||||
|
|
||||||
|
func has_tile(x : int, y : int):
|
||||||
|
if x >= 0 and y >= 0 and x < boatSize and y < boatSize:
|
||||||
|
return tiles[x][y] != null
|
||||||
|
else : return false
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
#Just spinning
|
||||||
|
rotation += delta/6
|
||||||
|
|
||||||
|
|
||||||
|
func _on_player_is_dead():
|
||||||
|
print("Est mort")
|
||||||
|
|
||||||
|
|
||||||
|
func _on_area_2d_body_entered(body):
|
||||||
|
pass # Replace with function body.
|
||||||
1
scripts/boat.gd.uid
Normal file
1
scripts/boat.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://bvejqjdvu7eb1
|
||||||
27
scripts/game.gd
Normal file
27
scripts/game.gd
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
@export var player_scene: PackedScene = preload("res://scenes/player.tscn")
|
||||||
|
@export var boat_scene: PackedScene = preload("res://scenes/boat.tscn")
|
||||||
|
|
||||||
|
var player_instance: CharacterBody2D
|
||||||
|
var boat_instance: Node2D
|
||||||
|
|
||||||
|
#func _ready():
|
||||||
|
# On enlève les scènes par défaut
|
||||||
|
#var default_boat = $Boat
|
||||||
|
#var default_player = $Player
|
||||||
|
#if default_boat:
|
||||||
|
#default_boat.queue_free()
|
||||||
|
#if default_player:
|
||||||
|
#default_player.queue_free()
|
||||||
|
|
||||||
|
# On instancie les scènes que l'on veut garder
|
||||||
|
#boat_instance = boat_scene.instantiate()
|
||||||
|
#player_instance = player_scene.instantiate()
|
||||||
|
|
||||||
|
# On ajoue les scènes essentielles à la scène principale
|
||||||
|
#add_child(boat_instance)
|
||||||
|
#add_child(player_instance)
|
||||||
|
|
||||||
|
# Et on assigne le bateau au joueur
|
||||||
|
#player_instance.boat = boat_instance
|
||||||
1
scripts/game.gd.uid
Normal file
1
scripts/game.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://cc6wo0ska0sem
|
||||||
@ -1,10 +1,79 @@
|
|||||||
extends CharacterBody2D
|
extends CharacterBody2D
|
||||||
|
|
||||||
const SPEED = 300.0
|
const SPEED = 300.0
|
||||||
const JUMP_VELOCITY = -400.0
|
@export var boat: Node2D
|
||||||
|
|
||||||
func _physics_process(delta):
|
const TILE_SIZE = 128
|
||||||
|
var relative_position_on_boat = Vector2(0, 0)
|
||||||
|
var is_on_boat = true
|
||||||
|
var last_boat_rotation = 0.0
|
||||||
|
|
||||||
|
signal is_dead
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
if boat:
|
||||||
|
relative_position_on_boat = position - boat.position
|
||||||
|
last_boat_rotation = boat.rotation
|
||||||
|
|
||||||
|
func _physics_process(_delta):
|
||||||
|
# Tourner le joueur vers la souris
|
||||||
|
var mouse_position = get_global_mouse_position()
|
||||||
|
look_at(mouse_position)
|
||||||
|
|
||||||
|
if boat:
|
||||||
|
is_on_boat = get_on_boat()
|
||||||
|
if is_on_boat:
|
||||||
|
# Calculer la diff de rotation entre deux appels
|
||||||
|
var delta_rotation = boat.rotation - last_boat_rotation
|
||||||
|
|
||||||
|
# Ajuster la position du joueur en fonvtion de la rotation du bateau
|
||||||
|
relative_position_on_boat = relative_position_on_boat.rotated(delta_rotation)
|
||||||
|
position = boat.position + relative_position_on_boat # Set player position relative to the boat's position
|
||||||
|
|
||||||
|
# On autorise le joueur à bouger lorsqu'il est sur le bateau
|
||||||
velocity.x = Input.get_axis("ui_left", "ui_right") * SPEED
|
velocity.x = Input.get_axis("ui_left", "ui_right") * SPEED
|
||||||
velocity.y = Input.get_axis("ui_up", "ui_down") * SPEED
|
velocity.y = Input.get_axis("ui_up", "ui_down") * SPEED
|
||||||
|
|
||||||
move_and_slide()
|
move_and_slide()
|
||||||
|
|
||||||
|
# Mettre à jour la position relative
|
||||||
|
relative_position_on_boat = position - boat.position
|
||||||
|
last_boat_rotation = boat.rotation
|
||||||
|
|
||||||
|
else:
|
||||||
|
emit_signal("is_dead")
|
||||||
|
# Pour l'instant, hors du bateau, le joueur nage 4 * moins vite qu'il ne court
|
||||||
|
velocity.x = Input.get_axis("ui_left", "ui_right") * SPEED / 4
|
||||||
|
velocity.y = Input.get_axis("ui_up", "ui_down") * SPEED / 4
|
||||||
|
move_and_slide()
|
||||||
|
|
||||||
|
# Mettre à jour la position relative meme hors du bateau
|
||||||
|
relative_position_on_boat = position - boat.position
|
||||||
|
last_boat_rotation = boat.rotation
|
||||||
|
|
||||||
|
var debug_positions = []
|
||||||
|
|
||||||
|
func get_on_boat():
|
||||||
|
|
||||||
|
for area in $Area2D.get_overlapping_areas():
|
||||||
|
if area in boat.get_children():
|
||||||
|
return true
|
||||||
|
return false
|
||||||
|
|
||||||
|
#var node_pos = boat.to_local(position)
|
||||||
|
#var tile_size = 128.0
|
||||||
|
#
|
||||||
|
#for x in range(boat.tiles.size()):
|
||||||
|
#for y in range(boat.tiles[x].size()):
|
||||||
|
#var tile = boat.tiles[x][y]
|
||||||
|
#if tile:
|
||||||
|
#var tile_pos = tile.global_position
|
||||||
|
#var relative_tile_pos = tile_pos - boat.global_position
|
||||||
|
#relative_tile_pos = relative_tile_pos.rotated(-boat.rotation)
|
||||||
|
#
|
||||||
|
#if (
|
||||||
|
#abs(relative_tile_pos.x) <= tile_size / 2 and
|
||||||
|
#abs(relative_tile_pos.y) <= tile_size / 2
|
||||||
|
#):
|
||||||
|
#return true
|
||||||
|
#
|
||||||
|
#return false
|
||||||
|
|||||||
1
scripts/player.gd.uid
Normal file
1
scripts/player.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://ceijb6ltpgsy1
|
||||||
Loading…
Reference in New Issue
Block a user