decent progress; not enough to submit

This commit is contained in:
Adam Burns 2026-03-30 00:16:49 -04:00
parent 093ed20a0b
commit ef76dc3205
21 changed files with 538 additions and 25 deletions

32
boat.gd Normal file
View File

@ -0,0 +1,32 @@
#@tool
#@icon(icon_path: String)
class_name Boat
extends RigidBody2D
## Documentation comments
#signal
#enum
#const
@export var movement_speed: float = 10.0
#var
#@onready var
@onready var right_cast: RayCast2D = %RightCast
@onready var left_cast: RayCast2D = %LeftCast
## OVERRIDES
func _ready() -> void:
pass
func _process(_delta: float) -> void:
pass
func _physics_process(delta: float) -> void:
apply_central_force(Vector2(movement_speed, 0.0))
## CORE
## PRIVATE/HELPER
## RECEIVERS
## SETTERS/GETTERS

1
boat.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://b464eeimyvolw

32
boat.tscn Normal file
View File

@ -0,0 +1,32 @@
[gd_scene format=3 uid="uid://drmwx05dw5d3c"]
[ext_resource type="Texture2D" uid="uid://iiyslw33af84" path="res://sprites/red.png" id="1_annr2"]
[ext_resource type="Script" uid="uid://b464eeimyvolw" path="res://boat.gd" id="1_viw7v"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_annr2"]
radius = 16.0
height = 100.0
[node name="Boat" type="RigidBody2D" unique_id=918212763]
collision_layer = 8
collision_mask = 14
script = ExtResource("1_viw7v")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=522204430]
scale = Vector2(0.1, 0.1)
texture = ExtResource("1_annr2")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1042250248]
position = Vector2(0, 16)
rotation = 1.5707964
shape = SubResource("CapsuleShape2D_annr2")
[node name="RightCast" type="RayCast2D" parent="." unique_id=1726274503]
unique_name_in_owner = true
target_position = Vector2(100, 0)
collision_mask = 8
[node name="LeftCast" type="RayCast2D" parent="." unique_id=1387764071]
unique_name_in_owner = true
target_position = Vector2(-100, 0)
collision_mask = 8

View File

@ -1,31 +1,133 @@
[gd_scene format=3 uid="uid://m87tvwartvc6"]
[ext_resource type="PackedScene" uid="uid://ct16vr66fn58d" path="res://shark.tscn" id="1_a68s1"]
[ext_resource type="PackedScene" uid="uid://drmwx05dw5d3c" path="res://boat.tscn" id="2_4l5f2"]
[sub_resource type="Gradient" id="Gradient_a68s1"]
colors = PackedColorArray(0.06666667, 0.06666667, 0.07058824, 1, 0.07058824, 0.6666667, 0.7764706, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_4l5f2"]
gradient = SubResource("Gradient_a68s1")
width = 3840
height = 2160
fill_from = Vector2(1, 1)
[sub_resource type="Gradient" id="Gradient_jmyjl"]
colors = PackedColorArray(0.3529412, 0.29803923, 0.4392157, 1, 0.897154, 0.4827388, 0.4083181, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_1hbw6"]
gradient = SubResource("Gradient_jmyjl")
width = 3840
height = 1080
fill_to = Vector2(0, 1)
[sub_resource type="Gradient" id="Gradient_4l5f2"]
interpolation_mode = 2
offsets = PackedFloat32Array(0.3008658, 0.66450214, 0.9805195)
colors = PackedColorArray(0.06666667, 0.06666667, 0.07058824, 1, 0.3529412, 0.29803923, 0.4392157, 1, 0.039215688, 0.48235294, 0.60784316, 1)
colors = PackedColorArray(0, 0, 0, 0, 0.6392157, 0.8117647, 0.87058824, 0.06666667)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_8hhxv"]
noise_type = 2
domain_warp_enabled = true
frequency = 0.005
fractal_octaves = 1
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_jmyjl"]
width = 3840
height = 2160
noise = SubResource("FastNoiseLite_8hhxv")
color_ramp = SubResource("Gradient_4l5f2")
seamless = true
[sub_resource type="Gradient" id="Gradient_8hhxv"]
offsets = PackedFloat32Array(0.64718616, 0.95887446)
colors = PackedColorArray(0, 0, 0, 0, 0.5137255, 0.74509805, 0.72156864, 0.07058824)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_jmyjl"]
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_a68s1"]
width = 2160
height = 2160
noise = SubResource("FastNoiseLite_jmyjl")
color_ramp = SubResource("Gradient_8hhxv")
seamless = true
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_4l5f2"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_a68s1"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8hhxv"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_jmyjl"]
[node name="Main2D" type="Node2D" unique_id=1396228864]
[node name="BackgroundLayer" type="Parallax2D" parent="." unique_id=1376556356]
repeat_size = Vector2(512, 512)
scroll_offset = Vector2(0, 1080)
repeat_size = Vector2(3840, 0)
repeat_times = 10
[node name="Sprite2D" type="Sprite2D" parent="BackgroundLayer" unique_id=2137941191]
texture = SubResource("NoiseTexture2D_jmyjl")
[node name="OceanBackground" type="Sprite2D" parent="BackgroundLayer" unique_id=2137941191]
texture = SubResource("GradientTexture2D_4l5f2")
[node name="SkyBackground" type="Sprite2D" parent="BackgroundLayer" unique_id=1592430551]
position = Vector2(0, -1620)
texture = SubResource("GradientTexture2D_1hbw6")
[node name="MidgroundLayer" type="Parallax2D" parent="." unique_id=2049755198]
scroll_offset = Vector2(0, 1080)
repeat_size = Vector2(3840, 0)
autoscroll = Vector2(-100, 0)
repeat_times = 10
[node name="Sprite2D" type="Sprite2D" parent="MidgroundLayer" unique_id=1680715438]
texture = SubResource("NoiseTexture2D_jmyjl")
[node name="ForegroundLayer" type="Parallax2D" parent="." unique_id=603516260]
z_index = 100
scroll_scale = Vector2(2, 1)
scroll_offset = Vector2(0, 1080)
repeat_size = Vector2(2160, 0)
autoscroll = Vector2(-200, 0)
repeat_times = 10
[node name="Sprite2D" type="Sprite2D" parent="ForegroundLayer" unique_id=904849640]
texture = SubResource("NoiseTexture2D_a68s1")
[node name="Shark" parent="." unique_id=868425079 instance=ExtResource("1_a68s1")]
position = Vector2(0, 1080)
[node name="WaterLevel" type="StaticBody2D" parent="." unique_id=1297570319]
collision_layer = 4
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="WaterLevel" unique_id=1033306709]
shape = SubResource("WorldBoundaryShape2D_4l5f2")
[node name="Boat" parent="." unique_id=441622829 instance=ExtResource("2_4l5f2")]
position = Vector2(0, -109)
movement_speed = 1000.0
[node name="Boundaries" type="Node" parent="." unique_id=406655667]
[node name="Bottom" type="StaticBody2D" parent="Boundaries" unique_id=1567577642]
position = Vector2(0, 2160)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boundaries/Bottom" unique_id=2143383673]
shape = SubResource("WorldBoundaryShape2D_a68s1")
[node name="Left" type="StaticBody2D" parent="Boundaries" unique_id=1447638927]
position = Vector2(-21000, 0)
collision_layer = 2
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boundaries/Left" unique_id=563328830]
rotation = 1.5707964
shape = SubResource("WorldBoundaryShape2D_8hhxv")
[node name="Right" type="StaticBody2D" parent="Boundaries" unique_id=1086854750]
position = Vector2(21000, 0)
collision_layer = 2
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boundaries/Right" unique_id=978843810]
rotation = -1.5707964
shape = SubResource("WorldBoundaryShape2D_jmyjl")

BIN
misc/bigger-boat-1080p.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dlr08vnbmuua"
path="res://.godot/imported/bigger-boat-1080p.png-feecd7b092b603b1dd483721ecbb38de.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://misc/bigger-boat-1080p.png"
dest_files=["res://.godot/imported/bigger-boat-1080p.png-feecd7b092b603b1dd483721ecbb38de.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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@ -11,9 +11,16 @@ config_version=5
[application]
config/name="trijam-365-movie-quote"
run/main_scene="uid://m87tvwartvc6"
config/features=PackedStringArray("4.6", "GL Compatibility")
boot_splash/image="uid://dlr08vnbmuua"
config/icon="res://icon.svg"
[display]
window/size/viewport_width=1920
window/size/viewport_height=1080
[input]
up={
@ -47,6 +54,13 @@ swim={
]
}
[layer_names]
2d_physics/layer_1="player"
2d_physics/layer_2="boundaries"
2d_physics/layer_3="water_level"
2d_physics/layer_4="boats"
[physics]
3d/physics_engine="Jolt Physics"

View File

@ -1,27 +1,31 @@
#@tool
#@icon(icon_path: String)
#class_name MyNode
extends CharacterBody2D
extends RigidBody2D
## Documentation comments
#signal
enum FaceDirection {LEFT, RIGHT}
#const
@export_range(0, 360, 1.0, "radians_as_degrees") var rotation_speed: float = 0.0 ## degrees per second
enum State {IDLE, SWIM, BITE}
const WATER_LEVEL: float = 0.0
@export_range(0, 360, 1.0, "radians_as_degrees") var rotation_speed: float = 0.0 ## degrees per second
@export var swim_power: float = 100.0
var altitude: float = 0.0
var current_state: State = State.IDLE: set = set_state
var input_vector: Vector2
var facing_right: bool = true: set = set_facing_right
var tilt: float = 0.0
var tilt_power: float = 0.0
@onready var shark_sprite: AnimatedSprite2D = $SharkSprite
@onready var shark_collider: CollisionShape2D = $SharkCollider
@onready var shark_cam: Camera2D = $SharkCam
#@onready var shark_cam: Camera2D = $SharkCam
## OVERRIDES
func _ready() -> void:
pass
_connect_signals()
func _process(_delta: float) -> void:
if facing_right:
@ -30,6 +34,41 @@ func _process(_delta: float) -> void:
tilt = -clamp(rotation, -1.0, 1.0)
func _physics_process(delta: float) -> void:
_handle_movement(delta)
if Input.is_action_just_pressed("swim"):
_swim()
if Input.is_action_just_pressed("bite"):
_bite()
if global_position.y < WATER_LEVEL:
_apply_gravity()
else:
altitude = 0.0
gravity_scale = 0.01
## CORE
func _bite() -> void:
current_state = State.BITE
_apply_swimpulse()
func _swim() -> void:
current_state = State.SWIM
_apply_swimpulse()
## PRIVATE/HELPER
func _apply_gravity() -> void:
altitude = -global_position.y
gravity_scale = 0.01 * altitude
func _apply_swimpulse() -> void:
if facing_right:
apply_central_impulse(Vector2(1.0, tilt).normalized() * swim_power)
else:
apply_central_impulse(Vector2(-1.0, tilt).normalized() * swim_power)
func _connect_signals() -> void:
shark_sprite.connect("animation_finished", on_animation_finished)
func _handle_movement(delta: float) -> void:
# handle left-right movement
input_vector.x = Input.get_axis("left", "right")
# flip sprite if needed
@ -57,11 +96,9 @@ func _physics_process(delta: float) -> void:
rotate(-rotation_speed * delta)
## CORE
## PRIVATE/HELPER
## RECEIVERS
func on_animation_finished() -> void:
current_state = State.IDLE
## SETTERS/GETTERS
func set_facing_right(is_facing_right: bool) -> void:
@ -72,4 +109,12 @@ func set_facing_right(is_facing_right: bool) -> void:
else:
shark_sprite.flip_h = false
facing_right = is_facing_right
func set_state(new_state: State) -> void:
match new_state:
State.IDLE:
shark_sprite.play("idle")
State.SWIM:
shark_sprite.play("swim")
State.BITE:
shark_sprite.play("bite")

View File

@ -327,7 +327,7 @@ animations = [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ax117")
}],
"loop": true,
"loop": false,
"name": &"swim",
"speed": 24.0
}]
@ -336,27 +336,34 @@ animations = [{
radius = 100.0
height = 500.0
[node name="Shark" type="CharacterBody2D" unique_id=868425079]
[node name="Shark" type="RigidBody2D" unique_id=1655095595]
z_index = 10
gravity_scale = 0.01
script = ExtResource("1_uce6o")
rotation_speed = 1.5707963267948966
[node name="SharkSprite" type="AnimatedSprite2D" parent="." unique_id=1862357568]
sprite_frames = SubResource("SpriteFrames_odtda")
animation = &"bite"
animation = &"swim"
autoplay = "idle"
flip_h = true
[node name="SharkCam" type="Camera2D" parent="." unique_id=692363117]
zoom = Vector2(0.333, 0.333)
limit_left = -21000
limit_top = -1080
limit_right = 21000
limit_bottom = 2160
drag_horizontal_enabled = true
editor_draw_limits = true
[node name="SharkCollider" type="CollisionShape2D" parent="." unique_id=1437907772]
rotation = 1.5707964
shape = SubResource("CapsuleShape2D_uce6o")
[node name="RayCast2D" type="RayCast2D" parent="." unique_id=1636588841]
target_position = Vector2(500, 0)
[node name="SharkDebugLayer" type="CanvasLayer" parent="." unique_id=359221405]
visible = false
[node name="DebugSection" parent="SharkDebugLayer" unique_id=305062788 node_paths=PackedStringArray("target_node") instance=ExtResource("5_l26on")]
target_node = NodePath("../..")
variables_to_track = Array[StringName]([&"input_vector", &"facing_right", &"tilt", &"rotation_speed", &"rotation"])
variables_to_track = Array[StringName]([&"input_vector", &"facing_right", &"tilt", &"gravity_scale", &"rotation", &"linear_velocity", &"global_position", &"altitude"])

BIN
sprites/blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

40
sprites/blue.png.import Normal file
View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://yai2aniw0qk1"
path="res://.godot/imported/blue.png-12b76ed1cac07a8614fed55e35d68b1b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/blue.png"
dest_files=["res://.godot/imported/blue.png-12b76ed1cac07a8614fed55e35d68b1b.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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
sprites/green-orange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ch6ln0yerieih"
path="res://.godot/imported/green-orange.png-fb0f5a83648c3627af38c74ed4d2fc0c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/green-orange.png"
dest_files=["res://.godot/imported/green-orange.png-fb0f5a83648c3627af38c74ed4d2fc0c.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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
sprites/green.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

40
sprites/green.png.import Normal file
View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bdot1ynvwgy1e"
path="res://.godot/imported/green.png-656e452538eec42f12fdd2fccb1b1800.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/green.png"
dest_files=["res://.godot/imported/green.png-656e452538eec42f12fdd2fccb1b1800.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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
sprites/purple.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

40
sprites/purple.png.import Normal file
View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bibif5edtqpi4"
path="res://.godot/imported/purple.png-844a0d700820f7245b6d600a65da611a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/purple.png"
dest_files=["res://.godot/imported/purple.png-844a0d700820f7245b6d600a65da611a.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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
sprites/red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

40
sprites/red.png.import Normal file
View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://iiyslw33af84"
path="res://.godot/imported/red.png-05b3228fc2d1b95d5876cdf9be510c01.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/red.png"
dest_files=["res://.godot/imported/red.png-05b3228fc2d1b95d5876cdf9be510c01.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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
sprites/yellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

40
sprites/yellow.png.import Normal file
View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ceiehilleoqyy"
path="res://.godot/imported/yellow.png-334014744dabb6f115a5c37377da0f22.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/yellow.png"
dest_files=["res://.godot/imported/yellow.png-334014744dabb6f115a5c37377da0f22.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
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
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1