Making deep water tiles block

I’ve tried this:

if(timeout){ say2 #v(tiles[63,63]); for(this.i=playerx-1;this.i<playerx+3;this.i++){ for(this.j=playery-1;this.j<playery+4;this.j++){ if(tiles{this.i,this.j}==322){ playerx-=this.i*vecx(playerdir); playery-=this.j*vecy(playerdir); } } } timeout = .05; }

but it doesn’t work.

I’m tired and have been doing trial error all day finishing a miniboss. If someone knows a quick solution, I’d be thankful.

if ( tiles[this.i,this.j] == 0xE3C ) {

Nah, I’m using the right tile index, I still tried your solution but no success. I should have explained the behavior: Player still can go swim and the controls while swimming become funky.

322 is converted from the base 16 0x142. Normally it works.