Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejfila6969 committed Feb 26, 2024
1 parent 209ec8f commit 1dd69bd
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions res/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,18 @@ const clearCanvas = () => {

const update = () => {
jinx.update();
caitlyn.update();
ezreal.update();
vayne.update();

if(jinx.hp <= 0) {
caitlyn.update();
}

if(caitlyn.hp <= 0) {
ezreal.update();
}

if(ezreal.hp <= 0) {
vayne.update();
}
player.update(keys);

Champ.detectHit(player.dart, jinx);
Expand All @@ -94,18 +103,18 @@ const render = () => {

// Načítání dalších postav + kontrola vítězství:
if (jinx.hp <= 0) {
caitlyn.draw(ctx);
caitlyn.dart.draw(ctx);
caitlyn.draw(ctx);
caitlyn.dart.draw(ctx);
}

if (caitlyn.hp <= 0) {
ezreal.draw(ctx);
ezreal.dart.draw(ctx);
ezreal.draw(ctx);
ezreal.dart.draw(ctx);
}

if (ezreal.hp <= 0) {
vayne.draw(ctx);
vayne.dart.draw(ctx);
vayne.draw(ctx);
vayne.dart.draw(ctx);
}

if (vayne.hp <= 0) {
Expand Down

0 comments on commit 1dd69bd

Please sign in to comment.