Simple Sin Graph
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
untorn

My uncle and I tried to produce a sin graph in basic a couple of years ago but we never figured it out. This one is for you Uncle Paul!


#define white RGB(255,255,255)
#define red RGB(255,0,0)

void autoexec()
{
int current_color=red;
int x=20;
int y=130;
int i=0;
int test=1;
int amplitude=50;//height
int frequency=720;//width or range
int accuracy=24;//amount of circles

while (!key[SCAN_ESC])
{
if (mouse.l)
{
for(i=0; i<=frequency; i+=accuracy)
{
x=x+5;
test=(sin(i)*amplitude)>>16;
CircleFill(x, y-test, 2, 1, current_color, screen);
}
mouse.l=0;
}
Line(20,130,x,130,white,screen);
ShowPage();
}
Exit('');
}

Posted on 2005-07-06 17:17:51

CrazyAznGamer

Nice.
=)

Now go and...
uh...
do that thing...
that VERGERs do...
make...
something...
I think it starts with a g...
um...
girls....
gauntlets...
guards....
gongs....
ARGH! Help me out here.

Posted on 2005-07-06 22:30:43

Omni

Sometimes the joy of programming is an award in itself. :)

Posted on 2005-07-06 22:58:16

untorn

Mmmm... a Gggggggame. Put a sprite on the right side of the screen, expand the function to always move to the end of the screen, give the sprite a jump function, animate the sin function, randomly change the sin's colors, speed and amplitude, award the player for jumping over the sin wave.

beh

Posted on 2005-07-07 01:54:44


Displaying 1-4 of 4 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.