too much water - ign

This commit is contained in:
zoe 2022-03-25 20:19:23 +01:00
parent b8fde19af1
commit 9d34538009
38 changed files with 402 additions and 23 deletions

View file

@ -0,0 +1,3 @@
source_md5="faab8881882c2dd7d342bc32adada8a6"
dest_md5="f11ba84b73a027d723bf7a1bd9d7f206"

View file

@ -0,0 +1,3 @@
source_md5="af9d5cf5b0e44e705c0df85d7c846c57"
dest_md5="9fb385faf18f3c43f7029b0d81164628"

View file

@ -0,0 +1,3 @@
source_md5="5cc3dacc9037b47e7183b7b4bfda4403"
dest_md5="78af387fb5a31697eb498e6814ab0f01"

View file

@ -0,0 +1,3 @@
source_md5="ea9c66f74493fe79d8ad87804f9d05d9"
dest_md5="cb4a12326cc8280988260062d802f136"

View file

@ -0,0 +1,3 @@
source_md5="9c3bc1326fd0badebe9e0a7931eaf86c"
dest_md5="e0dd63d56a05c39d8b755dd8edc3b2ad"

View file

@ -0,0 +1,3 @@
source_md5="d9e2c01c9d17c3992a9e9fa5ce90bc73"
dest_md5="d7da76c5ea5b80fda15196d356620194"

Binary file not shown.

6
Global/Randomizer.gd Normal file
View file

@ -0,0 +1,6 @@
extends Node
onready var rng = RandomNumberGenerator.new()
func set_seed(new_seed):
rng.seed = new_seed

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/platform.png-e79897c7ff8195dc0091ae3e9c22a315.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Resources/Graphics/Tiles/platform.png"
dest_files=[ "res://.import/platform.png-e79897c7ff8195dc0091ae3e9c22a315.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/platform2.png-cbd51a920a2794e07690642dfd7cd1d3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Resources/Graphics/Tiles/platform2.png"
dest_files=[ "res://.import/platform2.png-cbd51a920a2794e07690642dfd7cd1d3.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/platform3.png-5311651b484696e407a2e6d5496f1c30.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Resources/Graphics/Tiles/platform3.png"
dest_files=[ "res://.import/platform3.png-5311651b484696e407a2e6d5496f1c30.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/platform4.png-b382dee3050ec03f5e07cd2a9931649e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Resources/Graphics/Tiles/platform4.png"
dest_files=[ "res://.import/platform4.png-b382dee3050ec03f5e07cd2a9931649e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/close_to_land.png-01e739a54f71f449c550df208cfbaab1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Resources/Graphics/Water/close_to_land.png"
dest_files=[ "res://.import/close_to_land.png-01e739a54f71f449c550df208cfbaab1.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Resources/Graphics/Water/water1.png"
dest_files=[ "res://.import/water1.png-96dd6aee434a7808b413abd6ab0e2583.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View file

@ -1,13 +1,21 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://World/TileHandler.gd" type="Script" id=1]
[ext_resource path="res://World/Tools/Camera/Camera.tscn" type="PackedScene" id=2]
[ext_resource path="res://World/Props/WaterTexture.tscn" type="PackedScene" id=3]
[node name="Map" type="Node2D"]
[node name="BackgroundProps" type="Node2D" parent="."]
z_index = -1
[node name="WaterTexture" parent="BackgroundProps" instance=ExtResource( 3 )]
[node name="Grid" type="Node2D" parent="."]
script = ExtResource( 1 )
map_size = Vector2( 64, 64 )
[node name="CameraController" parent="." instance=ExtResource( 2 )]
[connection signal="size_updated" from="Grid" to="CameraController" method="_on_Grid_size_updated"]
[connection signal="limits_changed" from="CameraController" to="BackgroundProps/WaterTexture" method="_on_CameraController_limits_changed"]

View file

@ -0,0 +1,10 @@
extends TextureRect
func _on_CameraController_limits_changed(lefttop: Vector2, bottomright: Vector2) -> void:
rect_position = lefttop
rect_position.x -= 64
rect_position.y -= 64
rect_size.x = abs(lefttop.x) + bottomright.x + 64
rect_size.y = abs(lefttop.y) + bottomright.y + 64

View file

@ -0,0 +1,16 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Resources/Graphics/Water/water1.png" type="Texture" id=1]
[ext_resource path="res://World/Props/WaterTexture.gd" type="Script" id=2]
[sub_resource type="Animation" id=1]
resource_name = "Move"
[node name="WaterTexture" type="TextureRect"]
texture = ExtResource( 1 )
expand = true
stretch_mode = 2
script = ExtResource( 2 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/Move = SubResource( 1 )

View file

@ -1,5 +1,5 @@
extends Node2D
export var map_size = Vector2(32, 32)
export var map_size = Vector2(32, 16)
var tiles = []
signal size_updated(tiles)

View file

@ -0,0 +1,6 @@
extends Sprite
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
texture = get_node("../Platform").texture

View file

@ -2,9 +2,14 @@ extends Area2D
enum outline_colors{PURPLE, RED, BLUE, GREEN, YELLOW}
var tile_id = Vector2(0,0)
func _ready() -> void:
set_random_platform()
func change_color_to(color):
var sprite = $Sprite
if color == outline_colors.RED:
if color == outline_colors.PURPLE:
sprite.texture = preload("res://Resources/Graphics/Tiles/purple.png")
elif color == outline_colors.RED:
sprite.texture = preload("res://Resources/Graphics/Tiles/red.png")
elif color == outline_colors.BLUE:
sprite.texture = preload("res://Resources/Graphics/Tiles/blue.png")
@ -17,9 +22,17 @@ func set_tile_id(id: Vector2):
tile_id = id
set_position(id)
func set_position(id: Vector2):
position.x = id.x * 32
position.y = id.y * 26
if (fmod(id.y, 2)) == 0:
position.x += 16
func set_random_platform():
var sprite = $Platform
var sprites = [
preload("res://Resources/Graphics/Tiles/platform.png"),
preload("res://Resources/Graphics/Tiles/platform2.png"),
preload("res://Resources/Graphics/Tiles/platform3.png"),
preload("res://Resources/Graphics/Tiles/platform4.png"),
]

View file

@ -1,7 +1,45 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=12 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 )
@ -9,5 +47,33 @@ 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

View file

@ -2,8 +2,9 @@ extends Camera2D
export var zoom_strength = 0.6
export var zoom_limit_upper = 2
export var zoom_limit_lower = 0.05
signal limits_changed(lefttop, bottomright)
func _process(delta: float) -> void:
func _process(_delta: float) -> void:
# position
var left = Input.get_action_strength("move_camera_left")
var right = Input.get_action_strength("move_camera_right")
@ -21,14 +22,16 @@ func _process(delta: float) -> void:
global_position.y += global_position.direction_to(get_global_mouse_position()).y * distance
# if camera goes out of bounds, then reset it
if global_position.x -182 * zoom.x <= limit_left:
global_position.x = limit_left + 183 * zoom.x
elif global_position.x +182 * zoom.x >= limit_right:
global_position.x = limit_right - 183 * zoom.x
if global_position.y -64 * zoom.x <= limit_top:
global_position.y = limit_top + 65 * zoom.x
elif global_position.y +64 * zoom.x >= limit_bottom:
global_position.y = limit_bottom -65 * zoom.x
var halfwidth = ProjectSettings.get("display/window/size/width") / 2
var halfheight = ProjectSettings.get("display/window/size/height") / 2
if global_position.x - halfwidth * (zoom.x) <= limit_left :
global_position.x = limit_left + (halfwidth) * (zoom.x)
elif global_position.x + halfwidth * zoom.x >= limit_right:
global_position.x = limit_right - halfwidth * zoom.x
if global_position.y - halfheight * zoom.x <= limit_top:
global_position.y = limit_top + halfheight * zoom.x
elif global_position.y + halfheight * zoom.x >= limit_bottom:
global_position.y = limit_bottom - halfheight * zoom.x
# zoom
var zoom_direction = 0
@ -45,5 +48,6 @@ func _on_Grid_size_updated(tiles: Array) -> void:
limit_top = tiles.front().global_position.y - 64
limit_bottom = tiles.back().global_position.y + 64
limit_right = tiles.back().global_position.x + 64
position.x = limit_right / 2
position.y = limit_bottom / 2
position.x = limit_right / 2.0
position.y = limit_bottom / 2.0
emit_signal("limits_changed", Vector2(limit_left, limit_top), Vector2(limit_right, limit_bottom))

View file

@ -5,13 +5,11 @@
[node name="Camera" type="Camera2D"]
current = true
limit_smoothed = true
smoothing_enabled = true
drag_margin_left = 0.8
drag_margin_top = 0.8
drag_margin_right = 0.8
drag_margin_bottom = 0.8
editor_draw_limits = true
script = ExtResource( 1 )
[node name="Icon" type="Sprite" parent="."]

View file

@ -15,6 +15,10 @@ run/main_scene="res://World/Map.tscn"
boot_splash/fullsize=false
config/icon="res://icon.png"
[autoload]
Randomizer="*res://Global/Randomizer.gd"
[display]
window/size/width=640
@ -23,6 +27,30 @@ window/size/test_height=1
window/stretch/mode="2d"
window/stretch/aspect="keep"
[importer_defaults]
texture={
"compress/bptc_ldr": 0,
"compress/hdr_mode": 0,
"compress/lossy_quality": 0.7,
"compress/mode": 0,
"compress/normal_map": 0,
"detect_3d": false,
"flags/anisotropic": false,
"flags/filter": false,
"flags/mipmaps": false,
"flags/repeat": 0,
"flags/srgb": 2,
"process/HDR_as_SRGB": false,
"process/fix_alpha_border": true,
"process/invert_color": false,
"process/normal_map_invert_y": false,
"process/premult_alpha": false,
"size_limit": 0,
"stream": false,
"svg/scale": 1.0
}
[input]
ui_accept={
@ -127,17 +155,13 @@ camera_drag={
]
}
[layer_names]
2d_physics/layer_10="world_boundary"
[physics]
common/enable_pause_aware_picking=true
[rendering]
environment/default_clear_color=Color( 0.121569, 0.0627451, 0.164706, 1 )
environment/default_clear_color=Color( 0.552941, 0.717647, 1, 1 )
environment/default_environment="res://default_env.tres"
[world]