new colors
This commit is contained in:
parent
f54c02b8c2
commit
c198ced26c
4 changed files with 8 additions and 5 deletions
BIN
src/app/mario/cloud.png
Normal file
BIN
src/app/mario/cloud.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
|
@ -1,4 +1,4 @@
|
|||
<div style="width: 100%; height: 100vh; overflow-x: scroll; overflow-y: hidden;">
|
||||
<div style="width: 100%; height: 100%; overflow-x: scroll; overflow-y: hidden;">
|
||||
<canvas id="gameCanvas"></canvas>
|
||||
</div>
|
||||
|
|
@ -6,5 +6,6 @@ body, html {
|
|||
|
||||
canvas {
|
||||
display: block;
|
||||
background-color: #c2f0c2;
|
||||
background-color: #dceaff;
|
||||
background-image: url("./cloud.png");
|
||||
}
|
|
@ -18,10 +18,10 @@ import { JumpService } from '../jump.service';
|
|||
dx: 0,
|
||||
dy: 0,
|
||||
speed: 4,
|
||||
jumpStrength: 25,
|
||||
jumpStrength: 20,
|
||||
gravity: 0.5,
|
||||
onGround: false,
|
||||
color: 'red'
|
||||
color: 'orange'
|
||||
};
|
||||
|
||||
private canvas!: HTMLCanvasElement;
|
||||
|
@ -129,7 +129,7 @@ import { JumpService } from '../jump.service';
|
|||
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
|
||||
// Ground
|
||||
this.ctx.fillStyle = '#654321';
|
||||
this.ctx.fillStyle = '#044d00';
|
||||
this.ctx.fillRect(0, this.canvas.height - 60, this.canvas.width, 60);
|
||||
|
||||
// Platforms
|
||||
|
@ -154,6 +154,8 @@ import { JumpService } from '../jump.service';
|
|||
this.ctx.fillStyle = 'black';
|
||||
this.ctx.fillText('🏁', this.canvasWidth - 60, this.canvas.height - 170);
|
||||
|
||||
|
||||
// Counter
|
||||
this.ctx.fillStyle = 'black';
|
||||
this.ctx.font = '20px Arial';
|
||||
this.ctx.fillText(`Jumps: ${this.totalJumps}`, this.canvas.width - 150, 30);
|
||||
|
|
Loading…
Reference in a new issue