Skip to content

Commit

Permalink
1 file edited
Browse files Browse the repository at this point in the history
  • Loading branch information
Croc-Prog-github committed Jul 11, 2024
1 parent 7c84238 commit 8043d4c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions game/GameMood/BattleRoyal/bots/bot1/bot1B.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
document.addEventListener('DOMContentLoaded', () => {
/*document.addEventListener('DOMContentLoaded', () => {
const bot1 = document.getElementById('bot1');
const mover = new MoverTS(bot1);
})
})*/

//Calcola la distanza tra i 2 elementi in argomento
function getDistance(rect1, rect2) {
Expand Down Expand Up @@ -49,17 +49,19 @@ function RadarMode() { //Cerca in un raggio di 100px gli id: player || PwUP
}

document.addEventListener('DOMContentLoaded', () => {

const bot1 = document.getElementById('bot1');
const mover = new MoverTS(bot1);

// Si sposta verso la cassa più vicina
//mover.glideAtIdElement('PwUP', 3)

RadarMode();
switch (RadarMode()) {
case 'player':

case 'player' | 'player2':
mover.glideAtIdElement(RadarMode(), 3)
break;
case 'PwUP':

mover.glideAtIdElement('PwUP', 3)
break;
default:
console.warn("MainFlow: Nessun elemento definito rilevato da RadarMode()")
Expand Down

0 comments on commit 8043d4c

Please sign in to comment.