-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit * init * init * score updated * updated leaderboard --------- Co-authored-by: Manikandan Dhanen <manikandan.dhanen@mastec.com>
- Loading branch information
1 parent
c8e14c4
commit c206ff8
Showing
3 changed files
with
124 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,46 @@ | ||
<div class="container"> | ||
<mat-card class="snake-game-card"> | ||
<mat-card-header class="header-center">Snake Game</mat-card-header> | ||
<mat-card-content> | ||
<div class="game-container"> | ||
<div class="score">Score: {{ foodEaten }}</div> | ||
<canvas #gameCanvas width="400" height="400"></canvas> | ||
</div> | ||
</mat-card-content> | ||
<mat-card-actions> | ||
<button mat-raised-button color="primary" (click)="startGame()"> | ||
Start Game | ||
</button> | ||
</mat-card-actions> | ||
</mat-card> | ||
<div class="left-panel"> | ||
<mat-card class="snake-game-card"> | ||
<mat-card-header class="header-center">Snake Game</mat-card-header> | ||
<mat-card-content> | ||
<div class="game-container"> | ||
<div class="score">Score: {{ foodEaten }}</div> | ||
<canvas #gameCanvas width="400" height="400"></canvas> | ||
</div> | ||
</mat-card-content> | ||
<mat-card-actions> | ||
<button mat-raised-button color="primary" (click)="startGame()"> | ||
Start Game | ||
</button> | ||
</mat-card-actions> | ||
</mat-card> | ||
</div> | ||
|
||
<div class="right-panel"> | ||
<mat-form-field class="full-width"> | ||
<input matInput placeholder="Enter your name" [(ngModel)]="userName" /> | ||
</mat-form-field> | ||
|
||
<mat-card class="leaderboard-card"> | ||
<h3 class="leaderboard-header">Leaderboard</h3> | ||
|
||
<table mat-table [dataSource]="leaderboard" class="mat-elevation-z8"> | ||
<ng-container matColumnDef="index"> | ||
<th mat-header-cell *matHeaderCellDef>SI.No</th> | ||
<td mat-cell *matCellDef="let player; let i = index">{{ i + 1 }}</td> | ||
</ng-container> | ||
<ng-container matColumnDef="name"> | ||
<th mat-header-cell *matHeaderCellDef>Name</th> | ||
<td mat-cell *matCellDef="let player">{{ player.name }}</td> | ||
</ng-container> | ||
<ng-container matColumnDef="score"> | ||
<th mat-header-cell *matHeaderCellDef>Score</th> | ||
<td mat-cell *matCellDef="let player">{{ player.score }}</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> | ||
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr> | ||
</table> | ||
</mat-card> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters