Hey to everyone,
i've been trying to have a code that works same as rectangle_in_rectangle(), i do use x1, x2, y1, y2 for the tile's position.
player's sizes are 24x32 and tile's size is 32x32
heres my code but something wrong with it and it doesn't work.
i've been trying to have a code that works same as rectangle_in_rectangle(), i do use x1, x2, y1, y2 for the tile's position.
player's sizes are 24x32 and tile's size is 32x32
heres my code but something wrong with it and it doesn't work.
Code:
var xx = 4;
var yy = 7;
var x1 = floor(xx*32);
var y1 = floor(yy*32);
var x2 = x1+32;
var y2 = y1+32;
var inside_x1 = (xx > x1) && (xx < x2);
var inside_y1 = (yy > y1) && (yy < y2);
var inside_x2 = (xx+24 > x1) && (xx+24 < x2);
var inside_y2 = (yy+32 > y1) && (yy+32 < y2);
//tried if (inside_x1 && inside_y1 && inside_x2 && inside_y2){
/*also tried:
if (inside_x1 && inside_y1){
respawn();}
if (inside_x2 && inside_y2){
respawn();}
*/
Last edited: