L
lindens
Guest
Just looking for some clarification on if i'm doing this correctly.
My player has normal movement attributes: a velocity vector, max_velocity, accel, etc.
It works very nicely for the player.
However, for other instances, say an enemy with a density of 2, multiplying by 2 makes him spazz out violently and when i remove that * 2, the enemy moves normally.
EDIT: just discovered the phy_mass variable, works nicely as well
My player has normal movement attributes: a velocity vector, max_velocity, accel, etc.
Code:
// Move, creates the desired velocity based on player input
player_move();
// Apply forces, 20 being the player's density, F = MA right?
var x_force = (velocity[@ 0] - phy_speed_x) * 20;
var y_force = (velocity[@ 1] - phy_speed_y) * 20;
physics_apply_force(phy_position_x, phy_position_y, x_force, y_force);
However, for other instances, say an enemy with a density of 2, multiplying by 2 makes him spazz out violently and when i remove that * 2, the enemy moves normally.
EDIT: just discovered the phy_mass variable, works nicely as well
Last edited by a moderator: