SOLVED Make yscale not affect collision box?

A

Asephy

Guest
ezgif-7-6aafecdd35bf.gif
I made my character kind a pulsate like:
GML:
image_yscale = (image_index > 0) 0.95 : 1;
But it seems to shrink my collisions, and making me get stuck on the walls.
Code:
if(place_meeting(x + hsp, y, o_wall)){
    while (!place_meeting(x+sign(hsp), y, o_wall)){
    x = x + sign(hsp);
    }
    hsp = 0;
}
if(place_meeting(x, y + vsp, o_wall)){
    while (!place_meeting(x, y+sign(vsp), o_wall)){
    y = y + sign(vsp);
    }
    vsp = 0;
}
I've tried to make it use another sprite for collision and it doesn't seem to work. :/
What do?
 
A better way to do it is to create your own "yscale" variable, and draw the sprite using that:

Create Event
Code:
yscale = 1;
Draw Event:
Code:
yscale = (image_index > 0) 0.95 : 1;
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,yscale,image_angle,image_blend,image_alpha);
This reduces the overhead of having an unnecessary object just to handle collisions.
 
Top