Orbiting In Time

MetzoPainoMetzoPaino Member Posts: 195
edited May 2012 in Working with GS (Mac)
So I just followed T-Shirt Booth's tutorial on how to make an actor orbit another actor:

I want to use this in a musical fashion, so say at 12 o'lock a note is played. However to do this I need to be able to set the time it takes to orbit to a time that makes musical sense. So 4 seconds for every 2 bars if it was 120 bpm.

Here is the main orbiting equation, though there needs to be too, the other one being for the Y co-ordinates.

100*cos( self.Time *200%360)+ game.Sun X

So 100 is distance from object, 200 is speed and 360 is amount of orbit.

Is 200 a completely arbitrary number? When it's 100 it doesn't feel like 100 milliseconds, maybe 100 milliseconds per quarter of orbit.

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    think I would have written the expression:  100*cos(self.Time-200)%360+game.SunX

    to have notes play at specific degrees of an orbit
    simply use the rotating position of the orbitingActor

    for 90° (left) Sound during clockwise rotation:
    Rule: when (All)
    Attribute: self.Rotation > 0
    Attribute: self.Rotation < 2
    --Play Sound
    (the actor moves fast … so use a range for the position)

    demo with very annoying sounds:   http://www.mediafire.com/?edo42p9bks0a09z

    @};- MH
Sign In or Register to comment.