feat (?) First tries
This commit is contained in:
parent
310ce40501
commit
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
|
||||
11
game.tscn
11
game.tscn
@ -1,8 +1,15 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://c0s77m0ea3sey"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c0s77m0ea3sey"]
|
||||
|
||||
[ext_resource type="Script" 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://c7todenm3hn4d" path="res://scenes/boat.tscn" id="2_qmvsn"]
|
||||
|
||||
[node name="Game" type="Node2D"]
|
||||
position = Vector2(559, 282)
|
||||
script = ExtResource("1_41a5u")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_geqht")]
|
||||
position = Vector2(567, 297)
|
||||
position = Vector2(-685, -433)
|
||||
|
||||
[node name="Boat" parent="." instance=ExtResource("2_qmvsn")]
|
||||
position = Vector2(-642, -351)
|
||||
|
||||
@ -14,3 +14,43 @@ config/name="BoatCoop"
|
||||
run/main_scene="res://game.tscn"
|
||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||
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)
|
||||
]
|
||||
}
|
||||
|
||||
26
scenes/barrier.tscn
Normal file
26
scenes/barrier.tscn
Normal file
@ -0,0 +1,26 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://crxp1lat0mj1n"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_7c5k4"]
|
||||
offsets = PackedFloat32Array(0, 0.00371747, 0.736059, 0.754647, 1)
|
||||
colors = PackedColorArray(0, 0, 0, 1, 0.94902, 0.0509804, 0.0509804, 1, 0.15042, 0.503262, 0.834652, 1, 0.117488, 0.521912, 0.866968, 1, 0.94902, 0.0509804, 0.0509804, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_eesv4"]
|
||||
gradient = SubResource("Gradient_7c5k4")
|
||||
fill_from = Vector2(1, 0)
|
||||
fill_to = Vector2(0, 1)
|
||||
|
||||
[sub_resource type="SegmentShape2D" id="SegmentShape2D_dliv6"]
|
||||
b = Vector2(0, 27.7419)
|
||||
|
||||
[node name="Barrier" type="StaticBody2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(5.96046e-08, 0)
|
||||
scale = Vector2(0.203125, 2.01563)
|
||||
texture = SubResource("GradientTexture2D_eesv4")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-3.8147e-06, -65)
|
||||
scale = Vector2(4.65, 4.65)
|
||||
shape = SubResource("SegmentShape2D_dliv6")
|
||||
one_way_collision_margin = 66.3
|
||||
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
|
||||
13
scenes/boat.tscn
Normal file
13
scenes/boat.tscn
Normal file
@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c7todenm3hn4d"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/boat.gd" id="1_brclq"]
|
||||
[ext_resource type="PackedScene" uid="uid://bmxg7u37aon0o" path="res://scenes/tile.tscn" id="2_b8wau"]
|
||||
[ext_resource type="PackedScene" uid="uid://crxp1lat0mj1n" path="res://scenes/barrier.tscn" id="3_mdatr"]
|
||||
|
||||
[node name="Boat" type="Node2D"]
|
||||
position = Vector2(5, -2)
|
||||
script = ExtResource("1_brclq")
|
||||
|
||||
[node name="Tile" parent="." instance=ExtResource("2_b8wau")]
|
||||
|
||||
[node name="Barrier" parent="." instance=ExtResource("3_mdatr")]
|
||||
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/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,20 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dy71gkll44btc"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dy71gkll44btc"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/player.gd" id="1_jlots"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_scfaw"]
|
||||
size = Vector2(80, 124)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_pnm6c"]
|
||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_wyt1d"]
|
||||
gradient = SubResource("Gradient_pnm6c")
|
||||
[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="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_scfaw")
|
||||
[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="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.3125, 126)
|
||||
texture = SubResource("GradientTexture1D_wyt1d")
|
||||
[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")
|
||||
|
||||
10
scenes/tile.tscn
Normal file
10
scenes/tile.tscn
Normal file
@ -0,0 +1,10 @@
|
||||
[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="."]
|
||||
position = Vector2(0, 2.28882e-05)
|
||||
scale = Vector2(0.074, 0.0740913)
|
||||
texture = ExtResource("1_bgcjk")
|
||||
70
scripts/boat.gd
Normal file
70
scripts/boat.gd
Normal file
@ -0,0 +1,70 @@
|
||||
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
|
||||
var speed = 100
|
||||
var velocity = Vector2()
|
||||
|
||||
func _ready():
|
||||
spawn_boat_tiles()
|
||||
spawn_boat_barriers()
|
||||
|
||||
func spawn_boat_tiles():
|
||||
tiles.clear()
|
||||
|
||||
for y in range(boatSize):
|
||||
var row = []
|
||||
for x 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
|
||||
)
|
||||
|
||||
row.append(tile)
|
||||
else:
|
||||
row.append(null) # On garde la structure mais on marque la tuile manquante
|
||||
tiles.append(row)
|
||||
|
||||
|
||||
func spawn_boat_barriers():
|
||||
for x in range(tiles.size()):
|
||||
for y in range(tiles[x].size()):
|
||||
if tiles[x][y]:
|
||||
var x_pos = [null,null,null,null];
|
||||
var y_pos = [null,null,null,null];
|
||||
var rotations = [90, 180, 270, 360]
|
||||
if x == 0 || !tiles[x-1][y]:
|
||||
x_pos[0] = tiles[x][y].position.x
|
||||
y_pos[0] = tiles[x][y].position.y - (tile_size/2)
|
||||
if y == 0 || !tiles[x][y-1]:
|
||||
x_pos[1] = tiles[x][y].position.x - (tile_size/2)
|
||||
y_pos[1] = tiles[x][y].position.y
|
||||
if x == tiles.size()-1 || !tiles[x+1][y]:
|
||||
x_pos[2] = tiles[x][y].position.x
|
||||
y_pos[2] = tiles[x][y].position.y + (tile_size/2)
|
||||
if y == tiles[x].size()-1 || !tiles[x][y+1]:
|
||||
x_pos[3] = tiles[x][y].position.x + (tile_size/2)
|
||||
y_pos[3] = tiles[x][y].position.y
|
||||
for z in range(4):
|
||||
if x_pos[z] != null && y_pos[z] != null:
|
||||
var barrier = barrier_scene.instantiate()
|
||||
add_child(barrier)
|
||||
barrier.position = Vector2(
|
||||
x_pos[z],
|
||||
y_pos[z]
|
||||
)
|
||||
# On applique la rotation à la barrière
|
||||
barrier.rotation = deg_to_rad(rotations[z])
|
||||
|
||||
func _physics_process(delta):
|
||||
#Just spinning
|
||||
rotation += delta/2
|
||||
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éfau
|
||||
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,10 +1,48 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
const SPEED = 300.0
|
||||
const JUMP_VELOCITY = -400.0
|
||||
@export var boat: Node2D
|
||||
|
||||
func _physics_process(delta):
|
||||
velocity.x = Input.get_axis("ui_left", "ui_right") * SPEED
|
||||
velocity.y = Input.get_axis("ui_up", "ui_down") * SPEED
|
||||
const TILE_SIZE = 128
|
||||
var relative_position_on_boat = Vector2(0, 0)
|
||||
var is_on_boat = true
|
||||
var last_boat_rotation = 0.0
|
||||
|
||||
move_and_slide()
|
||||
func _ready():
|
||||
if boat:
|
||||
relative_position_on_boat = position - boat.position
|
||||
last_boat_rotation = boat.rotation
|
||||
|
||||
func _physics_process(_delta):
|
||||
# On tourne le joueur vers la souris
|
||||
var mouse_position = get_global_mouse_position()
|
||||
look_at(mouse_position)
|
||||
if is_on_boat:
|
||||
if boat:
|
||||
# On calcule la difference de rotation du bateau depuis le dernier mouvement
|
||||
var delta_rotation = boat.rotation - last_boat_rotation
|
||||
|
||||
# On adape la position du joueur en fonction de la nouvelle rota
|
||||
relative_position_on_boat = relative_position_on_boat.rotated(delta_rotation)
|
||||
position = boat.position + relative_position_on_boat
|
||||
|
||||
# On autorise le joueur à se déplacer dans le bateau
|
||||
velocity.x = Input.get_axis("ui_left", "ui_right") * SPEED
|
||||
velocity.y = Input.get_axis("ui_up", "ui_down") * SPEED
|
||||
|
||||
move_and_slide()
|
||||
|
||||
# Mise à jour des paramètres pour le déplacement du joueur en fonction du bateau
|
||||
relative_position_on_boat = position - boat.position
|
||||
last_boat_rotation = boat.rotation
|
||||
|
||||
else:
|
||||
# Quand on est pas sur le bateau, on se déplace librement (le lapin surtout)
|
||||
velocity.x = Input.get_axis("ui_left", "ui_right") * SPEED/2
|
||||
velocity.y = Input.get_axis("ui_up", "ui_down") * SPEED/2
|
||||
|
||||
move_and_slide()
|
||||
|
||||
func set_on_boat(on_boat: bool):
|
||||
#TODO
|
||||
is_on_boat = on_boat
|
||||
|
||||
Loading…
Reference in New Issue
Block a user