H
hambo245
Guest
Apologies if anyone has already seen me post on reddit but slow replies i figured id try here.
To give some background i'm currently using
offset_x = 100;
if(mouse_check_button(mb_left) and (mouse_x >640)){
phy_position_x = mouse_x + offset_x;
phy_position_y = mouse_y;
}
if(mouse_check_button(mb_left) and (mouse_x <= 640)){
phy_position_x = mouse_x - offset_x;
phy_position_y = mouse_y;
}
to control where my character goes on a 1280 x 720 room. The only issue is this creates a gap of 200 pixels in the centre that cant be used so i was hoping that by maybe incorporating something like (1/mouse_x)*320 as the offset when it hits that 540 to 740 in the x axis 200 pixel dead space it would instead just slowly centre itself the more i approach that 640 middleground. My only problem is i'm not exactly sure how to implement such a thing where it gets the mouse_x position and then uses said formula. Any help is appreciated!
I'm only 2-3 weeks in using this programme with no experience as i picked it up in the humble bundle so apologies (again) if it seems either simple or stupid!
To give some background i'm currently using
offset_x = 100;
if(mouse_check_button(mb_left) and (mouse_x >640)){
phy_position_x = mouse_x + offset_x;
phy_position_y = mouse_y;
}
if(mouse_check_button(mb_left) and (mouse_x <= 640)){
phy_position_x = mouse_x - offset_x;
phy_position_y = mouse_y;
}
to control where my character goes on a 1280 x 720 room. The only issue is this creates a gap of 200 pixels in the centre that cant be used so i was hoping that by maybe incorporating something like (1/mouse_x)*320 as the offset when it hits that 540 to 740 in the x axis 200 pixel dead space it would instead just slowly centre itself the more i approach that 640 middleground. My only problem is i'm not exactly sure how to implement such a thing where it gets the mouse_x position and then uses said formula. Any help is appreciated!
I'm only 2-3 weeks in using this programme with no experience as i picked it up in the humble bundle so apologies (again) if it seems either simple or stupid!