Skip to content

Commit

Permalink
css fixes for smoother transition
Browse files Browse the repository at this point in the history
  • Loading branch information
macel94 committed Feb 4, 2024
1 parent 62b22e6 commit 482e040
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/BlazorPong.Web.Components/PongComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
}
}

private async Task GetOrInitializeGameObjects()
private async Task GetGameObjects()
{
// Chiedo al server la posizione di ogni oggetto e aspetto la risposta
GameObjectsDict = await Connection!.InvokeAsync<Dictionary<string, GameObject?>>(nameof(IGameHub.GetGameObjects), RoomId);
Expand Down Expand Up @@ -444,7 +444,7 @@
try
{
_playerType = await Connection!.InvokeAsync<Roles>(nameof(IGameHub.OpenRoom), RoomId, username);
await ManageEnteredPlayerTypeAssigned();
await ManagePlayerTypeAssigned();
}
catch (Exception ex)
{
Expand All @@ -460,7 +460,7 @@
NavigationManager.NavigateTo($"/room/{RoomId}/pong");
// Get what type of player the current user will be
_playerType = await Connection!.InvokeAsync<Roles>(nameof(IGameHub.JoinRoom), RoomId, username);
await ManageEnteredPlayerTypeAssigned();
await ManagePlayerTypeAssigned();
}
else
{
Expand All @@ -469,12 +469,12 @@
}
}

private async Task ManageEnteredPlayerTypeAssigned()
private async Task ManagePlayerTypeAssigned()
{
Logger.LogInformation($"Player type: {_playerType}");

PlayerTypeMessage = $"Your role is: {_playerType.ToString()}";

await GetOrInitializeGameObjects();
await GetGameObjects();
}
}
8 changes: 2 additions & 6 deletions src/BlazorPong.Web.Components/PongComponent.razor.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
#player1 {
background-color: red;
width: 2%;
height: 15%;
position: absolute;
}

#player2 {
background-color: green;
width: 2%;
height: 15%;
position: absolute;
}

#ball {
background-color: blue;
width: 2%;
height:4%;
position: absolute;
/*transition: top 0.03s, left 0.03s;*/
transition: transform 0.03s linear;
}

#gamearea {
Expand Down

0 comments on commit 482e040

Please sign in to comment.