added sound effects and some other stuff kind of at random, then pushed directly to master like a dummy
This commit is contained in:
@@ -98,9 +98,10 @@ function drawRemainingDistance(ctx, width, horseSize, cyclesRemaining){
|
||||
ctx.fillText(remainingString, (width / 2) - 150, (horseSize / 2));
|
||||
}
|
||||
|
||||
function drawCountdown(ctx, width, height, horseSize, seconds){
|
||||
function drawCountdown(ctx, width, height, horseSize, seconds, horses){
|
||||
|
||||
console.log("draw countdown");
|
||||
console.log(horses);
|
||||
drawRaceBackground(ctx,width,height,horseSize, 0, false);
|
||||
|
||||
ctx.fillStyle = "#000000";
|
||||
@@ -108,6 +109,10 @@ function drawCountdown(ctx, width, height, horseSize, seconds){
|
||||
|
||||
ctx.fillText(seconds, (width / 2) - 50, (horseSize ));
|
||||
|
||||
for (let i = 0; i < horses.length; i++) {
|
||||
drawHorseNamesinLane(ctx, horses[i], i, horseSize, height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function drawFinishLine(ctx, horseSize, height){
|
||||
@@ -116,3 +121,10 @@ function drawFinishLine(ctx, horseSize, height){
|
||||
ctx.fillRect(finishLinePosition, height - (2 * horseSize) , 8 , height);
|
||||
|
||||
}
|
||||
|
||||
function drawHorseNamesinLane(ctx,horse, lane, horseSize, height) {
|
||||
ctx.fillStyle = "#000000";
|
||||
ctx.font = "40px Arial";
|
||||
|
||||
ctx.fillText(horse.name, horseSize, height - (lane * (horseSize / 2 )) -20);
|
||||
}
|
||||
Reference in New Issue
Block a user