Mercurial > hg > Members > kono > tree_dandy2
diff back.c @ 0:01387a2e419e
initial version
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 15:39:45 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/back.c Tue Dec 07 15:39:45 2010 +0900 @@ -0,0 +1,35 @@ +#include <stdlib.h> +#include <SDL.h> +//#include "libps.h" +#include "back.h" +#include "debug.h" + +//GsBOXF *boxs, box[BOX_NUM]; + +//BOXDT boxdt[BOX_NUM]; + +void Back(GsOT * j) +{ + int i1; + + for (i1 = 0; i1 < BOX_NUM - 1; i1++) { + boxdt[i1].y += boxdt[i1].s; + if (boxdt[i1].y > 240) { + boxdt[i1].x = rand() % 320; + boxdt[i1].y = 0; + } + } + + boxs = box; + for (i1 = 1; i1 < BOX_NUM - 1; i1++, boxs++) { + boxs->attribute = 0; + boxs->x = boxdt[i1].x; + boxs->y = boxdt[i1].y; + boxs->w = 1; + boxs->h = 1; + boxs->r = rand() % 256; + boxs->g = rand() % 256; + boxs->b = rand() % 256; + GsSortBoxFill(boxs, j, 0); + } +}