I downloaded a Demo called "Abuse2." and try to edit some script to use in my game. However, I don't understand how the script works. In my game, it doesn't work so well. I made six weapon sprites so I can animate them to follow the direction of the cursor. But It's very "Glitchy." Here's the script that I edited for my game.
- Code: Select all
double mouseangle = direction(xscreen, yscreen, xmouse, ymouse);
animpos = (mouseangle/360)*(nframes);
if(Gun1.animindex == 0 || Gun1.animindex == 1) y = sin(frame/2.0) - 9;
else y = -14;
Someone, Please help!
Thank you and Regards,
Blaque Boi