You could do something like...
PHP Code:
if (this.char_x in |this.wall_x, this.wall_x + this.wall_width| &&
this.char_y in |this.wall_y, this.wall_y + this.wall_height|) {
// In Wall
}
You'd benefit more from searching 'polygon collision' and seeing how it's implemented in other programming/scripting languages and then port/adapt it to GS2.