#Calculating Damage in GML
20 messages · Page 1 of 1 (latest)
How're you rotating it?
image_angle = point_direction(x,y,mouse_x,mouse_y);
every step its being aligned with my player
you could track how much image_angle is changing each step to get that speed
var prev_angle = image_angle;
image_angle = point_direction(x,y,mouse_x,mouse_y);
var rotation_speed = abs(image_angle - prev_angle);```
then take that number and apply whatever multipliers you want to it to get the damage
thank you ill try that
You may want angle_difference
Subtracting may get a lil tricky
ah yeah that'd also work
what would that do
angle_difference returns the difference between two angles
Angle difference takes two angle values. And it will account for things going from 359 -> 0 or 0 -> 359
oh ok
yeah what I posted before will get weird if it went from 340 to 20 or something
so angle_difference would be better
var rotation_speed = abs(angle_difference(image_angle, prev_angle)); just swap out the subtraction stuff for angle_difference
thank you ive been thinking of a way but i just started like a week ago ill try that
I added the abs (makes any negative number positive) because you presumably don't wanna do negative damage to something if you rotate the sword to the right lol
makes sense lol