diff --git a/Scenes/Pong.tscn b/Scenes/Pong.tscn index d40a0f4..8323a60 100644 --- a/Scenes/Pong.tscn +++ b/Scenes/Pong.tscn @@ -15,5 +15,6 @@ position = Vector2(0, -2) [node name="Ball" parent="." instance=ExtResource("2_u2ksv")] _ballSpeed = 50.0 +_maxRandomAngle = 0.42 [node name="Walls" parent="." instance=ExtResource("3_jfis7")] diff --git a/Scripts/Ball.cs b/Scripts/Ball.cs index 7e21005..96bf758 100644 --- a/Scripts/Ball.cs +++ b/Scripts/Ball.cs @@ -5,6 +5,7 @@ namespace Pong.Scripts; public partial class Ball : CharacterBody2D { [Export] private double _ballSpeed; + [Export] private double _maxRandomAngle; private Vector2 _velocity; @@ -18,7 +19,7 @@ public partial class Ball : CharacterBody2D // this should dispose when this method goes out of scope (this means after the velocity variable is assigned) using var rng = new RandomNumberGenerator(); // set the velocity currently to the left of the screen with a random y angle. - _velocity = Vector2.Left * BallSpeed + new Vector2(0, rng.RandfRange(-0.5, 0.5) * BallSpeed); + _velocity = Vector2.Left * BallSpeed + new Vector2(0, rng.RandfRange(-_maxRandomAngle, _maxRandomAngle) * BallSpeed); } public override void _PhysicsProcess(double delta) diff --git a/addons/godot-git-plugin/linux/libgit_plugin.linux.editor.double.arm64.so b/addons/godot-git-plugin/linux/libgit_plugin.linux.editor.double.arm64.so index 7cb432e..52b2024 100755 --- a/addons/godot-git-plugin/linux/libgit_plugin.linux.editor.double.arm64.so +++ b/addons/godot-git-plugin/linux/libgit_plugin.linux.editor.double.arm64.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c4c17ed282034a80ac756e72741762be159c171f95d11ac141341edac85afd4 -size 2931744 +oid sha256:426f8b861429858307593e077b780e4496ba3eeeb183431a41773c0be4f6ed31 +size 8182112 diff --git a/project.godot b/project.godot index 05e6c71..984e028 100644 --- a/project.godot +++ b/project.godot @@ -46,4 +46,4 @@ paddle_down={ [rendering] -renderer/rendering_method="mobile" +renderer/rendering_method="gl_compatibility"