CyrusGoldshire
Member
GML:
function scr_pushPlayer(playerID, mouse_x_value, mouse_y_value){
var total = mouse_x_value + mouse_y_value
//these should be velocitys but im using speed because I havent yet set up velocity
playerID.x_velocity = scr_roundTo((mouse_x_value/total)%15 * playerID.forceTotalVelocity * sign(playerID.x - mouse_x_value), .01)
playerID.y_velocity = scr_roundTo((mouse_y_value/total)%15 * playerID.forceTotalVelocity * sign(playerID.y - mouse_y_value), .01)
show_debug_message(playerID.x_velocity)
show_debug_message(playerID.y_velocity)
}