Well you can run a loop when the player enters a level like...
PHP Code:
function onPlayerenters() {
for (i=0;i<64*64;i++) { // check every tile in the level
if (tiles[i%64,int(i/64)] == watertilehex) { // this would have to be edited to check the current level, as on a gmap this would just check the top left corner
this.levelcontainswater = true; // yes, there's water in the level
break; // no need to check for more water, right? So let's stop checking!
}
}
}
The problem with this is the fact that depending on the levels, you could be right next to water, but there will actually be no water in your current level(because of gmaps), so it could end up reading as false. So instead of checking the level, just check the tiles surrounding the player?
An even simpler method would just be using level.vars!