diff --git a/game/Main.tscn b/game/Cursor.tscn similarity index 86% rename from game/Main.tscn rename to game/Cursor.tscn index 41fe789..42c24b0 100644 --- a/game/Main.tscn +++ b/game/Cursor.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=3 format=3 uid="uid://cdeww5uc20038"] +[gd_scene load_steps=3 format=3 uid="uid://c42ny2e8vbhhc"] [ext_resource type="Script" uid="uid://ccydu80643k4s" path="res://Scripts/CursorScript.gd" id="1_uu6xs"] [ext_resource type="Texture2D" uid="uid://d0hckoql2xnbq" path="res://Textures/svg/Cursor.svg" id="2_r0du0"] diff --git a/game/Scripts/CursorScript.gd b/game/Scripts/CursorScript.gd index 4bf7013..448678e 100644 --- a/game/Scripts/CursorScript.gd +++ b/game/Scripts/CursorScript.gd @@ -20,7 +20,8 @@ func _process(delta: float) -> void: mouse_velocity = current_mouse_pos - old_mouse_pos if mouse_velocity.length_squared()>0.1: - rotation = mouse_velocity.angle() + rotation = lerp_angle(rotation, mouse_velocity.angle(), 80 * delta) + var direction_to_mouse = (current_mouse_pos - global_position).normalized() global_position = current_mouse_pos diff --git a/game/project.godot b/game/project.godot index 244e274..29c8ce3 100644 --- a/game/project.godot +++ b/game/project.godot @@ -11,5 +11,12 @@ config_version=5 [application] config/name="2D-Beatsaber-ig" +run/main_scene="uid://dc02h0h7ooucv" config/features=PackedStringArray("4.4", "Forward Plus") config/icon="res://icon.svg" + +[display] + +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" +window/vsync/vsync_mode=0 diff --git a/game/testGround.tscn b/game/testGround.tscn new file mode 100644 index 0000000..db8dd76 --- /dev/null +++ b/game/testGround.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=3 format=3 uid="uid://dc02h0h7ooucv"] + +[ext_resource type="Script" uid="uid://hfccs84dimkv" path="res://test_ground.gd" id="1_85h15"] +[ext_resource type="PackedScene" uid="uid://c42ny2e8vbhhc" path="res://Cursor.tscn" id="1_rkps0"] + +[node name="Screen" type="CanvasLayer"] +script = ExtResource("1_85h15") + +[node name="Cursor" parent="." instance=ExtResource("1_rkps0")] +position = Vector2(263, 291) + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -131.0 +offset_right = 134.0 +grow_vertical = 0 +size_flags_vertical = 8 +metadata/_edit_use_anchors_ = true + +[node name="Label" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "Info?" + +[node name="Fps" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "FPS : " + +[node name="Frametime" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "FrameTimeMCS :" + +[node name="PT" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "Procces Time: " + +[node name="VideoMemory" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "Video Mem:" diff --git a/game/test_ground.gd b/game/test_ground.gd new file mode 100644 index 0000000..118e6b3 --- /dev/null +++ b/game/test_ground.gd @@ -0,0 +1,15 @@ +extends CanvasLayer + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + $VBoxContainer/Fps.text = "FPS: " + str(Performance.get_monitor(Performance.TIME_FPS)) + $VBoxContainer/Frametime.text = "FrameTime: " + str(Engine.get_physics_interpolation_fraction()) + $VBoxContainer/PT.text = "Process time: "+ str(Performance.get_monitor(Performance.TIME_PROCESS)) + $VBoxContainer/VideoMemory.text ="Video memory Used: " + str(Performance.get_monitor(Performance.RENDER_VIDEO_MEM_USED)) + pass diff --git a/game/test_ground.gd.uid b/game/test_ground.gd.uid new file mode 100644 index 0000000..a387cda --- /dev/null +++ b/game/test_ground.gd.uid @@ -0,0 +1 @@ +uid://hfccs84dimkv