diff --git a/player_2d.gd b/player_2d.gd index c8ea6cd..4ea945c 100644 --- a/player_2d.gd +++ b/player_2d.gd @@ -44,6 +44,9 @@ func on_death(): position = %LevelStart.position func _process(delta: float) -> void: + if Input.is_action_just_released("restart") or (Input.is_action_pressed("controller_restart_left") and Input.is_action_pressed("controller_restart_right")): + get_tree().reload_current_scene() + if Input.is_action_just_pressed("jump"): if is_on_floor(): velocity.y = JUMP_VELOCITY diff --git a/player_2d.tscn b/player_2d.tscn index 6068900..c2c9520 100644 --- a/player_2d.tscn +++ b/player_2d.tscn @@ -108,7 +108,7 @@ position = Vector2(0, 2) sprite_frames = SubResource("SpriteFrames_fvyjh") animation = &"running" autoplay = "idle" -frame_progress = 0.87170494 +frame_progress = 0.94250125 [node name="HatSprite" type="AnimatedSprite2D" parent="Sprite2D" unique_id=1954184475] visible = false @@ -117,7 +117,7 @@ scale = Vector2(0.9, 0.9) sprite_frames = SubResource("SpriteFrames_pmt5n") animation = &"running" autoplay = "idle" -frame_progress = 0.1718222 +frame_progress = 0.7082195 [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1294571021] shape = SubResource("RectangleShape2D_fj7yv") diff --git a/project.godot b/project.godot index 523d414..1b40883 100644 --- a/project.godot +++ b/project.godot @@ -229,6 +229,51 @@ dash_up={ "script": null )] } +restart={ +"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": 82, +"key_label": 0, +"unicode": 114, +"location": 0, +"echo": false, +"script": null +)] +} +controller_restart_left={ +"deadzone": 0.0, +"events": [Object(InputEventJoypadButton, +"resource_local_to_scene": false, +"resource_name": "", +"device": -1, +"button_index": 7, +"pressure": 0.0, +"pressed": true, +"script": null +)] +} +controller_restart_right={ +"deadzone": 0.0, +"events": [Object(InputEventJoypadButton, +"resource_local_to_scene": false, +"resource_name": "", +"device": -1, +"button_index": 8, +"pressure": 0.0, +"pressed": true, +"script": null +)] +} [input_devices] diff --git a/shaders/warp_shader.gdshader b/shaders/warp_shader.gdshader index 46cb8b2..b87ae92 100644 --- a/shaders/warp_shader.gdshader +++ b/shaders/warp_shader.gdshader @@ -5,6 +5,7 @@ shader_type canvas_item; render_mode unshaded, skip_vertex_transform; const float curvature = 3.2; +const float vignette_multiplier = 0.6; uniform sampler2D screen_texture: hint_screen_texture; @@ -13,8 +14,12 @@ void fragment() { vec2 uv_offset = centered_uv.yx / curvature; vec2 warped_uv = centered_uv + centered_uv * uv_offset * uv_offset; vec3 cutoff = vec3(step(abs(warped_uv.x), 1.0) * step(abs(warped_uv.y), 1.0)); + vec3 scanlines = vec3(sin(1.5 * warped_uv.y * 720.0) * 0.25 + 0.75); + vec3 vignette = vec3(length(pow(abs(centered_uv), vec2(4.0)) / 3.0)); + + vec3 screen_color = texture(screen_texture, (warped_uv + 1.0) / 2.0).rgb * (scanlines * 1.3); + screen_color -= vignette * vignette_multiplier; - vec3 screen_color = texture(screen_texture, (warped_uv + 1.0) / 2.0).rgb; //COLOR = vec4(warped_uv, 0.0, 1.0); - COLOR = texture(screen_texture, (warped_uv + 1.0) / 2.0); + COLOR = vec4(screen_color, 1.0); } diff --git a/world.tscn b/world.tscn index 095017f..7ec22ae 100644 --- a/world.tscn +++ b/world.tscn @@ -18,7 +18,7 @@ scale = Vector2(1, 1.0155824) [node name="Player2D" parent="." unique_id=889851478 instance=ExtResource("1_aqk2v")] unique_name_in_owner = true -position = Vector2(55, 59) +position = Vector2(55, 102.324905) [node name="Tutorial" type="Node2D" parent="." unique_id=1391494772]