/*
 EGGX を使ったアニメーション  473088 榎田裕一郎
*/

#include <stdio.h>
#include <stdlib.h>
#include <eggx.h>

int main() {
  int win;
  float x, y, dx, dy;

  win=gopen(400,400);  /* 描画ウィンドウを開く */
  winname(win, "sample 1"); /* 名前をつける */

  newpen(win, 2);  /* 色は赤 */

  x=30.0;  /* x 座標位置 */
  y=30.0;  /* y 座標位置 */
  dx=15.0;  /* x 方向の移動速度 */
  dy=4.0;  /* y 方向の移動速度 */

  while(1) {
    gclr(win);                 /* 画面を消去 */
    fillarc(win, x, y, 10.0, 10.0, 0.0, 360.0, 1); /* 丸を描く */
    x+= dx;  
    y+= dy;  
    if( x > 380.0 ) break;
    msleep(50);                /* 少し待つ */
  }

  ggetch(win);
  gclose(win);

  return 0;

}

