uloha:had_v3

Rozdíly

Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.

Odkaz na výstup diff

Obě strany předchozí revize Předchozí verze
Následující verzeObě strany příští revize
uloha:had_v3 [2023/02/22 17:10] adminuloha:had_v3 [2023/02/22 17:25] admin
Řádek 11: Řádek 11:
        for(const object1 of this.gameObjects){        for(const object1 of this.gameObjects){
             for(const object2 of this.gameObjects) {             for(const object2 of this.gameObjects) {
-                if(object1 == object2) {return}+                if(object1 === object2) { break }
                 const stringParts1 = object1.getParts().map(souradnice=>souradnice.join("_"))                 const stringParts1 = object1.getParts().map(souradnice=>souradnice.join("_"))
                 const stringParts2 = object2.getParts().map(souradnice=>souradnice.join("_"))                 const stringParts2 = object2.getParts().map(souradnice=>souradnice.join("_"))
 +
                 const intersection = stringParts1.filter(value => stringParts2.includes(value));                 const intersection = stringParts1.filter(value => stringParts2.includes(value));
                 if(intersection.length > 0){                 if(intersection.length > 0){
                     // dochazi ke kolizi dvou objektu                     // dochazi ke kolizi dvou objektu
-                    +                    this.solveCollision(object1, object2)
                 }                 }
             }             }
         }         }
 </code> </code>
  • uloha/had_v3.txt
  • Poslední úprava: 2023/11/15 20:54
  • autor: 127.0.0.1