![]() |
Circles!
Could someone teach me how to make something move in a circle? Thanks.
|
I would never had said that lol, havent had evough schooling yet
|
Re: Re: Circles!
Quote:
|
magnitude.
|
magnitude??
like how much it will rotate |
Quote:
|
well okay then, that helps more
i've never heard it called magnitude |
i learned a new vocab word =D but how would i incorporate that formula into a NPC?
|
NPC Code: |
Quote:
|
-=Josey=-
Nice formula Kaimetsu. I wouldn't use showimg for that, I do believe showimg is local. So you could use something like this; if (playerenters){ timeout=.05; setimg light2.png; setcoloreffect 0,0.5,1,0.99; } if (timeout) { this.x=30; this.y=30; this.angle=(this.angle+.1)%6.28; x = this.x+6*sin(this.angle); y = this.y+6*cos(this.angle); timeout=.05; } Just change this.x and this.y to wherever you want the light to be. |
*wishes she would have had a better Geometry teacher* |
-=Josey=-
Hey! Everyone makes mistakes. ;P In that formula, the angle = the speed, this.x+6 = the width, this.y+6 = the hieght. |
-=Josey=-
Lol, if you use the code that I provided above, it is. Say you use this.angle=(this.angle+.7)%6.28;. That will speed up the circular movement. If you use this.x+10 and this.y+10 it will make the radius bigger, making it circle bigger. |
Nice try, Josey. :p
|
Lol. thisx+6 and this.y+6 = the circumference of the circle.
|
- wonders what 6 + 6 is
:eek: |
Notice when he knows what he is saying is wrong, he starts all of his posts with Lol...thats just something I noticed...humans amaze me...
The curcumference is 2pi*r is it not? Not trying to correct Kaimetsu, I am seriously wondering. And the area is pi*(r*r)... and i consider myself bad at math...joseyisnoleet. |
-=Josey=-
- Shrugs. I've been up for about 5 days. Tired as heck and my mind isn't working right. ;\ Maybe after I eat breakfast I'll go to bed, doubtfull though. - Beats the hell out of insomnia. ;X |
Re: Re: Circles!
Quote:
centerx+mag*cos(ang+rotate),centery+mag*sin(ang+ro tate) it seems when you add to the numbers inside the sin and cos it makes them rotate, which would make sence, but its just a sidenote. look: NPC Code: |
to the person that said geometry this is pretty much trig..
i like making stuff move in a sine or cosine wave.. tangent is messed.. up.. any one out there besides kammy know what i mean |
Quote:
2*3.14*6=37.68 ... That is the circufrence ... the area of the circle is pi*r*r: 3.14*6*6=113.04 ... |
Re: Re: Re: Re: Circles!
Quote:
and it helps him learn where to place the varaibles for his equations ... |
What I am saying, is that if you add variables to to the numbers inside sine or cosine like incrementally add .05 to this.rotate and add it to i than it seems to rotate try the script I included when I first posted. Its actually very cool.
|
Quote:
|
| All times are GMT +2. The time now is 04:32 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.