Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Circle fade in/out (https://forums.graalonline.com/forums/showthread.php?t=63443)

Dach 01-14-2006 10:07 PM

Circle fade in/out
 
1 Attachment(s)
I guess I forgot to post this when I made it, so here it is.
pressing f will trigger the effect, if you can't figure out how to make use of it, ohwell

Raeiphon 01-15-2006 06:02 AM

Actually, thank you. Quite useful, i've never really done much work on effects, good for learning off.

adam 01-15-2006 03:17 PM

I think that is wonderfully made, and a very nice effect.

Great work.

ZeLpH_MyStiK 01-15-2006 10:45 PM

Although it would be better if you used:
NPC Code:

this.nodes = 30; // number of points used to create this illusion of a circle through polygons
setarray this.circle,this.nodes * 2; // sets up the array
for(i=0; i<this.nodes; i++) { // uses a for loop to set the points
this.circle[2*i] = playerx + 1.5 + r * cos(theta);
this.circle[2*i+1] = playery + 1.5 + r * sin(theta);
}


where r is the size of the circle, and theta would be the angle swept out by the for loop in terms of i, pi and this.nodes.
Of course this is just an example, and cannot be used to substitute the code in chad's level.
The idea here is that it would fade in/out using the player's coordinates. Since it looks weird when the player is at the edge of the level and it just fades in/out on grass tiles.

I'm not sure if that made any sense, but if you have questions, post them here.


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

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