i want to make a game where u shoot arrows at the mouse direction, i have everything exept for that, i think is trigonometry, i have seen it on many games but i cant seem to figure it, if anyone can help me?
im planning to make the arrow something like this
onClipEvent(enterFrame)
{
if(Key.isDown(Key.SPACE) && _root.readytoshoot == 1)
{
//Shoot arrow
_root.mycharacter.attachMovie(“arrow”,“a rrow”+i,_root.getNextHighestDepth());
i++;
_root.readytoshoot = 0;
}
}
And the arrow MC will have something like this:
onClipEvent(enterFrame)
{
timer = 0;
if(timer > 100){removeMovieClip(_parent);_root.read ytoshoot = 0;}
else{timer++;}
// THIS IS THE PART WHERE I NEED HELP
this._x +=
this._y +=
}