comparison Bom.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 972a7f233b23
comparison
equal deleted inserted replaced
-1:000000000000 0:01387a2e419e
1 #include <stdlib.h>
2 #include <SDL.h>
3 #include "object.h"
4 #include "bom.h"
5 //#include "libps.h"
6 #include "sgoex.h"
7 #include"debug.h"
8
9 int sb_x, sb_y;
10 int sb_size = -1;
11 int count;
12 int se_voice[9];
13 int vab[10];
14
15 bomchar bchar[100];
16 bomchar *bom_p;
17 int bomend = -1;
18
19
20 void Bom(int x, int y)
21 {
22 int i;
23 bomend++;
24 if (bomend > 49) {
25 bomend = 49;
26 return;
27 }
28
29 i = bomend;
30 bchar[i].x = x;
31 bchar[i].y = y;
32 bchar[i].no = 0;
33 bchar[i].f = 0;
34 //se_voice[0] = SsUtKeyOn(vab[0], 0, 0, 65, 0, 60, 60);
35 return;
36 }
37
38 void Putbom()
39 {
40 int i;
41 for (i = 0; i < bomend + 1; i++) {
42 if (bchar[i].no != 8) {
43 count++;
44 DefSpriteEx(30 + bchar[i].no, 8, 8);
45 // PutSprite(count, bchar[i].x, bchar[i].y, 30 + bchar[i].no);
46 PutSpriteEx(30 + bchar[i].no, bchar[i].x+96, bchar[i].y+96, 2, 2, 1);
47 bchar[i].no++;
48
49 }
50 if (bchar[i].no == 8) {
51 //SsUtKeyOff(se_voice[0], vab[0], 0, 0, 65);
52 if (bomend == i) {
53 bomend--;
54 break;
55 }
56 if (bomend > i) {
57 bchar[i] = bchar[bomend];
58 bomend--;
59 i--;
60 }
61 }
62 }
63 }
64
65 void Superbom(int x, int y)
66 {
67 Bom(x + rand() % 128 - 64, y + rand() % 128 - 32);
68 /*sb_x = x; sb_y = y;
69 sb_size = 0; */
70 return;
71 }