提示コードですが下記の///
コメント部内部のコードのif
文ですがconosole.log
の出力結果下記のConsole
の文より同じrgba
の値でもあるにも関わらず==
で比較出来ない原因はなんでしょうか?
.p5 : https://p5js.org/reference/#/p5/color
Console
Game.js:329 ううう Game.js:356 えええ Game.js:358 qqq rgba(255,0,0,1) Game.js:359 aaaa rgba(255,0,0,1) Game.js:302 いいい Game.js:329 ううう Game.js:356 えええ Game.js:358 qqq 5 Game.js:359 aaaa rgba(255,0,0,1) Game.js:302 いいい Game.js:329 ううう Game.js:356 えええ Game.js:358 qqq rgba(255,0,0,1) Game.js:359 aaaa rgba(255,0,0,1)
Game.js
javascript
1 2 3 ComboCheck(pos,puyoColor) 4 { 5 6 if(pos.y < STAGE_WIDTH - 1) 7 { 8 console.log("あああ"); 9 10 if(board[pos.y][pos.x + 1] == puyoColor) 11 { 12 this.combo++; 13 console.log("11111"); 14 15 this.comboArray.push(pos); 16 17 if(this.combo == 4) 18 { 19 20 return this.comboArray; 21 } 22 else 23 { 24 this.p = new Vector(0,0); 25 this.p.x = pos.x + 1; 26 this.p.y = posy; 27 28 this.ComboCheck(p,puyoColor); 29 } 30 } 31 } 32 33 if(pos.x > 0) 34 { 35 console.log("いいい"); 36 37 if(board[pos.y][pos.x - 1] == puyoColor) 38 { 39 console.log("11111"); 40 41 this.combo++; 42 43 this.comboArray.push(pos); 44 45 if(this.combo == 4) 46 { 47 return this.comboArray; 48 } 49 else 50 { 51 this.p = new Vector(0,0); 52 this.p.x = pos.x - 1; 53 this.p.y = posy; 54 55 this.ComboCheck(p,puyoColor); 56 } 57 } 58 } 59 60 if(pos.y > 0) 61 { 62 console.log("ううう"); 63 64 65 if(board[pos.y - 1][pos.x] == puyoColor) 66 { 67 this.combo++; 68 console.log("11111"); 69 70 this.comboArray.push(pos); 71 72 if(this.combo == 4) 73 { 74 return this.comboArray; 75 } 76 else 77 { 78 this.p = new Vector(0,0); 79 this.p.x = pos.x; 80 this.p.y = pos.y - 1; 81 82 this.ComboCheck(p,puyoColor); 83 } 84 } 85 } 86 87 if(pos.y < STAGE_HEIGHT - 1) 88 { 89 console.log("えええ"); 90///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 91 92 console.log( "qqq " + board[pos.y + 1][pos.x]); 93 console.log( "aaaa " + puyoColor); 94 95 if(board[pos.y + 1][pos.x] == puyoColor) 96 { 97//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 98 console.log("11111"); 99 this.combo++; 100 101 this.comboArray.push(pos); 102 103 if(this.combo == 4) 104 { 105 return this.comboArray; 106 } 107 else 108 { 109 this.p = new Vector(0,0); 110 this.p.x = pos.x; 111 this.p.y = pos.y + 1; 112 113 this.ComboCheck(p,puyoColor); 114 } 115 } 116 } 117 return this.comboArray; 118 } 119
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2022/01/16 03:32 編集