by Novice » Wed Dec 07, 2005 10:52 am
Ok with int shooterangle you create a varibale that will hold the angle, you can use any name like int position or such.
With shooterangle=direction(shooter.x,shooter.y,a.x,a.y); you tell the computer that the angle is calculated using direction betwen two actors in this case shooter and a.
With animpos=shooterangle/22.5; you make animation change depending on the angle. I divide shooterangle with 22.5 because my animation has 16 frames so 360/22.5=16 for ex. if your animation is 360 degres rotation and has 10 frames you should divide the angle vith 36. 360/36=10 and so on.
If that dosent explain it fell free to ask again.
BTW i solved my lag problem, it is a bug that hapens when actor names begin with small letters so if you have the same problem just make the first letter capital ex. Player insted of player.
Why do i always get stuck?