// if there is a collision with anything solid, bounce off of it if (hspeed != 0) { if !place_free(x + hspeed,y) { move_bounce_solid(true); } } if (vspeed != 0) { if (!place_free(x + hspeed,y + vspeed)) { move_bounce_solid(true); } }