drawing an animated cartoons(beginner)

Oct 23, 2008 at 9:27pm
Hi everyone, I am new to the programming world. I have a big trouble of doing my homework and I really need your help. My goal is to make a short animated cartoon showing an arrow hitting a target. Moreover, I must create a function that draws an arrow(or some other projectile) with specified tip (or some other reference point) and size (relative to some standard size). What I have writen so far does not work (there are errors): (I really appreciate your help and hope that someone can help me)
#include "ccc_win.h"
#include "time.h"

// pause the screen for x ms
void pause (int x)
{
clock_t goal = x + clock();
while (goal > clock());
}

// draw the Arrow with the header at "head", and the size scaled by "scale"
void drawArrow(Point head, double scale) {

cwin << Circle(head, 5 * scale);

}


int ccc_win_main() {
// DRAW OBJECT(S) -> MOVE/RESIZE OBJECT -> PAUSE -> CLEAR SCREEN -> REPEAT

int step = 5; // 5 step animation
int i = 0;

double x = 0;
double y = 1;

// Array route
// Point pt[5] = { Point(0,0), Point(1,0), Point(2,0), Point(1,1),Point(0,0)
}

while (i < step ) {

// clear the screen
cwin.clear();

// defind how the arrow move and scale. ask for user input?
drawArrow(Point(x++, y++), 0.5);

// Array route
// drawArrow(pt[i], 0.5);

// pause the screen for certain millisecond
pause(200);

i++;
}

return 0;
}



I know this is wordy but I am really in a big trouble. Please help~~thx a lot~~~~

Oct 23, 2008 at 10:42pm
Topic archived. No new replies allowed.