Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   lighting effect (https://forums.graalonline.com/forums/showthread.php?t=61061)

Midnight_Magician 09-07-2005 07:20 AM

lighting effect
 
Is there a simple way to get a light to move in a circle around a certain (x,y) coordinante?

ForgottenLegacy 09-07-2005 11:28 PM

Use the sine, cosine circle. Have a single variable, 'angle', and have it increase or decrease (increase = clockwise, decrease = anticlockwise). Then add the image's current x and y to that of the cosine and sine, respectively, of the angle. It's the sine, cosine circle, or the unit circle as they call in Trig and PreCal.

Edit: This is all in radians, so use a MOD (%) or a compound var assignment (a?b:c) to keep the 'angle' var between 0 and 2*pi


All times are GMT +2. The time now is 07:34 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.