//Throw a ball/////
case \'p\':
if (key == 0)
key = getch();
if (key == \'p\')
{
settextstyle(4,0,1);
setcolor(YELLOW);
outtextxy(200, 200, \"WOW!!!\");
printf(\"***SELECT ANGLE AND SPEED***\\n\");
printf(\"what is the angle: \");
scanf(\"%lf\",&angle);
printf(\"what is the speed: \");
scanf(\"%lf\",&velocity);
//각도 계산
vel_y= velocity*sin(angle * PI/180.0);
vel_x= velocity*cos(angle * PI/180.0);
pos_y = y_position;
moveto((int)x_position+10, (int)y_position+20);
/* Loop over time */
for (pos_x = x_position; pos_y <= y_position+30; pos_x++)
{
/* Calculate new height */
time = (pos_x - x_position) / vel_x;
pos_y = y_position - (vel_y * time) + (gravity * time * time);
/* Draw a line */
lineto((int)pos_x+10, (int)pos_y+20);
}
}
여기 구문에서 \'p\' 를 누르면 저 계산한거에 맞춰서 공이 날아 가게 만들었는데
제가 하고 싶은건 \'p\'를 눌렀을 때 저 \'wow!!!\' 글자가 먼저 나오게 하고
그다음 앵글과 스피드를 정하고 싶은데
제가 만든 소스는 p를 누른 후 앵글과 스피드를 지정해준후 공이 날라가면 wow!!! 글씨가 나오게되 ㅠㅠ
settextstyle(4,0,1);
setcolor(YELLOW);
outtextxy(200, 200, \"WOW!!!\");
이 구문의 위치도 바뀌 보고 했는데... wow!!! 이 글자가 계속 나중에 나오게 되네
p를 누름과 동시에 글씨가 먼저 나오게 할 방법 없을까?
부탁해 횽들 ㅠㅠ
흠 그려지긴 그려지는데 나중에 한꺼번에 나오는것 같은데 outtextxy 한 다음에 저 창을 다시 그려주는 걸 해봐 뭔지 명령어가 뭔지 격이 안난다.
Invalidate 든가 ? -_-
아 고마워 :)