Updates to Rain and added tracks
This commit is contained in:
parent
070d65e06d
commit
1c5eda4dd5
10
index.html
10
index.html
|
|
@ -467,6 +467,10 @@
|
|||
'music/track02.mp3',
|
||||
'music/track03.mp3',
|
||||
'music/track04.mp3',
|
||||
'music/track05.mp3',
|
||||
'music/track06.mp3',
|
||||
'music/track07.mp3',
|
||||
'music/track08.mp3',
|
||||
];
|
||||
|
||||
let currentTrackIndex = 0;
|
||||
|
|
@ -811,7 +815,11 @@
|
|||
function rainLoop() {
|
||||
if (!rainRunning) return; // stop when game ends
|
||||
|
||||
rainCtx.clearRect(0, 0, rainCanvas.width, rainCanvas.height);
|
||||
rainCtx.globalCompositeOperation = 'destination-out';
|
||||
rainCtx.fillStyle = 'rgba(0,0,0,0.05)'; // 5 % fade each frame
|
||||
rainCtx.fillRect(0, 0, rainCanvas.width, rainCanvas.height);
|
||||
// Switch back to normal drawing mode for the rain characters
|
||||
rainCtx.globalCompositeOperation = 'source-over';
|
||||
|
||||
// Update & draw each drop
|
||||
rainDrops.forEach(drop => {
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue