Archive: DDR-Like AVS?


26th September 2008 04:12 UTC

DDR-Like AVS?
:D I had this Idea to implement a primitive beat detection to randomly generate arrows and have a human or the PC keep up to the music.

It stems from that little Car vis that unConed made...

I'd really like to stretch my brain around this and have some fun.


26th September 2008 08:33 UTC

zamuz did something like this for a les Noobiens pack


1st October 2008 16:28 UTC

certainly possible with a superscope

on beat:
ar = $PI*(rand(2001)-1000)/1000;
ax = cos(ar); ay = sin(ar);

this isn't perfect but gives you two vertices: (ax,ay),(-ax,-ay) which you can use to make the line in the direction of your arrow.

per point:
x = ax*(1-i) + (-ax)*i;
y = ay*(1-i) + (-ay)*i;

or more efficiently:
x = ax - 2*ax*i;
y = ay - 2*ay*i;

you can also use a similar ar to move a dynamic movement so you can make a nice picture of an arrow if you like...

I don't have avs at work to test, or remember the name of the code box, but try something like this in the bottom one.

d = sqrt(sqr(x)+sqr(y));
r = atan2(-y,x);
x = d*cos(r + ar);
y = d*sin(r + ar);

I can't remember but I think there is a tick box for rectangular coords as well which if you untick you can just use "r = r + ar;"

have fun. :)