From dc007403403dba19fcaf56ad1369f0758f96b1f8 Mon Sep 17 00:00:00 2001 From: ToasterPanic Date: Tue, 2 Dec 2025 14:51:40 -0500 Subject: [PATCH] Space station, ground mode start --- project.godot | 26 +++++++- scenes/game.tscn | 78 +++++++++++++++++++--- scenes/ground_test.tscn | 88 ++++++++++++++++++++++++ scenes/loading.tscn | 100 ++++++++++++++++++++++++++++ scripts/enterable.gd | 7 ++ scripts/enterable.gd.uid | 1 + scripts/game.gd | 2 + scripts/global.gd | 11 +-- scripts/player.gd | 8 ++- scripts/player_ground.gd | 9 +++ scripts/player_ground.gd.uid | 1 + scripts/retro.gdshader | 93 ++++++++++++++++++++++++++ scripts/retro.gdshader.uid | 1 + textures/blank.png | Bin 0 -> 156 bytes textures/blank.png.import | 40 +++++++++++ textures/navigation_ring.png | Bin 0 -> 2243 bytes textures/navigation_ring.png.import | 40 +++++++++++ textures/player.png | Bin 0 -> 419 bytes textures/player.png.import | 40 +++++++++++ textures/space_station_1.png | Bin 0 -> 2509 bytes textures/space_station_1.png.import | 40 +++++++++++ textures/wall_tile.png | Bin 0 -> 158 bytes textures/wall_tile.png.import | 40 +++++++++++ 23 files changed, 606 insertions(+), 19 deletions(-) create mode 100644 scenes/ground_test.tscn create mode 100644 scenes/loading.tscn create mode 100644 scripts/enterable.gd create mode 100644 scripts/enterable.gd.uid create mode 100644 scripts/player_ground.gd create mode 100644 scripts/player_ground.gd.uid create mode 100644 scripts/retro.gdshader create mode 100644 scripts/retro.gdshader.uid create mode 100644 textures/blank.png create mode 100644 textures/blank.png.import create mode 100644 textures/navigation_ring.png create mode 100644 textures/navigation_ring.png.import create mode 100644 textures/player.png create mode 100644 textures/player.png.import create mode 100644 textures/space_station_1.png create mode 100644 textures/space_station_1.png.import create mode 100644 textures/wall_tile.png create mode 100644 textures/wall_tile.png.import diff --git a/project.godot b/project.godot index 29ad97d..5d09a6a 100644 --- a/project.godot +++ b/project.godot @@ -39,14 +39,12 @@ theme/custom_font="uid://n1nd5m2kwexu" turn_left={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"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":97,"location":0,"echo":false,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null) ] } turn_right={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"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":100,"location":0,"echo":false,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null) ] } @@ -99,6 +97,30 @@ pause={ , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":true,"script":null) ] } +ground_left={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"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":97,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) +] +} +ground_right={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"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":100,"location":0,"echo":false,"script":null) +] +} +ground_up={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"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":119,"location":0,"echo":false,"script":null) +] +} +ground_down={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"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":115,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null) +] +} [physics] diff --git a/scenes/game.tscn b/scenes/game.tscn index 65d3947..9bd3dd1 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://bauklhpieuivd"] +[gd_scene load_steps=21 format=4 uid="uid://bauklhpieuivd"] [ext_resource type="Script" uid="uid://d0qswyhwbhdua" path="res://scripts/game.gd" id="1_u5sy4"] [ext_resource type="Texture2D" uid="uid://dtwo7g0ipc4k" path="res://textures/ship_1.png" id="1_uwrxv"] @@ -9,7 +9,11 @@ [ext_resource type="AudioStream" uid="uid://b6tyof2j3ytbv" path="res://sounds/concrete_halls.mp3" id="3_0tnpc"] [ext_resource type="AudioStream" uid="uid://b1ung55xg31l3" path="res://sounds/boost_finish.mp3" id="3_p57ef"] [ext_resource type="AudioStream" uid="uid://y7lhonymtk3t" path="res://sounds/fire.mp3" id="8_vtaks"] -[ext_resource type="PackedScene" uid="uid://dy6dv2tio433m" path="res://scenes/enemy.tscn" id="11_dinhu"] +[ext_resource type="Texture2D" uid="uid://dsdd1830ilu1" path="res://textures/navigation_ring.png" id="10_dinhu"] +[ext_resource type="Texture2D" uid="uid://yfsqc4i52c6k" path="res://textures/space_station_1.png" id="12_dinhu"] +[ext_resource type="Shader" uid="uid://bk7q00br1ms30" path="res://scripts/retro.gdshader" id="12_kvuet"] +[ext_resource type="Texture2D" uid="uid://hgfmjw6gbdnn" path="res://textures/blank.png" id="12_trtic"] +[ext_resource type="Script" uid="uid://d0txwo63hlrsy" path="res://scripts/enterable.gd" id="13_trtic"] [sub_resource type="CircleShape2D" id="CircleShape2D_uwrxv"] radius = 16.0 @@ -17,6 +21,34 @@ radius = 16.0 [sub_resource type="CircleShape2D" id="CircleShape2D_lnu2h"] radius = 20.0 +[sub_resource type="ShaderMaterial" id="ShaderMaterial_trtic"] +shader = ExtResource("12_kvuet") +shader_parameter/shake = 0.002000000095 +shader_parameter/noiseQuality = 250.0 +shader_parameter/noiseIntensity = 0.0010000000475 +shader_parameter/offsetIntensity = 0.0045 +shader_parameter/colorOffsetIntensity = 0.10000000149012 +shader_parameter/pixelSize = 1024.0 +shader_parameter/grainIntensity = 0.04 +shader_parameter/use_overlay = true +shader_parameter/use_lens_distortion = true +shader_parameter/overlay_color = Color(1, 1, 1, 10) +shader_parameter/lens_distortion_strength = 0.0 + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ir15t"] +texture = ExtResource("12_trtic") +0:0/size_in_atlas = Vector2i(2, 2) +0:0/0 = 0 +0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) + +[sub_resource type="TileSet" id="TileSet_ca42v"] +tile_size = Vector2i(32, 32) +physics_layer_0/collision_layer = 1 +sources/0 = SubResource("TileSetAtlasSource_ir15t") + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_kvuet"] +size = Vector2(128, 32) + [node name="Game" type="Node2D"] script = ExtResource("1_u5sy4") @@ -30,6 +62,9 @@ stream = ExtResource("3_0tnpc") volume_db = -10.0 bus = &"Music" +[node name="Navring" type="Sprite2D" parent="."] +texture = ExtResource("10_dinhu") + [node name="Player" type="RigidBody2D" parent="."] linear_damp = 6.247 script = ExtResource("1_yqjtg") @@ -69,15 +104,6 @@ rotation_smoothing_speed = 15.0 shape = SubResource("CircleShape2D_lnu2h") debug_color = Color(0.9686392, 0, 0.4696517, 0.41960785) -[node name="Enemy" parent="." instance=ExtResource("11_dinhu")] -position = Vector2(0, -418) - -[node name="Enemy2" parent="." instance=ExtResource("11_dinhu")] -position = Vector2(362, 397) - -[node name="Enemy3" parent="." instance=ExtResource("11_dinhu")] -position = Vector2(362, 397) - [node name="Unloadables" type="Node2D" parent="."] [node name="UI" type="CanvasLayer" parent="."] @@ -107,4 +133,34 @@ offset_bottom = 12.0 grow_vertical = 2 text = "DIST: 2048" +[node name="Shader" type="ColorRect" parent="UI"] +material = SubResource("ShaderMaterial_trtic") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(1, 1, 1, 0) + +[node name="SpaceStation1" type="Sprite2D" parent="."] +scale = Vector2(2, 2) +texture = ExtResource("12_dinhu") +script = ExtResource("13_trtic") + +[node name="Collision" type="TileMapLayer" parent="SpaceStation1"] +scale = Vector2(0.5, 0.5) +tile_map_data = PackedByteArray("AAD6/wgAAAAAAAAAAAD6/wkAAAAAAAAAAAD6/woAAAAAAAAAAAD6/wsAAAAAAAAAAAD6/wwAAAAAAAAAAAD6/w0AAAAAAAAAAAD6/w4AAAAAAAAAAAD6/w8AAAAAAAAAAAD7/w8AAAAAAAAAAAD8/w8AAAAAAAAAAAD9/w8AAAAAAAAAAAD9/w4AAAAAAAAAAAD8/w4AAAAAAAAAAAD7/w4AAAAAAAAAAAD7/w0AAAAAAAAAAAD7/wwAAAAAAA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+ +[node name="CollisionShape2D" type="CollisionShape2D" parent="SpaceStation1/EnterHitbox"] +shape = SubResource("RectangleShape2D_kvuet") + +[node name="ExitPoint" type="Node2D" parent="SpaceStation1"] +position = Vector2(0, 245.5) +rotation = 3.1415927 + [connection signal="body_shape_entered" from="Player/Hitbox" to="Player" method="_on_hitbox_body_shape_entered"] +[connection signal="area_entered" from="SpaceStation1/EnterHitbox" to="SpaceStation1" method="_on_enter_hitbox_area_entered"] diff --git a/scenes/ground_test.tscn b/scenes/ground_test.tscn new file mode 100644 index 0000000..a52a010 --- /dev/null +++ b/scenes/ground_test.tscn @@ -0,0 +1,88 @@ +[gd_scene load_steps=9 format=3 uid="uid://crc7t4acei3hj"] + +[ext_resource type="Texture2D" uid="uid://c6s5n6xqoy353" path="res://textures/player.png" id="1_s58gg"] +[ext_resource type="Script" uid="uid://dowu512otgyyf" path="res://scripts/player_ground.gd" id="1_vgnaj"] +[ext_resource type="Texture2D" uid="uid://btcap3oh2dqt8" path="res://textures/wall_tile.png" id="3_jsun3"] +[ext_resource type="Shader" uid="uid://bk7q00br1ms30" path="res://scripts/retro.gdshader" id="4_ppdof"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_ppdof"] +radius = 32.0 + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ppdof"] +texture = ExtResource("3_jsun3") +0:0/size_in_atlas = Vector2i(2, 2) +0:0/0 = 0 +0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) + +[sub_resource type="TileSet" id="TileSet_gysiw"] +tile_size = Vector2i(32, 32) +physics_layer_0/collision_layer = 1 +sources/0 = SubResource("TileSetAtlasSource_ppdof") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_gysiw"] +shader = ExtResource("4_ppdof") +shader_parameter/shake = 0.002000000095 +shader_parameter/noiseQuality = 250.0 +shader_parameter/noiseIntensity = 0.0010000000475 +shader_parameter/offsetIntensity = 0.0045 +shader_parameter/colorOffsetIntensity = 0.10000000149012 +shader_parameter/pixelSize = 1024.0 +shader_parameter/grainIntensity = 0.04 +shader_parameter/use_overlay = true +shader_parameter/use_lens_distortion = true +shader_parameter/overlay_color = Color(1, 1, 1, 10) +shader_parameter/lens_distortion_strength = 0.0 + +[node name="GroundTest" type="Node2D"] + +[node name="PlayerGround" type="CharacterBody2D" parent="."] +script = ExtResource("1_vgnaj") + +[node name="Sprite" type="Sprite2D" parent="PlayerGround"] +texture = ExtResource("1_s58gg") + +[node name="Camera" type="Camera2D" parent="PlayerGround"] +position_smoothing_enabled = true + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerGround"] +shape = SubResource("CircleShape2D_ppdof") + +[node name="Map" type="TileMapLayer" parent="."] +tile_map_data = PackedByteArray(0, 0, 253, 255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 253, 255, 254, 255, 0, 0, 0, 0, 0, 0, 0, 0) +tile_set = SubResource("TileSet_gysiw") + +[node name="UI" type="CanvasLayer" parent="."] + +[node name="Control" type="Control" parent="UI"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="BoostText" type="Label" parent="UI/Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 24.0 +text = "BOOST: 100" + +[node name="Distance" type="Label" parent="UI/Control"] +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_top = -12.0 +offset_right = 136.0 +offset_bottom = 12.0 +grow_vertical = 2 +text = "DIST: 2048" + +[node name="Shader" type="ColorRect" parent="UI"] +material = SubResource("ShaderMaterial_gysiw") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(1, 1, 1, 0) diff --git a/scenes/loading.tscn b/scenes/loading.tscn new file mode 100644 index 0000000..c3ecbdd --- /dev/null +++ b/scenes/loading.tscn @@ -0,0 +1,100 @@ +[gd_scene load_steps=7 format=3 uid="uid://c1imokv4f3shm"] + +[ext_resource type="Shader" uid="uid://bk7q00br1ms30" path="res://scripts/retro.gdshader" id="1_ir5ef"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yc7uc"] +bg_color = Color(0, 0, 0, 1) +border_width_left = 8 +border_width_top = 8 +border_width_right = 8 +border_width_bottom = 8 +border_color = Color(1, 1, 1, 1) +corner_detail = 1 + +[sub_resource type="LabelSettings" id="LabelSettings_dhqfv"] +font_size = 64 + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ir5ef"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dhqfv"] +bg_color = Color(1, 1, 1, 1) +corner_detail = 1 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_101rs"] +shader = ExtResource("1_ir5ef") +shader_parameter/shake = 0.002000000095 +shader_parameter/noiseQuality = 250.0 +shader_parameter/noiseIntensity = 0.0010000000475 +shader_parameter/offsetIntensity = 0.0045 +shader_parameter/colorOffsetIntensity = 0.10000000149012 +shader_parameter/pixelSize = 1024.0 +shader_parameter/grainIntensity = 0.04 +shader_parameter/use_overlay = true +shader_parameter/use_lens_distortion = true +shader_parameter/overlay_color = Color(1, 1, 1, 10) +shader_parameter/lens_distortion_strength = 0.0 + +[node name="Loading" type="Node2D"] + +[node name="UI" type="CanvasLayer" parent="."] + +[node name="Control" type="Control" parent="UI"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Panel" type="Panel" parent="UI/Control"] +custom_minimum_size = Vector2(640, 240) +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -20.0 +offset_right = 20.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_yc7uc") + +[node name="Label" type="Label" parent="UI/Control/Panel"] +custom_minimum_size = Vector2(0, 128) +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 24.0 +grow_horizontal = 2 +text = "LOAD" +label_settings = SubResource("LabelSettings_dhqfv") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ProgressBar" type="ProgressBar" parent="UI/Control/Panel"] +layout_mode = 1 +anchors_preset = -1 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 32.0 +offset_top = 128.0 +offset_right = -32.0 +offset_bottom = -32.0 +grow_horizontal = 2 +grow_vertical = 0 +theme_override_styles/background = SubResource("StyleBoxEmpty_ir5ef") +theme_override_styles/fill = SubResource("StyleBoxFlat_dhqfv") +value = 50.0 +show_percentage = false + +[node name="Shader" type="ColorRect" parent="UI"] +material = SubResource("ShaderMaterial_101rs") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(1, 1, 1, 0) diff --git a/scripts/enterable.gd b/scripts/enterable.gd new file mode 100644 index 0000000..99f2b41 --- /dev/null +++ b/scripts/enterable.gd @@ -0,0 +1,7 @@ +extends Sprite2D + +var game = get_parent() + +func _on_enter_hitbox_area_entered(area: Area2D) -> void: + if area.get_name() == "Player": + game.enter_physical(get_name()) diff --git a/scripts/enterable.gd.uid b/scripts/enterable.gd.uid new file mode 100644 index 0000000..238acf1 --- /dev/null +++ b/scripts/enterable.gd.uid @@ -0,0 +1 @@ +uid://d0txwo63hlrsy diff --git a/scripts/game.gd b/scripts/game.gd index c6fb248..b5dd42d 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -15,6 +15,8 @@ func chunk_to_world(position: Vector2) -> Vector2: return Vector2(floori(position.x * 1024), floori(position.y * 1024)) func _process(delta: float) -> void: + $Navring.position = $Player.position + $UI/Control/BoostText.text = "BOOST: " + str($Player.boost) $UI/Control/Distance.text = "DIST: " + str(floori($Player.position.length())) diff --git a/scripts/global.gd b/scripts/global.gd index 0d831ba..614d3c3 100644 --- a/scripts/global.gd +++ b/scripts/global.gd @@ -1,6 +1,11 @@ extends Node var orbit_zones = [ + { + "name": "The Star", + "distance": 2048 * 1.5, + "spawns": [] + }, { "name": "Test Zone", "distance": 0, @@ -13,9 +18,5 @@ var orbit_zones = [ } ] }, - { - "name": "Test Zone 2", - "distance": 2048 * 1.5, - "spawns": [] - } + ] diff --git a/scripts/player.gd b/scripts/player.gd index ebdd5a4..bbd0baa 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -83,7 +83,13 @@ func _physics_process(delta: float) -> void: func _on_hitbox_body_shape_entered(body_rid: RID, body: Node2D, body_shape_index: int, local_shape_index: int) -> void: - if body.linear_velocity.length() + linear_velocity.length() > 256: + var hit_velocity = linear_velocity.length() + if "linear_velocity" in body: + hit_velocity = body.linear_velocity.length() + linear_velocity.length() + + print(hit_velocity) + + if hit_velocity > 256: camera_shake_power = 4 $Collision.play() diff --git a/scripts/player_ground.gd b/scripts/player_ground.gd new file mode 100644 index 0000000..5e3618c --- /dev/null +++ b/scripts/player_ground.gd @@ -0,0 +1,9 @@ +extends CharacterBody2D + +func _process(delta: float) -> void: + var horizontial_movement = Input.get_axis("ground_left", "ground_right") + var vertical_movement = Input.get_axis("ground_up", "ground_down") + + velocity = Vector2(256 * horizontial_movement, 256 * vertical_movement) + + move_and_slide() diff --git a/scripts/player_ground.gd.uid b/scripts/player_ground.gd.uid new file mode 100644 index 0000000..760d72a --- /dev/null +++ b/scripts/player_ground.gd.uid @@ -0,0 +1 @@ +uid://dowu512otgyyf diff --git a/scripts/retro.gdshader b/scripts/retro.gdshader new file mode 100644 index 0000000..ac1eddd --- /dev/null +++ b/scripts/retro.gdshader @@ -0,0 +1,93 @@ +shader_type canvas_item; + +uniform float shake: hint_range(0, 10) = 0.015; +uniform float noiseQuality: hint_range(0.1, 250, 0.1) = 250; +uniform float noiseIntensity: hint_range(0, 0.05, 0.001) = 0.001; +uniform float offsetIntensity: hint_range(0, 0.05, 0.0001) = 0.0045; +uniform float colorOffsetIntensity: hint_range(0.1, 1.5, 0.001) = 0.2; +uniform float pixelSize: hint_range(1, 1024) = 200.0; +uniform float grainIntensity: hint_range(0, 1) = 0.04; // Intensity of film grain + +uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest; +uniform sampler2D overlay_texture : hint_default_transparent; +uniform bool use_overlay = true; // Toggle for using overlay texture +uniform bool use_lens_distortion = true; // Toggle for using lens distortion + +uniform vec4 overlay_color : source_color = vec4(1.0, 1.0, 1.0, 10.0); // Allow changing overlay color +uniform float lens_distortion_strength: hint_range(0, 0.1) = 0.05; // Strength of lens distortion effect + +varying vec2 previous_pos; // Previous fragment position + +float rand(vec2 co) +{ + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +float verticalBar(float pos, float uvY, float offset) +{ + float edge0 = (pos - shake); + float edge1 = (pos + shake); + + float x = smoothstep(edge0, pos, uvY) * offset; + x -= smoothstep(pos, edge1, uvY) * offset; + return x; +} + +void fragment() { + vec2 iResolution = 1.0 / SCREEN_PIXEL_SIZE; + vec2 uv = FRAGCOORD.xy / iResolution.xy; + + // Calculate velocity + vec2 velocity = uv - previous_pos; + + // Apply pixelation effect + uv = floor(uv * pixelSize) / pixelSize; + + // Add vertical bars distortion + for (float i = 0.0; i < 0.71; i += 0.1313) + { + float d = mod(TIME * i, 1.7); + float o = sin(1.0 - tan(TIME * 0.24 * i)); + o *= offsetIntensity; + uv.x += verticalBar(d, uv.y, o); + } + + // Add noise distortion + float uvY = uv.y * noiseQuality; + uvY = float(int(uvY)) * (1.0 / noiseQuality); + float noise = rand(vec2(TIME * 0.00001, uvY)); + uv.x += noise * noiseIntensity; + + // Add color offset distortion + vec2 offsetR = vec2(0.006 * sin(TIME), 0.0) * colorOffsetIntensity; + vec2 offsetG = vec2(0.0073 * cos(TIME * 0.97), 0.0) * colorOffsetIntensity; + + float r = texture(screen_texture, uv + offsetR).r; + float g = texture(screen_texture, uv + offsetG).g; + float b = texture(screen_texture, uv).b; + + vec4 tex = vec4(r, g, b, 1.0); + + // Overlay with an optional texture + if (use_overlay) { + vec4 overlayColor = texture(overlay_texture, uv) * overlay_color; // Apply overlay color + tex = mix(tex, overlayColor, overlayColor.a); + } + + // Add film grain + float grain = rand(uv) * 2.0 - 1.0; // Range from -1 to 1 + tex.rgb += grainIntensity * grain; + + // Apply lens distortion + if (use_lens_distortion) { + vec2 distortion = uv * lens_distortion_strength * (uv - 1.0); + vec4 distorted_tex = texture(screen_texture, uv + distortion); + tex = mix(tex, distorted_tex, 0.5); + } + + // Apply final color + COLOR = tex; + + // Store current position for next frame + previous_pos = FRAGCOORD.xy / iResolution.xy; +} diff --git a/scripts/retro.gdshader.uid b/scripts/retro.gdshader.uid new file mode 100644 index 0000000..3e30bfa --- /dev/null +++ b/scripts/retro.gdshader.uid @@ -0,0 +1 @@ +uid://bk7q00br1ms30 diff --git a/textures/blank.png b/textures/blank.png new file mode 100644 index 0000000000000000000000000000000000000000..a1e4190467d20f0307df85a35b3c714d5930e696 GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}VV*9IArY;~ zd*b%Kwr3W}*tW~i=mMj{?UOCuO>)zcEfNkK`1&gL|I3HJ8#m>P^fUz;aJe1SkYHV$ z0Oqh9a47SUxTw3Vl)d!ASKdGwhyHh#yJQ(yr1UDMZCZN(Xaj?%tDnm{r-UW|n}s!_ literal 0 HcmV?d00001 diff --git a/textures/blank.png.import b/textures/blank.png.import new file mode 100644 index 0000000..64682ee --- /dev/null +++ b/textures/blank.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hgfmjw6gbdnn" +path="res://.godot/imported/blank.png-c01b3bfe55bc48d9dbcbf1f585c4ade9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/blank.png" +dest_files=["res://.godot/imported/blank.png-c01b3bfe55bc48d9dbcbf1f585c4ade9.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 diff --git a/textures/navigation_ring.png b/textures/navigation_ring.png new file mode 100644 index 0000000000000000000000000000000000000000..984685117a58379fd529c81d84b81f4d6844b6e9 GIT binary patch literal 2243 zcmbVOdpML^7vE!=Fw%HBRO84fMY&amL1SDRHAUnSnotQ-qR2>vX+{TAPB(QN}B$Y~^eq=6BPfwSBWO7S`X~vbv%gKnuU-@W* z$j)2FsvpXB+7_*u$zBz=KDcHx3E8LbjeXZ-wFj5)&dQ1p`1;W+arcD?GgV=&vur-w zt!H%!fssV>YT|A%BUVRU%Dncaoc(cYY%cW|i8mlZ_M0)fc?=9@n zer@F~aulT|kjjV1?mhdu^4}6)lUfUvz0XaLPk;@b9|!X2C=0@o%C(%D#uK8*hvf9-(T_6v$|CLhF!4ssl9+&iimrt@{AY7D?#e2kG3#=_q z*k#o(gi8l1uSc- zwn~5eK>z{ZdVsTw#Nd?`=Y5{KeRAS|@E(l?cX!op(c_#BMd5R5= zl$)AiR~NtLH2^+JrE#icagKr31*e$RmYFg22XHec>|(>|_zo zRO{@B=B)byFZ5Ha(smBCA9gXk1(`#qqsyz%$K zlxQMskf$vqeIw(P__wiH&Ycq=bdlZD8!*?dSp6C1c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(Wr3(&iRmnq40W< literal 0 HcmV?d00001 diff --git a/textures/wall_tile.png.import b/textures/wall_tile.png.import new file mode 100644 index 0000000..4201d7d --- /dev/null +++ b/textures/wall_tile.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://btcap3oh2dqt8" +path="res://.godot/imported/wall_tile.png-09b14932d3c2b71c0c48b8e730ea62df.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/wall_tile.png" +dest_files=["res://.godot/imported/wall_tile.png-09b14932d3c2b71c0c48b8e730ea62df.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