annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <stdlib.h>
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include <SDL.h>
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 //#include "libps.h"
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "back.h"
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #include "debug.h"
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 //GsBOXF *boxs, box[BOX_NUM];
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 //BOXDT boxdt[BOX_NUM];
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 void Back(GsOT * j)
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 {
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 int i1;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 for (i1 = 0; i1 < BOX_NUM - 1; i1++) {
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 boxdt[i1].y += boxdt[i1].s;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 if (boxdt[i1].y > 240) {
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 boxdt[i1].x = rand() % 320;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 boxdt[i1].y = 0;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 }
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 }
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 boxs = box;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 for (i1 = 1; i1 < BOX_NUM - 1; i1++, boxs++) {
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 boxs->attribute = 0;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 boxs->x = boxdt[i1].x;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 boxs->y = boxdt[i1].y;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 boxs->w = 1;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 boxs->h = 1;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 boxs->r = rand() % 256;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 boxs->g = rand() % 256;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 boxs->b = rand() % 256;
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 GsSortBoxFill(boxs, j, 0);
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 }
01387a2e419e initial version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 }