mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:25:35 +00:00
FPS counter
This commit is contained in:
parent
a9abec3573
commit
d25696425b
6 changed files with 48 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=24 format=3 uid="uid://dkwi1hu1bixoe"]
|
||||
[gd_scene load_steps=25 format=3 uid="uid://dkwi1hu1bixoe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://baf6pxbvhqmjk" path="res://Scripts/Hud.cs" id="1_m0hb0"]
|
||||
[ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="2_0xmx2"]
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
[ext_resource type="StyleBox" uid="uid://ctw2hju32l3rg" path="res://Resources/Styles/PixelStyleBoxRed.tres" id="10_f3h51"]
|
||||
[ext_resource type="Script" uid="uid://bobo5f4ud60qw" path="res://Scripts/UI/ItemsMenu.cs" id="10_oflr6"]
|
||||
[ext_resource type="Script" uid="uid://com5b4ffsmj7s" path="res://Scripts/UI/InventoryMenu.cs" id="11_7pulb"]
|
||||
[ext_resource type="Script" uid="uid://cwd3sksjqpuy3" path="res://Scripts/Utils/FpsCounterLabel.cs" id="15_x61tu"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_a7f6n"]
|
||||
font = ExtResource("2_0xmx2")
|
||||
|
|
@ -260,3 +261,16 @@ layout_mode = 2
|
|||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
text = "Status"
|
||||
|
||||
[node name="FPS" type="Label" parent="."]
|
||||
z_index = 10
|
||||
z_as_relative = false
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -40.0
|
||||
offset_bottom = 23.0
|
||||
grow_horizontal = 0
|
||||
text = "1234"
|
||||
label_settings = ExtResource("2_x7kl7")
|
||||
script = ExtResource("15_x61tu")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=44 format=4 uid="uid://6a6tjohypmmb"]
|
||||
[gd_scene load_steps=45 format=4 uid="uid://6a6tjohypmmb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://doxmbokehw8ci" path="res://Scripts/GameManager.cs" id="1_t2k72"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4pr2707hbeph" path="res://Scenes/Actors/fsm_player.tscn" id="2_2jsgm"]
|
||||
|
|
@ -16,6 +16,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://dkwi1hu1bixoe" path="res://Scenes/HUD/HUD.tscn" id="9_mnq21"]
|
||||
[ext_resource type="Script" uid="uid://bdshph801ac2i" path="res://Scenes/CameraTarget.gd" id="10_4nd4a"]
|
||||
[ext_resource type="Script" uid="uid://cnkipcolyj61w" path="res://Scripts/AlarmManager.cs" id="11_7an4p"]
|
||||
[ext_resource type="Script" uid="uid://b5fesrd4lv8t1" path="res://Scripts/Resources/Events/EventResource.cs" id="14_hvfip"]
|
||||
[ext_resource type="Script" uid="uid://bwox5lmgiijcs" path="res://Scripts/Resources/Events/ActivateEvent.cs" id="14_s23f3"]
|
||||
[ext_resource type="PackedScene" uid="uid://oi8svqsspcsj" path="res://Scenes/Interactable/ScriptableMovementSensor.tscn" id="16_ehuec"]
|
||||
[ext_resource type="PackedScene" uid="uid://crph24e6e0v0q" path="res://Scenes/Interactable/Control_Pad.tscn" id="16_s23f3"]
|
||||
|
|
@ -123,7 +124,7 @@ position = Vector2(196, 296)
|
|||
|
||||
[node name="MotionSensor" parent="Tilemaps/Actors" instance=ExtResource("16_ehuec")]
|
||||
position = Vector2(254, 296)
|
||||
Events = [SubResource("Resource_s23f3")]
|
||||
Events = Array[ExtResource("14_hvfip")]([SubResource("Resource_s23f3")])
|
||||
|
||||
[node name="ControlPad" parent="Tilemaps/Actors" node_paths=PackedStringArray("Targets") instance=ExtResource("16_s23f3")]
|
||||
position = Vector2(205, 292)
|
||||
|
|
@ -144,11 +145,11 @@ position = Vector2(504, 468)
|
|||
|
||||
[node name="MovementSensorLonger" parent="Tilemaps/Actors" instance=ExtResource("20_fdi4d")]
|
||||
position = Vector2(226, 486)
|
||||
Events = [SubResource("Resource_qi6uc")]
|
||||
Events = Array[ExtResource("14_hvfip")]([SubResource("Resource_qi6uc")])
|
||||
|
||||
[node name="MovementSensorLonger2" parent="Tilemaps/Actors" instance=ExtResource("20_fdi4d")]
|
||||
position = Vector2(391, 455)
|
||||
Events = [SubResource("Resource_mq37i")]
|
||||
Events = Array[ExtResource("14_hvfip")]([SubResource("Resource_mq37i")])
|
||||
|
||||
[node name="WallEmitter" parent="Tilemaps/Actors" instance=ExtResource("21_qi6uc")]
|
||||
position = Vector2(264, 482)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=123 format=4 uid="uid://bv451a8wgty4u"]
|
||||
[gd_scene load_steps=124 format=4 uid="uid://bv451a8wgty4u"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://doxmbokehw8ci" path="res://Scripts/GameManager.cs" id="1_8tmoj"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4pr2707hbeph" path="res://Scenes/Actors/fsm_player.tscn" id="2_ksslq"]
|
||||
|
|
@ -60,6 +60,7 @@
|
|||
[ext_resource type="Script" uid="uid://d0a0o50j82eo6" path="res://Scripts/Activables/ScriptableBase.cs" id="42_wigyb"]
|
||||
[ext_resource type="PackedScene" uid="uid://fxvlaidieiv7" path="res://Scenes/Interactable/ScriptableAreaTrigger.tscn" id="43_kf3qc"]
|
||||
[ext_resource type="Script" uid="uid://dkihoo85jfec5" path="res://Scripts/Resources/Events/MovePlayerEvent.cs" id="44_klwgh"]
|
||||
[ext_resource type="Script" uid="uid://b5fesrd4lv8t1" path="res://Scripts/Resources/Events/EventResource.cs" id="44_mah4x"]
|
||||
[ext_resource type="PackedScene" uid="uid://dx1urm7nttkqk" path="res://Scenes/Actors/level_teleporter.tscn" id="44_q5xi2"]
|
||||
[ext_resource type="PackedScene" uid="uid://b0k2grrc8xp1l" path="res://Scenes/Props/BigTank.tscn" id="45_5qg27"]
|
||||
[ext_resource type="Script" uid="uid://bwox5lmgiijcs" path="res://Scripts/Resources/Events/ActivateEvent.cs" id="45_emjoj"]
|
||||
|
|
@ -201,7 +202,7 @@ ActivationType = 0
|
|||
Targets = Array[NodePath]([NodePath("../Rumia")])
|
||||
WaitForCompletion = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qnbhd"]
|
||||
[sub_resource type="Resource" id="Resource_mah4x"]
|
||||
resource_local_to_scene = true
|
||||
script = ExtResource("49_0si7g")
|
||||
Target = NodePath(".")
|
||||
|
|
@ -547,7 +548,7 @@ Invisible = true
|
|||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="ScriptableAreaTrigger" parent="Parallax2D/Factory Tilemaps/LevelProps/DebugTeleporter" instance=ExtResource("43_kf3qc")]
|
||||
Events = [SubResource("Resource_usuub")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_usuub")])
|
||||
|
||||
[node name="BlueKeycard2" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("35_rblsn")]
|
||||
position = Vector2(-1032, -317)
|
||||
|
|
@ -723,7 +724,7 @@ position = Vector2(-1506, -188)
|
|||
[node name="LevelStartTrigger" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("43_kf3qc")]
|
||||
position = Vector2(-781, -160)
|
||||
scale = Vector2(1.455, 1.455)
|
||||
Events = [SubResource("Resource_5er5x"), SubResource("Resource_b25hy")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_5er5x"), SubResource("Resource_b25hy")])
|
||||
|
||||
[node name="AreaTrigger2" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Target") instance=ExtResource("28_6au4t")]
|
||||
position = Vector2(-435, -162)
|
||||
|
|
@ -765,7 +766,7 @@ Targets = [NodePath("Script2")]
|
|||
[node name="Script2" type="Node2D" parent="Parallax2D/Factory Tilemaps/LevelProps/Computer2"]
|
||||
position = Vector2(120, 25)
|
||||
script = ExtResource("42_wigyb")
|
||||
Events = [SubResource("Resource_ji7au")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_ji7au")])
|
||||
|
||||
[node name="Computer5" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Targets") instance=ExtResource("31_243ec")]
|
||||
position = Vector2(-1344, -251)
|
||||
|
|
@ -773,7 +774,7 @@ Targets = [NodePath("Computer5Script")]
|
|||
|
||||
[node name="Computer5Script" type="Node2D" parent="Parallax2D/Factory Tilemaps/LevelProps/Computer5"]
|
||||
script = ExtResource("42_wigyb")
|
||||
Events = [SubResource("Resource_fasrq"), SubResource("Resource_yot54")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_fasrq"), SubResource("Resource_yot54")])
|
||||
|
||||
[node name="Computer3" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Target") instance=ExtResource("31_243ec")]
|
||||
position = Vector2(-612.57, -358.528)
|
||||
|
|
@ -781,7 +782,7 @@ Target = NodePath("Script")
|
|||
|
||||
[node name="Script" type="Node2D" parent="Parallax2D/Factory Tilemaps/LevelProps/Computer3"]
|
||||
script = ExtResource("42_wigyb")
|
||||
Events = [SubResource("Resource_o2kpk")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_o2kpk")])
|
||||
|
||||
[node name="Computer4" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Target") instance=ExtResource("31_243ec")]
|
||||
position = Vector2(-791, -505)
|
||||
|
|
@ -789,7 +790,7 @@ Target = NodePath("Node2D")
|
|||
|
||||
[node name="Node2D" type="Node2D" parent="Parallax2D/Factory Tilemaps/LevelProps/Computer4"]
|
||||
script = ExtResource("42_wigyb")
|
||||
Events = [SubResource("Resource_s3g2w")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_s3g2w")])
|
||||
|
||||
[node name="Label" type="Label" parent="Parallax2D/Factory Tilemaps/LevelProps/Computer4"]
|
||||
offset_left = -5.0
|
||||
|
|
@ -817,11 +818,11 @@ position = Vector2(-792, -407)
|
|||
[node name="BossBattleEndScript" type="Node2D" parent="Parallax2D/Factory Tilemaps/LevelProps"]
|
||||
position = Vector2(-1628.53, -477.628)
|
||||
script = ExtResource("42_wigyb")
|
||||
Events = [SubResource("Resource_068l7"), SubResource("Resource_l3nop")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_068l7"), SubResource("Resource_l3nop")])
|
||||
|
||||
[node name="BossBattleStartScript" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("43_kf3qc")]
|
||||
position = Vector2(-1487, -396)
|
||||
Events = [SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_qnbhd")]
|
||||
Events = Array[ExtResource("44_mah4x")]([SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_mah4x")])
|
||||
|
||||
[node name="Enemy13" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("47_u1ve6")]
|
||||
position = Vector2(-1657, -788)
|
||||
|
|
@ -1018,7 +1019,7 @@ position = Vector2(-2000, -736)
|
|||
[node name="ControlPad8" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Targets") instance=ExtResource("12_hfkf1")]
|
||||
position = Vector2(-2027, -735)
|
||||
Targets = [NodePath("../HorizontalForceField")]
|
||||
Requirements = [ExtResource("84_ma1ta")]
|
||||
Requirements = Array[ExtResource("6_8tdlb")]([ExtResource("84_ma1ta")])
|
||||
|
||||
[node name="Ammo6" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("34_17pjh")]
|
||||
position = Vector2(-872, -220)
|
||||
|
|
|
|||
|
|
@ -93,11 +93,10 @@ public partial class Bullet : Area2D
|
|||
|
||||
public virtual void RotateBullet(float degrees)
|
||||
{
|
||||
SetRotationDegrees(RotationDegrees + degrees);
|
||||
// float radians = Mathf.DegToRad(degrees);
|
||||
// _direction = _direction.Rotated(radians).Normalized(); // Rotate direction
|
||||
// SetRotation(Rotation + radians);
|
||||
//Rotation = radians;
|
||||
//SetRotationDegrees(RotationDegrees + degrees);
|
||||
float radians = Mathf.DegToRad(degrees);
|
||||
_direction = _direction.Rotated(radians).Normalized(); // Rotate direction
|
||||
SetRotation(Rotation + radians);
|
||||
}
|
||||
|
||||
public virtual void RotateSpriteDegrees(float degrees)
|
||||
|
|
|
|||
11
Scripts/Utils/FpsCounterLabel.cs
Normal file
11
Scripts/Utils/FpsCounterLabel.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Utils;
|
||||
|
||||
public partial class FpsCounterLabel : Label
|
||||
{
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
this.Text = Engine.GetFramesPerSecond().ToString();
|
||||
}
|
||||
}
|
||||
1
Scripts/Utils/FpsCounterLabel.cs.uid
Normal file
1
Scripts/Utils/FpsCounterLabel.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cwd3sksjqpuy3
|
||||
Loading…
Add table
Add a link
Reference in a new issue