diff --git a/hotline_miami.gd b/hotline_miami.gd new file mode 100644 index 0000000..4fecabf --- /dev/null +++ b/hotline_miami.gd @@ -0,0 +1,26 @@ +extends Node2D + +@export var viewport_x_div: float +@export var viewport_y_div: float +@export var x_offset: float = 0.0 + +var sway_amplitude = 20 +var sway_speed = 1.0 +var tilt_amplitude = 0.1 +var tilt_lerp_speed = 5.0 + +var time := 0.0 +var base_position := Vector2.ZERO + +func _ready(): + var viewport_size = get_viewport_rect().size + base_position = Vector2(viewport_size.x / viewport_x_div + x_offset, viewport_size.y / viewport_y_div) + position = base_position + +func _process(delta): + time += delta + var sway_offset = sin(time * sway_speed) * sway_amplitude + position.x = base_position.x + sway_offset + var sway_velocity = cos(time * sway_speed) * sway_speed + var target_rotation = clamp(sway_velocity * tilt_amplitude, -tilt_amplitude, tilt_amplitude) + rotation = lerp(rotation, target_rotation, delta * tilt_lerp_speed) diff --git a/hotline_miami.gd.uid b/hotline_miami.gd.uid new file mode 100644 index 0000000..c779af7 --- /dev/null +++ b/hotline_miami.gd.uid @@ -0,0 +1 @@ +uid://bmn6cds78753q diff --git a/loss.ogg b/loss.ogg new file mode 100644 index 0000000..89dc3b0 Binary files /dev/null and b/loss.ogg differ diff --git a/loss.ogg.import b/loss.ogg.import new file mode 100644 index 0000000..7ae1390 --- /dev/null +++ b/loss.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://b5r5846lmi31v" +path="res://.godot/imported/loss.ogg-a53eed42c0a67db7c9fc2938cae26881.oggvorbisstr" + +[deps] + +source_file="res://loss.ogg" +dest_files=["res://.godot/imported/loss.ogg-a53eed42c0a67db7c9fc2938cae26881.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/score_screen.gd b/score_screen.gd new file mode 100644 index 0000000..cc5449e --- /dev/null +++ b/score_screen.gd @@ -0,0 +1,16 @@ +extends Node2D + +func _ready() -> void: + win() + +func win(): + $MorshoReactManager/MorshoHappy.visible = true + $MorshoReactManager/MorshoAngry.visible = false + %WinLossAudioPlayer.stream = load("res://win.ogg") + %WinLossAudioPlayer.play() + +func lose(): + $MorshoReactManager/MorshoAngry.visible = true + $MorshoReactManager/MorshoHappy.visible = false + %WinLossAudioPlayer.stream = load("res://loss.ogg") + %WinLossAudioPlayer.play() diff --git a/score_screen.gd.uid b/score_screen.gd.uid new file mode 100644 index 0000000..9f60175 --- /dev/null +++ b/score_screen.gd.uid @@ -0,0 +1 @@ +uid://cp71ivjeuuaaf diff --git a/score_screen.tscn b/score_screen.tscn index 339ba4e..4014fdf 100644 --- a/score_screen.tscn +++ b/score_screen.tscn @@ -1,10 +1,13 @@ -[gd_scene load_steps=4 format=3 uid="uid://bcnpjrwddi5h8"] +[gd_scene load_steps=6 format=3 uid="uid://bcnpjrwddi5h8"] [ext_resource type="Theme" uid="uid://d2rlcffg7nguy" path="res://menus.tres" id="1_3r2db"] +[ext_resource type="Script" uid="uid://cp71ivjeuuaaf" path="res://score_screen.gd" id="1_cyy7t"] [ext_resource type="Texture2D" uid="uid://cabsfveh1oc6i" path="res://assets/menus/final score/morshu-happy-large.png" id="1_juxjb"] [ext_resource type="Texture2D" uid="uid://d24dlalqmr6r0" path="res://assets/menus/final score/morshu-anger-large.png" id="2_3r2db"] +[ext_resource type="Script" uid="uid://bmn6cds78753q" path="res://hotline_miami.gd" id="4_joumd"] [node name="Node2D" type="Node2D"] +script = ExtResource("1_cyy7t") [node name="Control" type="Control" parent="."] layout_mode = 3 @@ -37,9 +40,12 @@ horizontal_alignment = 1 vertical_alignment = 1 [node name="MorshoReactManager" type="Node2D" parent="."] +texture_filter = 1 position = Vector2(870, 360) -rotation = 0.20420352 scale = Vector2(2.5, 2.5) +script = ExtResource("4_joumd") +viewport_x_div = 1.5 +viewport_y_div = 2.0 [node name="MorshoHappy" type="Sprite2D" parent="MorshoReactManager"] texture = ExtResource("1_juxjb") @@ -47,3 +53,6 @@ texture = ExtResource("1_juxjb") [node name="MorshoAngry" type="Sprite2D" parent="MorshoReactManager"] visible = false texture = ExtResource("2_3r2db") + +[node name="WinLossAudioPlayer" type="AudioStreamPlayer" parent="."] +unique_name_in_owner = true diff --git a/win.ogg b/win.ogg new file mode 100644 index 0000000..9c131e4 Binary files /dev/null and b/win.ogg differ diff --git a/win.ogg.import b/win.ogg.import new file mode 100644 index 0000000..5f8ae3a --- /dev/null +++ b/win.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://2g0mcrbwnkfc" +path="res://.godot/imported/win.ogg-925680d4a92658a999b17dd5ae4db057.oggvorbisstr" + +[deps] + +source_file="res://win.ogg" +dest_files=["res://.godot/imported/win.ogg-925680d4a92658a999b17dd5ae4db057.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4