diff --git a/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll b/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll new file mode 100644 index 0000000..47bbb1d Binary files /dev/null and b/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll differ diff --git a/demo.tscn b/demo.tscn index 9ca824b..13ad5bf 100644 --- a/demo.tscn +++ b/demo.tscn @@ -65,6 +65,7 @@ position_smoothing_enabled = true script = ExtResource("1_1gbyr") [node name="Label" type="Label" parent="Camera2D"] +z_index = 4 offset_left = -477.0 offset_top = -243.0 offset_right = -437.0 diff --git a/main character.gd b/main character.gd index 8284d55..733d593 100644 --- a/main character.gd +++ b/main character.gd @@ -2,7 +2,7 @@ extends CharacterBody2D @onready var global = $"/root/Player" const SPEED = 350.0 - +var charAngle = 0.0 func _physics_process(delta: float) -> void: global.emit_signal("playerPosition",self.global_position) movement() @@ -13,11 +13,10 @@ func animation(): func movement(): var vertical = Input.get_axis("up","down") var horizontal = Input.get_axis("left","right") - var rotVector = Vector2(vertical*-1,horizontal).normalized() - #self.rotation = rotVector.angle() + var rotVector = Vector2(vertical*-1,horizontal) if rotVector != Vector2(0,0): - var rotationTween = get_tree().create_tween() - rotationTween.tween_property(self,"global_rotation",rotVector.angle(),0.1) + self.set_rotation(rotVector.angle()) + #limiting diagonal speed if is_equal_approx(abs(vertical),1.0) and is_equal_approx(abs(horizontal),1.0): velocity.y = SPEED*vertical/2 velocity.x = SPEED*horizontal/2 @@ -25,4 +24,4 @@ func movement(): velocity.y = SPEED * vertical velocity.x = SPEED * horizontal move_and_slide() - $"../Camera2D/Label".text = (str(vertical)+" "+str(horizontal) + "vector:"+str(rotVector)) + $"../Camera2D/Label".text = (str(charAngle*180/PI))