Thursday, 26 May 2011

Playing with the code

i got my program working, the colour balls are changing the colour of the particles and the spin is making it spin. so i played with the code and made a new ball and i add right and left spin code together and found somthing really cool. normally the spin balls make the particles spin out, but when i add them together they particles is absorbing into the mouse i found that really cool.

right ball
        vx -= (150 - radius) * 0.01 * cos(angle - (0.7 + 0.0005 * (150 - radius)));
        vy -= (150 - radius) * 0.01 * sin(angle - (0.7 + 0.0005 * (150 - radius)));
left ball
        vx -= (150 - radius) * 0.01 * cos(angle + (0.7 + 0.0005 * (150 - radius)));
        vy -= (150 - radius) * 0.01 * sin(angle + (0.7 + 0.0005 * (150 - radius)));
Absorb ball
        vx -= (150 - radius) * 0.01 * cos(angle + (0.7 + 0.0005 * (150 - radius)));
        vy -= (150 - radius) * 0.01 * sin(angle + (0.7 + 0.0005 * (150 - radius)));
        vx -= (150 - radius) * 0.01 * cos(angle - (0.7 + 0.0005 * (150 - radius)));
        vy -= (150 - radius) * 0.01 * sin(angle - (0.7 + 0.0005 * (150 - radius)));

No comments:

Post a Comment