Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Chosim on Fri 17/06/2011 13:51:45

Title: "Swing-Effect"
Post by: Chosim on Fri 17/06/2011 13:51:45
So, today i have a question-hour  :P

I want that an object swing a bit:

(http://img202.imageshack.us/img202/1016/unbenanntxwt.png)
Title: Re: "Swing-Effect"
Post by: Snarky on Fri 17/06/2011 14:04:30
So what is your question? How to do this?

Well, it depends on whether the object is actually a line (search the manual for DrawLine and use sin/cos to calculate the coordinates) or a sprite (search for, if I remember correctly, RotateSprite).

To get a smooth swinging motion, use a sine wave to set the angle of rotation.