Hey I’m using this code to have an object called mc create a bullet and shoot it in the direction it is facing:
angle=mc.rotation*Math.PI/180;
x=mc.x+Math.cos(angle)*barrelLength;
y=mc.y+Math.sin(angle)*barrelLength;
speedX=Math.cos(angle)*20;
speedY=Math.sin(angle)*20;
rotation=angle/Math.PI*180;
Pretty simple. But this only works if the point I want to create the bullet is has the same y value as the bullet creator (mc). Say the bullet creator is holding the gun off to it’s side - for example, 10 pixels below mc’s center when it’s pointing to the right. I need the point in which the bullet starts off to be 10 pixels from where it is now. And, of course, the x and y coordinates of this point will change with the rotation of mc. I’m not very good at explaining it so let me know if you need clarification. Thanks for your help