• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Physics - Maintain a constant speed / power

T

Temmy

Guest
Hey folks,

Let's talk physics! At the moment I have a projectile the player can angle and then fire out, which uses physics_apply_impulse() to give it a kick.

Code:
//make the arrow move
var dir = point_direction(x, y, mouse_x, mouse_y)-180;
physics_apply_impulse(x, y, lengthdir_x(50, dir), lengthdir_y(50, dir));

Basically I want this shot to rebound and ricochet off surfaces indefinitely but with each rebound it looses some power (confirmed by querying the phy_speed variable on the projectile).

How would I go about ensuring it maintains a constant speed after rebounds? Should I be using a different way of applying its 'force'? Below are it's current physic properties:

upload_2017-3-10_11-24-58.png
 
Last edited by a moderator:
Top