Fries
604d79e654
i added a GameArea class which makes it easier to operate on in coordinates bounds with the GameCoordinate struct wrapper which does calculations for me. the GameArea class also has a normalization system which is how the ScalingManager can teleport items in bounds to relatively the same place when resized. it took quite a while to get the paddle to teleport. looks like im supposed to modify the position inside IntegrateForces instead of PhysicsProcess which is my mistake.
18 lines
455 B
C#
18 lines
455 B
C#
namespace Pong.Scripts.Managers.UI.Menus;
|
|
|
|
public partial class MainMenu : BaseMenu
|
|
{
|
|
/// <summary>
|
|
/// code that executes when the start button is pressed. this loads the Pong scene to the root
|
|
/// of the scene tree.
|
|
/// </summary>
|
|
private void OnPlayButtonPressed()
|
|
{
|
|
GetTree().ChangeSceneToFile("res://Scenes/Pong.tscn");
|
|
}
|
|
|
|
private void OnSettingsButtonPressed()
|
|
{
|
|
GetTree().ChangeSceneToFile("res://Scenes/UI/Menus/Settings.tscn");
|
|
}
|
|
}
|