diff --git a/art/player.png b/art/player.png index d52eec3..c7b90a9 100644 Binary files a/art/player.png and b/art/player.png differ diff --git a/art/player.png.import b/art/player.png.import index 5638f03..b4d3005 100644 --- a/art/player.png.import +++ b/art/player.png.import @@ -40,4 +40,4 @@ 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 +detect_3d/compress_to=0 diff --git a/fps_label.gd b/fps_label.gd new file mode 100644 index 0000000..325be86 --- /dev/null +++ b/fps_label.gd @@ -0,0 +1,9 @@ +extends RichTextLabel + +# 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: + text = "FPS: " + str(Engine.get_frames_per_second()) diff --git a/fps_label.gd.uid b/fps_label.gd.uid new file mode 100644 index 0000000..754bf31 --- /dev/null +++ b/fps_label.gd.uid @@ -0,0 +1 @@ +uid://bds4m5we8nwe3 diff --git a/player_2d.gd b/player_2d.gd index 3d1ab35..ee1d48b 100644 --- a/player_2d.gd +++ b/player_2d.gd @@ -27,6 +27,11 @@ func _process(delta: float) -> void: #velocity.x = 0 var direction = Input.get_axis("move_left","move_right") + if direction < 0: + $Sprite2D.flip_h = true + elif direction > 0: + $Sprite2D.flip_h = false + if direction: velocity.x = direction * SPEED else: diff --git a/player_2d.tscn b/player_2d.tscn index b5d823a..2766773 100644 --- a/player_2d.tscn +++ b/player_2d.tscn @@ -10,7 +10,7 @@ size = Vector2(16, 16) script = ExtResource("1_sy00s") [node name="Camera2D" type="Camera2D" parent="." unique_id=962368438] -zoom = Vector2(1.2, 1.2) +zoom = Vector2(1.35, 1.35) position_smoothing_enabled = true position_smoothing_speed = 0.5 diff --git a/world.tscn b/world.tscn index c539f84..4a8aa1b 100644 --- a/world.tscn +++ b/world.tscn @@ -3,6 +3,7 @@ [ext_resource type="Script" uid="uid://boovn4st1uq41" path="res://rich_text_label.gd" id="1_036b0"] [ext_resource type="PackedScene" uid="uid://pmnwck5v0ntm" path="res://player_2d.tscn" id="1_aqk2v"] [ext_resource type="PackedScene" uid="uid://ckqable762x8v" path="res://block.tscn" id="2_036b0"] +[ext_resource type="Script" uid="uid://bds4m5we8nwe3" path="res://fps_label.gd" id="2_dwbse"] [ext_resource type="PackedScene" uid="uid://dx4pfup3sbk0f" path="res://long_block.tscn" id="3_dwbse"] [ext_resource type="PackedScene" uid="uid://bos6oh7nwyeca" path="res://vertical_long_block.tscn" id="4_pkg7o"] @@ -12,13 +13,27 @@ process_mode = 3 [node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1982310971] [node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer" unique_id=63102975] -offset_left = 5.0 -offset_right = 130.0 -offset_bottom = 40.0 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 bbcode_enabled = true text = "FALL TIMER:" script = ExtResource("1_036b0") +[node name="RichTextLabel2" type="RichTextLabel" parent="CanvasLayer" unique_id=1423365940] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 22.0 +offset_bottom = 22.0 +grow_horizontal = 2 +grow_vertical = 2 +bbcode_enabled = true +text = "FPS:" +script = ExtResource("2_dwbse") + [node name="Player2D" parent="." unique_id=889851478 instance=ExtResource("1_aqk2v")] unique_name_in_owner = true position = Vector2(55, 59)