diff --git a/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.md5 b/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.md5 index 9b9cb3a..eccfa97 100644 --- a/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.md5 +++ b/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.md5 @@ -1,3 +1,3 @@ -source_md5="d9e2c01c9d17c3992a9e9fa5ce90bc73" -dest_md5="d7da76c5ea5b80fda15196d356620194" +source_md5="3384dd00c44f65297c45a26a1b808f2c" +dest_md5="7f8383210199c01e63f81f4a23f2568b" diff --git a/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.stex b/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.stex index 7af8c84..dec187f 100644 Binary files a/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.stex and b/.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.stex differ diff --git a/Resources/Graphics/Water/water1.png b/Resources/Graphics/Water/water1.png index 9e36727..afce59e 100644 Binary files a/Resources/Graphics/Water/water1.png and b/Resources/Graphics/Water/water1.png differ diff --git a/World/TileHandler.gd b/World/TileHandler.gd index b712ce4..a83bcaa 100644 --- a/World/TileHandler.gd +++ b/World/TileHandler.gd @@ -12,6 +12,8 @@ func spawn(): for y in range (0, map_size.y): var tile = Tile.instance() tile.set_tile_id(Vector2(x,y)) + if x == 0 or x == map_size.x -1 or y== 0 or y==map_size.y -1: + tile.is_coast = true tiles.append(tile) add_child(tile) update_size() diff --git a/World/Tiles/CoastalProps.tscn b/World/Tiles/CoastalProps.tscn new file mode 100644 index 0000000..cf6afdd --- /dev/null +++ b/World/Tiles/CoastalProps.tscn @@ -0,0 +1,70 @@ +[gd_scene load_steps=10 format=2] + +[ext_resource path="res://World/Tiles/Reflection.gd" type="Script" id=1] +[ext_resource path="res://Resources/Graphics/Water/close_to_land.png" type="Texture" id=2] +[ext_resource path="res://Resources/Graphics/Tiles/platform.png" type="Texture" id=3] + +[sub_resource type="ParticlesMaterial" id=6] +emission_shape = 2 +emission_box_extents = Vector3( 16, 1, 1 ) +flag_disable_z = true +direction = Vector3( 0, -1, 0 ) +gravity = Vector3( 0, 5, 0 ) +initial_velocity = 10.0 +initial_velocity_random = 0.5 +orbit_velocity = 0.0 +orbit_velocity_random = 0.0 + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 2 ) +region = Rect2( 0, 0, 32, 32 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 2 ) +region = Rect2( 32, 0, 32, 32 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 2 ) +region = Rect2( 64, 0, 32, 32 ) + +[sub_resource type="AtlasTexture" id=5] +atlas = ExtResource( 2 ) +region = Rect2( 96, 0, 32, 32 ) + +[sub_resource type="SpriteFrames" id=1] +animations = [ { +"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ], +"loop": true, +"name": "default", +"speed": 2.0 +} ] + +[node name="CoastalProps" type="Node2D"] + +[node name="Platform" type="Sprite" parent="."] +position = Vector2( 0, 16 ) +z_index = -1 +texture = ExtResource( 3 ) + +[node name="Particles2D" type="Particles2D" parent="."] +position = Vector2( 0, 29 ) +z_index = -1 +amount = 2 +lifetime = 2.0 +randomness = 1.0 +process_material = SubResource( 6 ) + +[node name="Reflection" type="Sprite" parent="."] +self_modulate = Color( 1, 1, 1, 0.113725 ) +position = Vector2( 0, 37 ) +z_index = -1 +texture = ExtResource( 3 ) +flip_v = true +script = ExtResource( 1 ) + +[node name="Water" type="AnimatedSprite" parent="."] +position = Vector2( 0, 16 ) +z_index = -1 +frames = SubResource( 1 ) +frame = 1 +playing = true diff --git a/World/Tiles/Tile.gd b/World/Tiles/Tile.gd index e6de7e7..3a1818d 100644 --- a/World/Tiles/Tile.gd +++ b/World/Tiles/Tile.gd @@ -1,8 +1,11 @@ extends Area2D enum outline_colors{PURPLE, RED, BLUE, GREEN, YELLOW} var tile_id = Vector2(0,0) +var is_coast = false func _ready() -> void: + if is_coast: + add_child(preload("res://World/Tiles/CoastalProps.tscn").instance()) set_random_platform() func change_color_to(color): diff --git a/World/Tiles/Tile.tscn b/World/Tiles/Tile.tscn index 905c137..6d92f2a 100644 --- a/World/Tiles/Tile.tscn +++ b/World/Tiles/Tile.tscn @@ -1,45 +1,7 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://Resources/Graphics/Tiles/purple.png" type="Texture" id=1] [ext_resource path="res://World/Tiles/Tile.gd" type="Script" id=2] -[ext_resource path="res://Resources/Graphics/Tiles/platform.png" type="Texture" id=3] -[ext_resource path="res://Resources/Graphics/Water/close_to_land.png" type="Texture" id=4] -[ext_resource path="res://World/Tiles/Reflection.gd" type="Script" id=5] - -[sub_resource type="ParticlesMaterial" id=6] -emission_shape = 2 -emission_box_extents = Vector3( 16, 1, 1 ) -flag_disable_z = true -direction = Vector3( 0, -1, 0 ) -gravity = Vector3( 0, 5, 0 ) -initial_velocity = 10.0 -initial_velocity_random = 0.5 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 - -[sub_resource type="AtlasTexture" id=2] -atlas = ExtResource( 4 ) -region = Rect2( 0, 0, 32, 32 ) - -[sub_resource type="AtlasTexture" id=3] -atlas = ExtResource( 4 ) -region = Rect2( 32, 0, 32, 32 ) - -[sub_resource type="AtlasTexture" id=4] -atlas = ExtResource( 4 ) -region = Rect2( 64, 0, 32, 32 ) - -[sub_resource type="AtlasTexture" id=5] -atlas = ExtResource( 4 ) -region = Rect2( 96, 0, 32, 32 ) - -[sub_resource type="SpriteFrames" id=1] -animations = [ { -"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ], -"loop": true, -"name": "default", -"speed": 2.0 -} ] [node name="Tile" type="Area2D"] script = ExtResource( 2 ) @@ -47,33 +9,6 @@ script = ExtResource( 2 ) [node name="Sprite" type="Sprite" parent="."] texture = ExtResource( 1 ) -[node name="Platform" type="Sprite" parent="."] -position = Vector2( 0, 16 ) -z_index = -1 -texture = ExtResource( 3 ) - -[node name="Particles2D" type="Particles2D" parent="."] -position = Vector2( 0, 29 ) -z_index = -1 -amount = 2 -lifetime = 2.0 -randomness = 1.0 -process_material = SubResource( 6 ) - -[node name="Reflection" type="Sprite" parent="."] -self_modulate = Color( 1, 1, 1, 0.113725 ) -position = Vector2( 0, 37 ) -z_index = -1 -texture = ExtResource( 3 ) -flip_v = true -script = ExtResource( 5 ) - [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] visible = false polygon = PoolVector2Array( -15, -9, -14, -10, -12, -11, -9, -12, -7, -13, -4, -14, -2, -15, 2, -15, 4, -14, 7, -13, 9, -12, 12, -11, 14, -10, 15, -9, 15, 9, 14, 10, 12, 11, 9, 12, 7, 13, 4, 14, 2, 15, -2, 15, -4, 14, -7, 13, -9, 12, -12, 11, -14, 10, -15, 9 ) - -[node name="Water" type="AnimatedSprite" parent="."] -position = Vector2( 0, 16 ) -z_index = -1 -frames = SubResource( 1 ) -playing = true