* Check if tile has collision * 检查图块是否有碰撞 * @param col Column (X) | 列(X) * @param row Row (Y) | 行(Y) * @returns True if has collision | 如果有碰撞返回true
(col: number, row: number)
| 831 | * @returns True if has collision | 如果有碰撞返回true |
| 832 | */ |
| 833 | hasCollision(col: number, row: number): boolean { |
| 834 | if (col < 0 || col >= this._width || row < 0 || row >= this._height) { |
| 835 | return true; |
| 836 | } |
| 837 | if (this._collisionData.length === 0) { |
| 838 | return false; |
| 839 | } |
| 840 | return this._collisionData[row * this._width + col] > 0; |
| 841 | } |
| 842 | |
| 843 | /** |
| 844 | * Get collision type at tile position |
no outgoing calls
no test coverage detected