Absolute Speed Equation for self.velocity?
So I'm making the platformer where the player character can often be moving really fast in any direction. I'm designing the jump mechanic and I've almost got it to a tee except for one thing.
In a nutshell I want it to look like this:
Rule
When Mouse Click (I'm using click atm for testing, will be screen touch)
Move to
mouseposition.x, mouseposition.y
at speed self.velocity + 300
I just can't figure out how to get a unified variable for the speed of an actor. Because GS only gives us x and y independently and also x and y speeds are always switching from positive to negative, I need some equation to get the absolute speed of an actor from. I tried text displaying self.angularvelocity but that always seems to be 0.
I've also tried googling for this equation, but I'm not sure which terminology to use, my results are always crap like answers to dumb textbook questions about trains and airplanes vs windspeed lol.
In a nutshell I want it to look like this:
Rule
When Mouse Click (I'm using click atm for testing, will be screen touch)
Move to
mouseposition.x, mouseposition.y
at speed self.velocity + 300
I just can't figure out how to get a unified variable for the speed of an actor. Because GS only gives us x and y independently and also x and y speeds are always switching from positive to negative, I need some equation to get the absolute speed of an actor from. I tried text displaying self.angularvelocity but that always seems to be 0.
I've also tried googling for this equation, but I'm not sure which terminology to use, my results are always crap like answers to dumb textbook questions about trains and airplanes vs windspeed lol.
Comments
sqrt(abs(x^2)+abs(x^2)) = speed
In case anyone was interested...